From JSON to Snowflake Azure Data Factory - More than 1 column

kosmos 246 Reputation points
2022-12-08T16:21:06.767+00:00

Azure Data Factory allows you through COPY INTO activity to copy a JSON file to Snowflake in one column table. (VARIANT TYPE)

According to the documentation:

For JSON format, direct copy only supports the case that source Snowflake table or query result only has single column and the data type of this column is VARIANT, OBJECT, or ARRAY.

I would like to have instead of one column, two columns, being the first one the JSON file and the second one the load_date which would come from the pipeline activity date.
With parquet files I had some issues.

Does someone have a solution for this ?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. kosmos 246 Reputation points
    2022-12-12T08:25:45.47+00:00

    I found a workaround:

    I used the normal copy activity in ADF and copy only one column. Then I create a script in ADF that copies the previous table and adds a new column.

    BEst!

    1 person found this answer helpful.

  2. KranthiPakala-MSFT 46,737 Reputation points Microsoft Employee Moderator
    2022-12-12T02:39:06.82+00:00

    Hello @kosmos ,

    Thanks for the question and using MS Q&A platform.

    I doubt it is possible using single ADF copy activity, as the document clearly states that the ADF service checks the settings and fails the Copy activity run if the following criteria is not met:

    269443-image.png

    But as a workaround I would recommend giving a try by adding an additional column to your source section and do a mapping and see if the copy work.
    Sorry I wasn't able to test this as I don't have a snowflake instance, but you can simply create an additional column in your copy activity source and add mapping and see how it goes.

    In case if it fails, then as mentioned in the documentation, the criteria have to be met to run a successful copy.

    Do let us know how it goes.

    Thank you

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.