i am not sure if anyone else is facing the same issue of using ADF with snowflake. We had raised a support ticket with MS and they had acknowledged this to be a v2 driver bug. Currently our workaround is to ingest everything to snowflake as string. And create a store procedure to change the data type
Snowflake V2 Connector show all data types as String in Sink
Hello All,
I had to change the version from Snowflake Legacy connector to SnowflakeV2 Connector and I found out very weird behavior of the connector. The connector interprets in Sink activity, snowflake's data types as string of all columns, which is causing some data truncation when the pipeline is inserting new records into the target table. In the dataset all columns data types are fine, but when I used it into the sink all columns are string. The issue occurred mainly when you try to insert a timestamp data. For instance, Snowflake table contains column which is in TIMESTAMP_NTZ(9) data type and when you pass to the sink a timestamp value, the milliseconds fraction is cut off. passing '2024-04-30 10:00:33.357' in Snowflake data is inserted as '2024-04-30 10:00:33.000'
I think this is a bug which is related to how the Snowflake V2 Connector is interprets the data types! If the support has a workaround or idea how this should be fixed, please share it.
Azure Data Factory
2 additional answers
Sort by: Most helpful
-
Ivan Miliovsky 25 Reputation points
2024-07-18T08:37:36.74+00:00 Thanks for the answer Vinodh247, but none of those workarounds are working. The only way how to bypass this issue with the timestamp is to use schemaless data set and to parametrize it. Otherwise the the Snowflake V2 connector is not recognizing properly column's data types into the Sink activity.
-
Chandra Boorla 14,585 Reputation points Microsoft External Staff Moderator
2024-07-23T11:43:00.6233333+00:00 I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.
Issue: I had to change the version from Snowflake Legacy connector to SnowflakeV2 Connector and I found out very weird behavior of the connector. The connector interprets in Sink activity, snowflake's data types as string of all columns, which is causing some data truncation when the pipeline is inserting new records into the target table. In the dataset all columns data types are fine, but when I used it into the sink all columns are string. The issue occurred mainly when you try to insert a timestamp data. For instance, Snowflake table contains column which is in TIMESTAMP_NTZ(9) data type and when you pass to the sink a timestamp value, the milliseconds fraction is cut off. passing '2024-04-30 10:00:33.357' in Snowflake data is inserted as '2024-04-30 10:00:33.000'
I think this is a bug which is related to how the Snowflake V2 Connector is interprets the data types! If the support has a workaround or idea how this should be fixed, please share it.
Solution: The only way how to bypass this issue with the timestamp is to use schemaless data set and to parametrize it. Otherwise the the Snowflake V2 connector is not recognizing properly column's data types into the Sink activity.
If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click
Accept Answer
andYes
for was this answer helpful. And, if you have any further query do let us know.