【问题标题】:Talend - Dynamic Column Name (Enterprise version)Talend - 动态列名(企业版)
【发布时间】:2016-06-15 02:41:17
【问题描述】:

谁能帮我解决这个问题?

我有很多文件要处理,其中两个类似于下面的屏幕截图,我的预期输出

我在 Talend 上使用此转换:tFileList---tInputExcel---tUnpivotRow---tMap---tPostgresqlOutput

输出与我的预期输出不同。这是输出的截图

谁能帮助我达到我的预期输出,就像我上面的第一张图片一样?

【问题讨论】:

    标签: dynamic etl data-warehouse talend


    【解决方案1】:

    这将非常困难。您必须将其作为文本文件处理。每当您在第一列中找到“存储”值时,您都会使用该值更新您的类型。

    我会这样开始: 基本上 tJavaFlex 开始部分将包含:

    String col1Type
    String colNType
    

    主要部分:

    if input_row.col0.equalsIgnoreCase("store") {
    col1Type = input_row.col1;
    col2Type = input_row.col2;
    colNType = input_row.colN;
    continue; /*(so this record will be Ignored for the rest of the components!)*/
    }
    output_row.col1Type = col1Type;
    output_row.col1Value = Integer.valueOf(input_row.col1); 
    /*coz we have text and need numbers :( */
    

    我认为使用传播结果将使您免于写下所有其他字段。 从这里开始,它会非常简单,因为您有 key-type-value-type-value-type-value 结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-11
      • 2017-07-26
      • 1970-01-01
      • 2017-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多