Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Connect 2025! Join us in Orlando join us for 3 days of immersive learning: REGISTER TODAY

tFileOutputParquet - java.lang.NullPointerException: name should not be null

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
TalendSolutionExpert
Contributor II
Contributor II

tFileOutputParquet - java.lang.NullPointerException: name should not be null

Last Update:

Feb 9, 2024 2:06:24 PM

Updated By:

Jamie_Gregory

Created date:

Nov 10, 2023 4:51:58 AM

[Background]
-Talend Studio 7.3.1 or Talend Studio 8.0.1

[Problem]
-We have a workflow to convert Excel files to parquet,tFileInputExcel with dynamic
0EM5b00000E5fxq.png

-Run the job, and it gives us: name should not be null
0EM5b00000E5fy5.png

[Reason]
-There are some empty columns in the source Excel file:
0EM5b00000E5b6s.png

[Workaround]

-For the tFileInputExcel dynamic, It needs the first line to guess the schema.

-The example job source Excel didn't set a real header. Please Add tJavaFlex to transform Dynamic metadata with:

To the start code:

boolean isFirst = true; 

To the main code:

if(isFirst) {
  isFirst = false;
  Dynamic newDyn = row1.newColumn.clone(false);
  for(DynamicMetadata meta : newDyn.metadatas) {
            // reset column name,
            String newColumnName = "field"+meta.getColumnPosition();
            meta.setName(newColumnName);
            meta.setDbName(newColumnName);            
            System.out.println("New  dynamic field name: '"+ meta.getDbName()+"' ");
  }
  row2.newColumn = newDyn;
} 
After that, the job works.
0EM5b00000E5fyj.png

Labels (1)
Version history
Last update:
‎2024-02-09 02:06 PM
Updated by: