<?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: Parse json at Qlik Replicate level in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013368#M4421</link>
    <description>&lt;P&gt;Thanks John_wang and Heinvandenheuvel for your thoughts on this not trivial qustion. Indeead we can not use User-defined transformations because LOB does not support transformations in QR.&lt;BR /&gt;But we will review aproach suggested by Heinvandenheuvel (use FILE) with followed processing .&lt;/P&gt;
&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 19:38:32 GMT</pubDate>
    <dc:creator>sergsyb</dc:creator>
    <dc:date>2022-12-06T19:38:32Z</dc:date>
    <item>
      <title>Parse json at Qlik Replicate level</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013176#M4418</link>
      <description>&lt;P&gt;Hi guru,&lt;/P&gt;
&lt;P&gt;There is following environment:&lt;/P&gt;
&lt;P&gt;MongoDB is a Source and Sybase IQ is a Target. All data in MongoDB store in json format.&lt;/P&gt;
&lt;P&gt;Is it possible at QR level, in some way, to parse &lt;SPAN&gt;incoming&amp;nbsp; json&lt;/SPAN&gt;&amp;nbsp;LOB and transfer &amp;nbsp;already parsed values instead original LOB (as &lt;SPAN&gt;it&lt;/SPAN&gt; &lt;SPAN&gt;doing&lt;/SPAN&gt; &lt;SPAN&gt;by&lt;/SPAN&gt; &lt;SPAN&gt;default&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;to the target end point?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, &amp;nbsp;following LOB is incoming from the Source to the Qlik Replicate&lt;/P&gt;
&lt;P&gt;{"employees":[&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;{"name":"Shyam", "email":shyamjaiswal@gmail.com},&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;{"name":"Bob", "email":bob32@gmail.com},&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;{"name":"Jai", "email":jai87@gmail.com}&amp;nbsp;&lt;/P&gt;
&lt;P&gt;]}&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need to parse it at QR level (parser we will develop ourselves) and send to the Target (Sybase IQ) following cmds:&lt;/P&gt;
&lt;P&gt;Insert into employees values ("Shyam", "&lt;A href="mailto:shyamjaiswal@gmail.com" target="_blank"&gt;shyamjaiswal@gmail.com&lt;/A&gt;")&lt;/P&gt;
&lt;P&gt;Insert into employees values ("Bob ", " &lt;A href="mailto:bob32@gmail.com" target="_blank"&gt;bob32@gmail.com&lt;/A&gt;")&lt;/P&gt;
&lt;P&gt;Insert into employees values ("Jai", " &lt;A href="mailto:jai87@gmail.com" target="_blank"&gt;jai87@gmail.com&lt;/A&gt;")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 13:33:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013176#M4418</guid>
      <dc:creator>sergsyb</dc:creator>
      <dc:date>2022-12-06T13:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Parse json at Qlik Replicate level</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013276#M4419</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/192253"&gt;@sergsyb&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Really an interesting topic. In my opinion the parser should not be implemented within Replicate as:&lt;/P&gt;
&lt;P&gt;1- MongoDB is no schema, it's hard to guarantee the valid RDBMS SQL produced (for example any column values maybe is NULL or any column maybe missed in a row etc);&lt;/P&gt;
&lt;P&gt;2- I'm afraid the performance even if you can develop a parser by using the&amp;nbsp;&lt;A title="User-defined transformations" href="https://help.qlik.com/en-US/replicate/May2022/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/user_defined_transformations.htm" target="_blank" rel="noopener"&gt;User-defined transformations&lt;/A&gt;&amp;nbsp;especially while the JSON is complex and big&lt;/P&gt;
&lt;P&gt;So far the common approach is that, set Store Changes mode in task setting and store the LOB (in fact it's the data come from MongoDB) in Sybase IQ, parse the JSON/LOB while consuming the datas in your apps/parser programs. In this way the parser stage is out of replication process and it will not impact the replication performance, and any data from MongoDB will not generate invalid SQL issues, it's much easier to control in your programs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 15:41:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013276#M4419</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2022-12-06T15:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Parse json at Qlik Replicate level</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013320#M4420</link>
      <description>&lt;P&gt;I largely agree with&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/115309"&gt;@john_wang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your designers/developers chose MongoDb? Well, It's tempting to say - "You've made your bed, now lie in it ".&lt;/P&gt;
&lt;P&gt;I'm not a fan. Another saying that comes to mind is 'pay me now, or pay me later'. - You will pay at some point.&lt;/P&gt;
&lt;P&gt;Still, that doesn't help you here and now. As John indicates the only option that Replicate would appear to offer is 'UDF' - User Defined Functions. However those do not deal with CLOB arguments and even if they did, then&amp;nbsp; the user-written json parser behind the udf would have to be called over and over, once for every column trying to be exposed.&lt;/P&gt;
&lt;P&gt;I suspect the solution is best designed to run on the target DB having Replicate dump the inserts/changes in a staging table with trigger or periodic sweeper procedure.&lt;/P&gt;
&lt;P&gt;If one were to insist on using Replicate to somehow deliver JSON (or XML) document based source cleanly to a columns based traditional SQL RDB then I might try to explore a solution with FILE based target/source.&lt;/P&gt;
&lt;P&gt;Can you get the MongoDB changes delivered in a flat file? Could you create a first stage Replicate task to grab the MongoDB input and dump into a flat file? With Flat file as source you can request/define "File preprocessing command" (RTFM -&amp;nbsp;8.6 Using a file as a source)&lt;/P&gt;
&lt;P&gt;Such user provided script (any language/script/tool vs C coded needed for UDF), could parse each row into distinct columns in a well defined CSV arrangement. That output could in turn become input for a Flat File to DB task. I'm just dreaming this up. I'm not sure how practical it all might be.&lt;/P&gt;
&lt;P&gt;fwiw,&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 17:38:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013320#M4420</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2022-12-06T17:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Parse json at Qlik Replicate level</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013368#M4421</link>
      <description>&lt;P&gt;Thanks John_wang and Heinvandenheuvel for your thoughts on this not trivial qustion. Indeead we can not use User-defined transformations because LOB does not support transformations in QR.&lt;BR /&gt;But we will review aproach suggested by Heinvandenheuvel (use FILE) with followed processing .&lt;/P&gt;
&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 19:38:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013368#M4421</guid>
      <dc:creator>sergsyb</dc:creator>
      <dc:date>2022-12-06T19:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Parse json at Qlik Replicate level</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013380#M4422</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I agree with Hein and John and this would be a performance hit for the task&lt;/P&gt;
&lt;P&gt;You can in fact do various transformations on a LOB field if you do a source lookup for the field value it would come back as a string.&lt;/P&gt;
&lt;P&gt;Please check this article out:&amp;nbsp;Transformation: Source Lookup - Oracle ROWID 5/4&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Knowledge/Transformation-Source-Lookup-Oracle-ROWID/ta-p/1805170" target="_blank"&gt;https://community.qlik.com/t5/Knowledge/Transformation-Source-Lookup-Oracle-ROWID/ta-p/1805170&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You would need to disregard the original LOB field and create a new field in the target and then for it's value,&amp;nbsp; use the source lookup and then you can do string functions to parse the results.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Michael Litz&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 20:00:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Parse-json-at-Qlik-Replicate-level/m-p/2013380#M4422</guid>
      <dc:creator>Michael_Litz</dc:creator>
      <dc:date>2022-12-06T20:00:56Z</dc:date>
    </item>
  </channel>
</rss>

