One Star

How does one reference a tColumnList from the globalMap?

Hi Talend folks!
I'm using the tColumnList and it appears to insert a tables schema as a list into the GlobalMap. Works like a charm and I've included some of the GlobalMap printed out. What I can't seem to figure out is how do you reference one of these items from a list stored in the GlobalMap?
I tried accessing them as arrays, like  tMysqlColumnList_2_COLUMN_NAME, but no go. Tried iterating, but it only outputs 1 row...so I'm a little confused.

Starting job testresponse at 02:10 19/05/2016.
connecting to socket on port 3786
connected
{tMysqlColumnList_2_NUMERIC_SCALE=0
 conn_tMysqlConnection_1=com.mysql.jdbc.JDBC4Connection@2cb4c3ab
 db_tMysqlConnection_1=ELA_Limesurvey
 tMysqlColumnList_2_CHARACTER_MAXIMUM_LENGTH=null
 tMysqlColumnList_2_NUMERIC_PRECISION=10
 tMysqlColumnList_2_DATA_TYPE=int
 tMysqlColumnList_2_COLUMN_KEY=PRI
 concurrentHashMap={}
 tMysqlConnection_1_SUBPROCESS_STATE=0
 tMysqlColumnList_2_IS_NULLABLE=NO
 tMysqlColumnList_2_COLUMN_DEFAULT=null
 tMysqlColumnList_2_COLUMN_NAME=id
 tMysqlColumnList_2_SUBPROCESS_STATE=0}
{tMysqlColumnList_2_NUMERIC_SCALE=null
 tFixedFlowInput_1_NB_LINE=1
 ColumnType=int
 conn_tMysqlConnection_1=com.mysql.jdbc.JDBC4Connection@2cb4c3ab
 db_tMysqlConnection_1=ELA_Limesurvey
 tMysqlColumnList_2_CHARACTER_MAXIMUM_LENGTH=null
 tMysqlColumnList_2_NUMERIC_PRECISION=null
 tMysqlColumnList_2_DATA_TYPE=datetime
 tMysqlColumnList_2_COLUMN_KEY=
 concurrentHashMap={}
 tMysqlConnection_1_SUBPROCESS_STATE=0
 tMysqlColumnList_2_IS_NULLABLE=YES
 ColumnName=id
 tMysqlColumnList_2_COLUMN_DEFAULT=null
 tMysqlColumnList_2_COLUMN_NAME=submitdate
 tMysqlColumnList_2_SUBPROCESS_STATE=0}
{tMysqlColumnList_2_NUMERIC_SCALE=0
 tFixedFlowInput_1_NB_LINE=1
 ColumnType=datetime
 conn_tMysqlConnection_1=com.mysql.jdbc.JDBC4Connection@2cb4c3ab
 db_tMysqlConnection_1=ELA_Limesurvey
 tMysqlColumnList_2_CHARACTER_MAXIMUM_LENGTH=null
 tMysqlColumnList_2_NUMERIC_PRECISION=10
 tMysqlColumnList_2_DATA_TYPE=int
 tMysqlColumnList_2_COLUMN_KEY=
 concurrentHashMap={}
 tMysqlConnection_1_SUBPROCESS_STATE=0
 tMysqlColumnList_2_IS_NULLABLE=YES
 ColumnName=submitdate
 tMysqlColumnList_2_COLUMN_DEFAULT=null
 tMysqlColumnList_2_COLUMN_NAME=lastpage
 tMysqlColumnList_2_SUBPROCESS_STATE=0}

Thanks!
Garf
2 REPLIES

Re: How does one reference a tColumnList from the globalMap?

Here's an example job that prints all the columns of the table. 
The t*ColumnList components will execute a metadata query in the BEGIN section of the component and populate the globalMap. by using the Iterate link, we allow the component to populate the globalMap with one column per iteration. 

If you need the data in a flow, you can use the tIterateToFlow component to gather up all the iterations and then output them as a flow:

One Star

Re: How does one reference a tColumnList from the globalMap?

Thanks for the guidance John, it was the tFlowIterate that I was missing.  I'm now able to work with dynamic schemas to normalize data from a table. Still trying to figure out a few things on the output side, but I'll post my working sample back to the group  to share as soon as I get a few other pieces working.
Garf