0

If I have a Table Input step with a query such as Select * from myTable
and it goes to a User Defined Java Class step, the following code allows me to grab the column names dynamically from the table.

RowMetaInterface rowMetaInterface = getInputRowMeta();
List myList = rowMetaInterface.getValueMetaList();
String colName;

for(int i=0;i<myList.size();i++){
colName = ((ValueMetaInterface)myList.get(i)).getName();
}

However, this code doesn't work if the first step is a CSV input step. I have a variable for the CSV filename, so I can't do a 'Get Fields' to pull the columns. Is there a way I can read the csv column names dynamically?

eych
  • 1,262
  • 2
  • 16
  • 37

1 Answers1

0

Not a solution, but some interesting hints: http://diethardsteiner.github.io/pdi/2015/10/31/Transformation-Executor-Record-Groups.html

SirZ
  • 13
  • 4