<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [Snowflake] tDBOutputBulk - how to read files moved to internal stage in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Snowflake-tDBOutputBulk-how-to-read-files-moved-to-internal/m-p/2428528#M140324</link>
    <description>&lt;P&gt;I think there should be other attributes that need to be set for the file_format[type=JSON], I suggest you to ask for help on &lt;A href="https://community.snowflake.com/s/forum" target="_self"&gt;Snowflake community&lt;/A&gt; about the Copy into command.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Shicong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2024 03:01:04 GMT</pubDate>
    <dc:creator>Shicong_Hong</dc:creator>
    <dc:date>2024-03-08T03:01:04Z</dc:date>
    <item>
      <title>[Snowflake] tDBOutputBulk - how to read files moved to internal stage</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Snowflake-tDBOutputBulk-how-to-read-files-moved-to-internal/m-p/2425428#M140272</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;I am working on Talend job to load data to Snowflake but without using tDBOutput component. I would like to use bulk load (copy into).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am able to send the json file to internal named stage using&amp;nbsp;tDBOutputBulk. But problem is that I would like to read this file using tDBRow (copy into statement). I don't want to use tDBBulkExec because as far as I understand there is no option to use transformation (select statement) loading the data by&amp;nbsp;tDBBulkExec. Unfortunately I need to add some columns (transformation) before loading to Snowflake, this is why I am trying to utilize tDBRow + copy into&amp;nbsp; TABLE from (select ... from &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/246551"&gt;@Stage&lt;/a&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue is that json file before sending it to the stage (in my local laptop) looks good&lt;/P&gt;
&lt;P&gt;e.g&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[{"data":{"name":"AAA","surname":"BBBB"}},{...]&lt;/P&gt;
&lt;P&gt;but after moving json file to stage the file name is different, the file is compressed(?) (the file name looks like internal-8576818063155977688.gz) but the worst thing is that content of the file is different, meaning:&lt;/P&gt;
&lt;P&gt;"[{""data"":{""name"":""AAA"",""surname"":""BBBB""}},{ ...]"&lt;/P&gt;
&lt;P&gt;(double quotes added at the beginning and at the end of the json array and additionally each occurrence of double quote is duplicated).&lt;/P&gt;
&lt;P&gt;I am guessing that it causes that I am not able to load dat to Snowflake correctly.&lt;/P&gt;
&lt;P&gt;This is my copy into command defined in tDBRow:&lt;/P&gt;
&lt;P&gt;"copy into MY_DATABASE.MY_SCHEMA.TABLE from (select " + ((Long)globalMap.get("load_id")) + ", '" + context.environment + "', $1 from &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/120786"&gt;@tmp&lt;/a&gt;_stage) file_format = (type = 'JSON') on_error = 'skip_file'".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After loading data into Snowflake table the data looks strange:&lt;/P&gt;
&lt;P&gt;1,DEV,"[{"&lt;/P&gt;
&lt;P&gt;1,DEV,"data"&lt;/P&gt;
&lt;P&gt;1,DEV,":{"&lt;/P&gt;
&lt;P&gt;1,DEV,"name"&lt;/P&gt;
&lt;P&gt;1,DEV,":"&lt;/P&gt;
&lt;P&gt;1,DEV,"AAA"&lt;/P&gt;
&lt;P&gt;1,DEV,","&lt;/P&gt;
&lt;P&gt;1,DEV,"surname"&lt;/P&gt;
&lt;P&gt;1,DEV,":"&lt;/P&gt;
&lt;P&gt;1,DEV,"BBBB"&lt;/P&gt;
&lt;P&gt;1,DEV,"}},{"&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;1,DEV,"}}]"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone share what I am doing not correclty?&lt;/P&gt;
&lt;P&gt;I would like to load all json documents from my json array, each document should be loaded to the new row in snowflake table. Unfortunately, currently I have many rows but there are only some parts of the document in the last column.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 15:50:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Snowflake-tDBOutputBulk-how-to-read-files-moved-to-internal/m-p/2425428#M140272</guid>
      <dc:creator>JackStrong</dc:creator>
      <dc:date>2024-02-29T15:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: [Snowflake] tDBOutputBulk - how to read files moved to internal stage</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Snowflake-tDBOutputBulk-how-to-read-files-moved-to-internal/m-p/2428528#M140324</link>
      <description>&lt;P&gt;I think there should be other attributes that need to be set for the file_format[type=JSON], I suggest you to ask for help on &lt;A href="https://community.snowflake.com/s/forum" target="_self"&gt;Snowflake community&lt;/A&gt; about the Copy into command.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Shicong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 03:01:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Snowflake-tDBOutputBulk-how-to-read-files-moved-to-internal/m-p/2428528#M140324</guid>
      <dc:creator>Shicong_Hong</dc:creator>
      <dc:date>2024-03-08T03:01:04Z</dc:date>
    </item>
  </channel>
</rss>

