Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-2374

DIRecordVisitor to fill Studio Dynamic object's column name by tck Schema.Entry.getName which must follow tck name rule

Apply templateInsert Lucidchart DiagramXMLWordPrintable

    • All
    • GreenHopper Ranking:
      0|i2nqjn:
    • 9223372036854775807
    • Small

      See :
      https://github.com/Talend/component-runtime/blob/0bc6cf64eb5283ed6d4997fd1eba809a4bec54fa/component-studio/component-runtime-di/src/main/java/org/talend/sdk/component/runtime/di/record/DiRecordVisitor.java#L208-L213
      It fill dynamic metadata column name by Schema.Entry.getName, that make a old jdbc tuj TDI44051_tJDBCInput_MySQL5_Dynamic_SpecialCharacter fail:

      As query is "select 5 as col$", so the column label is "col$", and then tck convert it to follow tck rule "col_", that's ok, but then when fill dynamic column name, use tck entry name, not the expected "col$".

      This is old tmysqlinput fill way(tjdbcinput follow it):

      //rsmd is jdbc resultsetmetadata api:
      dcm_<%=cid%>.setName(rsmd_<%=cid%>.getColumnLabel(i));
      dcm_<%=cid%>.setDbName(rsmd_<%=cid%>.getColumnName(i));
      

      This is tcompv0 process way, which use a special property to decide to use which api:

           org.apache.avro.Schema dynamicFieldSchema_<%=cid%> = dynamicField_<%=cid%>.schema();
           // set name
           if("true".equals(dynamicField_<%=cid%>.getProp("ENABLE_SPECIAL_TABLENAME"))){
              dynamicMetadata_<%=cid%>.setName(dynamicField_<%=cid%>.getProp("talend.field.dbColumnName"));
           }else{
              dynamicMetadata_<%=cid%>.setName(dynamicField_<%=cid%>.name());
           }
      

            Unassigned Unassigned
            wwang Wei Wang
            Wei Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: