Writing a Knime table to Snowflake

I am writing a Knime table to Snowflake. The table has a little over 14,000 records and 21 columns, containing both string and numeric fields. The issue is that when the table reaches Snowflake, it has fields with a length of 16,000,000 characters. I would like to limit this to 256 characters from Knime. Is this possible?

Hi @RocioPerez , Welcome to the KNIME community!

Are you referring to the apparent length of varchar columns in the snowflake table based on the default “varchar” size?

If the column definition is varchar, then Snowflake will create the 16million character column by default, although for a given row in a column it will only use the space it actually needs, even though it has this high “max size”. It is possible to change the size though, so the default is not used.

What mechanism are you using for creating the table, and which nodes are you using for inserting the data?

e.g. you could be using a DB Table Creator followed by DB Loader, or DB Insert. Alternatively, you might be scripting the table creation in a DB SQL Executor, in which case you should have freedom to create whatever sizes you wish.

image

If you are using DB Table Creator, you can modify column definitions, using either the Name-based SQL Type Mapping (for individual column specification), or KNIME-Based SQL Type Mapping (for the same settings across all columns of a given type)

With the above, my snowflake table was created as this:

image

2 Likes

Thank you, I will check if this solution works