Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I want to get all the column name which is defined on tMysqlInput component and the flow is contained in the picture below.
- Inside the tMysqlInput, I defined the Query which related to context variables, so it will change sometimes I run it. So I defined the Schema which is "dynamic" type.
- My target is getting all the column name with it's data in Mysql.
Who can help me for this case please!!!
Thank you guys!
Try this in your java row
Dynamic dyn = row1.dynamic_column_name;
Set<String> columns = dyn.getAllColumnNames();
If you want to loop through them all you can do something like
for(int i = 0; i < dyn.getColumnCount(); i++){
DynamicMetadata meta = dyn.getColumnMetadata(i);
String col_name = meta.getName();
}
Thank you @evansdar for your help. It worked perfectly!
Also, my currently purpose is getting data from mysql (about rows size which I defined before) and then put it into dataset. The final flow is:
Could you please help me how can I transform it into dataset from tMysqlInput (which used my custom query)?
Thank you and hope you have a happy day!