Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
hiualx
Contributor
Contributor

Can't Rename Column in Dynamic When Using SnowflakeInput

Hi,

 

We are dynamicly renaming the columns of a tDBInput. Up to now it has been a mysql where we got our data from but we have decided to move to Snowflake but when we exchange the tDBInput (mysql) to tDBInput (snowflake) the same code fails with an index outOfBounds exception where the index is -1 in an array with the length of the number of columns. After doing a java debug and stepping through the code i saw that for some reason the snowflakeInput requires the columnnames to always stay the same because for some reason it trys to look at the metadata of the first dynamic row while loading the second so the job fails after the first row. This is also true when using the jdbc connector directly via tJDBCInput

The isolated job setup looks like this:

tDBInput(Snowflake)(schema: resultset -Dynamic) ->  tJavaFlex -> tLogRow

Pseudo Code in tJavaFlex (Main):

for(Columns in resultset){

    if(columName starts with "H_"){

          rename columnName so it Starts with HS instead;

     }

}

 

As i said using any other tDBInput (oracle or mysql) this setup works, same code but with snowflake as the input the job explodes. Why is that and is there a workaround? (Talend Version we are using is 7.x)

Labels (1)
  • v7.x

1 Reply
christy2951hernandez
Contributor
Contributor

Hello @hiualx ,

Snowflake might have stricter requirements or different behavior regarding dynamic schema changes. Verify the schema mapping in Talend. Ensure that the metadata is initialized correctly for the Snowflake input component. In Talend, make sure that the Dynamic schema type is properly configured for the Snowflake component. Since the issue appears specific to Snowflake, consider adding custom logic to handle Snowflake's dynamic schema differently.

Ensure the Snowflake input component is correctly configured to use dynamic schema. Use a static schema initially to troubleshoot and then switch to dynamic. Use a tMap component to handle the dynamic column renaming more gracefully.

Best Regards,
ny state of health