<?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: Can't move xml to Snowflake AWS target in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420798#M9584</link>
    <description>&lt;P&gt;Yes. Average 3MB, Max 12MB&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 15:13:14 GMT</pubDate>
    <dc:creator>xiniavargas</dc:creator>
    <dc:date>2024-02-19T15:13:14Z</dc:date>
    <item>
      <title>Can't move xml to Snowflake AWS target</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420256#M9546</link>
      <description>&lt;P&gt;We are moving data from SQL to Snowflake AWS.&lt;/P&gt;
&lt;P&gt;We have a table that contains a varbinary max which has an xml. To see the XML in SQL, we use this query:&amp;nbsp;SELECT CONVERT(xml,(CONVERT(varbinary(max),columnname)))&lt;/P&gt;
&lt;P&gt;We first left everything as default in Qlik, when we moved the data, Snowflake type was binary and when we ran this "SELECT HEX_DECODE_STRING(TO_VARCHAR("columnname"))" the XML was missing information as binary type has a limit in Snowflake.&lt;/P&gt;
&lt;P&gt;So, we tried to change the Transforms options in Qlik, we have tried the following:&lt;/P&gt;
&lt;P&gt;#1 go to table settings, select column and change the type to CLOB and the subtype to XML, when we run the load, we see Snowflake type as variant, but table is not loaded and we see this error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;"SQL_ERROR SqlState: 22P02 NativeError: 100100 Message: Error parsing XML: 0x3C526571756573743E3C46415353657276696365436F6E74726F6C3E3C4D6573736167654C616E6775616765436F64653E6"&lt;/P&gt;
&lt;P&gt;#2&amp;nbsp;go to table settings, select column and change the type to CLOB and the subtype to XML and add an expression "hex(columnname)", we get&amp;nbsp; error&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FROM (select $1, $2, $3, parse_xml($4), $5, $6, $7, $8 FROM '@"DB"."PUBLIC"."ATTREP_IS_DB_23b83639_7a18_cb46_add0_b51bbec25be6"/80/') files = ('LOAD00000001.csv.gz') force=true&lt;BR /&gt;RetCode: SQL_ERROR SqlState: 22000 NativeError: 100072 Message: NULL result in a non-nullable column&lt;/P&gt;
&lt;P&gt;there are no nulls in the table, we are not sure what we are missing. Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 21:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420256#M9546</guid>
      <dc:creator>xiniavargas</dc:creator>
      <dc:date>2024-02-16T21:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can't move xml to Snowflake AWS target</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420296#M9548</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/262003"&gt;@xiniavargas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to Qlik Community!&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;We first left everything as default in Qlik, when we moved the data, Snowflake type was binary and when we ran this "SELECT HEX_DECODE_STRING(TO_VARCHAR("columnname"))" the XML was missing information as binary type has a limit in Snowflake.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm afraid I did not get the meaning of "XML was missing information as binary type", all work fine for me. As a sanity test, the SQL Server data type&amp;nbsp;&lt;FONT face="courier new,courier"&gt;varbinary(max)&lt;/FONT&gt; maps to&amp;nbsp;&lt;FONT face="courier new,courier"&gt;BINARY(8388608)&lt;/FONT&gt; in Snowflake, the query you mentioned works for me as well:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_0-1708147359146.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160090i0527F7E0473427EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="john_wang_0-1708147359146.png" alt="john_wang_0-1708147359146.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;or in DBeaver:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_1-1708147907832.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160091i21ABCF8D1C138C54/image-size/large?v=v2&amp;amp;px=999" role="button" title="john_wang_1-1708147907832.png" alt="john_wang_1-1708147907832.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;While migrating the data from Microsoft SQL Server to Snowflake, the data type mapping should be considered. For example in&amp;nbsp;&lt;A title="Microsoft SQL Server the data type&amp;nbsp;varbinary(max) can be up to 2G" href="https://learn.microsoft.com/en-us/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=sql-server-ver16#:~:text=max%20indicates%20that%20the%20maximum%20storage%20size%20is%202%5E31%2D1%20bytes." target="_blank" rel="noopener"&gt;Microsoft SQL Server the data type&amp;nbsp;&lt;FONT face="courier new,courier"&gt;varbinary(max)&lt;/FONT&gt; can be up to 2G&lt;/A&gt; size, but in&amp;nbsp;&lt;A title=" Snowflake the data type BINARY maximum length is 8 MB" href="https://docs.snowflake.com/en/sql-reference/data-types-text#:~:text=for%20binary%20strings.-,BINARY,The%20maximum%20length%20is%208%20MB%20(8%2C388%2C608%20bytes).,-Unlike%20VARCHAR%2C%20the" target="_blank" rel="noopener"&gt;Snowflake the data type &lt;FONT face="courier new,courier"&gt;BINARY&lt;/FONT&gt; maximum length is 8 MB&lt;/A&gt;&lt;SPAN&gt;. So in task setting, the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Limit LOB size to (KB)&lt;/FONT&gt; maximum valid value is 4096 (KB), Qlik Replicate User Guide does not mention this limitation however it's a common rule of&amp;nbsp;heterogeneous databases replication.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 05:41:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420296#M9548</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-17T05:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can't move xml to Snowflake AWS target</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420776#M9582</link>
      <description>&lt;P&gt;Our XMLs are too big to be a binary in Snowflake, when Qlik migrates them to binary, not all the XML data is in the column and it is missing information, that is why we need to migrate them to variant, but we haven't been able to move the contents to Snowflake per the errors mentioned in the main thread.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 14:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420776#M9582</guid>
      <dc:creator>xiniavargas</dc:creator>
      <dc:date>2024-02-19T14:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can't move xml to Snowflake AWS target</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420791#M9583</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/262003"&gt;@xiniavargas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Are you meaning the XMLs size in source side exceed 8M so it's truncated in Snowflake? what's the max and average size of the XMLs.&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 14:53:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420791#M9583</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-19T14:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can't move xml to Snowflake AWS target</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420798#M9584</link>
      <description>&lt;P&gt;Yes. Average 3MB, Max 12MB&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 15:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2420798#M9584</guid>
      <dc:creator>xiniavargas</dc:creator>
      <dc:date>2024-02-19T15:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can't move xml to Snowflake AWS target</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2421169#M9607</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/262003"&gt;@xiniavargas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for the update , seems the behavior can be reproduced with t&lt;SPAN&gt;he XML column in source SQL Server table size is 12M. Please open a support ticket with below information:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. The source table creation DDL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. How to make a 12MB XML in the table&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. Set souce_unload/target_load to Verbose, recreate the issue and upload the Diag Packages.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 12:31:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Can-t-move-xml-to-Snowflake-AWS-target/m-p/2421169#M9607</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-20T12:31:15Z</dc:date>
    </item>
  </channel>
</rss>

