One Star

[resolved] Dynamic Column Mapping

Hi,
I want to perform mapping of column dynamically.
Basically, i have a fixed output Column structure. The incoming column names can be different.
eg:
Output columns: Name, Sex, Age
Input 1 Columns : Name, Gender, Age
Input 2 Columns : Names, Sex, Ages
Input 3 Columns : Names, Gender, Ages
and so on..
I want the Name to be Mapped with Name, Names, ..
Sex to mapped to Sex, Gender, ..
Age to be mapped to Age, Ages, ..
how to work around to get this done? (I tried using tMap but it allows kind of fixed mapping, can we make it dynamic?)
1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: [resolved] Dynamic Column Mapping

Hi AbiJeev,
Here is a response for your situation 
the incoming column name(from Oracle DB) and output table column names (MySQL DB) are different

on forum :http://www.talendforge.org/forum/viewtopic.php?id=37314
Could you please have a look at it?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
8 REPLIES
Moderator

Re: [resolved] Dynamic Column Mapping

Hi,
Your input files column order is not fixed? Could you please upload your tMap editor screenshot into forum?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Dynamic Column Mapping

Yeah, it is not fixed.
Can we make it work if it is fixed?
In the screenshot columns are in order but it may not be in order sometimes.
Moderator

Re: [resolved] Dynamic Column Mapping

Hi,
Talend Dynamic Schema allows you to design schema with an unknown column structure (unknown name and number of columns), however, the output Column structure should be dynamic as well not fixed.
How many input files need to be loaded into a fixed output Column structure file? Could you use several input components to read your input files then mapping them in tMap?
Such as: tfileinputdelimited_1(Name, Gender, Age)-->tMap-->output(Name, Sex, Age)
tfileinputdelimited_2(Names, Sex, Ages)
tfileinputdelimited_3(Names, Gender, Ages)
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Moderator

Re: [resolved] Dynamic Column Mapping

Hi ksultania,
Here is a response for your issue, could you please check it?
http://www.talendforge.org/forum/viewtopic.php?id=37314
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Dynamic Column Mapping

Hi,
  I have the same requirement, I have defined column as dynamic in both input and out. Both my input and out is dynamic. When I run with same column name am able to run the code properly and getting output. But if the incoming column name(from Oracle DB) and output table column names (MySQL DB) are different then am getting error like unknown field list.
  Kindly help me how to resolve this.
Regards,
AbiJeev
Moderator

Re: [resolved] Dynamic Column Mapping

Hi AbiJeev,
Here is a response for your situation 
the incoming column name(from Oracle DB) and output table column names (MySQL DB) are different

on forum :http://www.talendforge.org/forum/viewtopic.php?id=37314
Could you please have a look at it?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Dynamic Column Mapping

Hi Sabarina,
  The link you have provided was useful. Thank you.
Highlighted
One Star

Re: [resolved] Dynamic Column Mapping

hi,
I have source file with dynamic columns which means it may come with 50 columns or 100 columns or "n" columns
i have to read this file and apply transformations based on column number provided by input. can we achieve this in talend?
Please help me out.