<?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 Exception handling with JSON column names in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256479#M38846</link>
    <description>I'm working on exception handling with our JSON data. Specifically we are able to capture and reject malformed data using the rejection connectors within Talend, but it does not take into account things such as: 
&lt;BR /&gt; 
&lt;BR /&gt;removing a schema column name from JSON (ex. remove "username" from JSON) 
&lt;BR /&gt;renaming a schema column name (ex. rename stepName to strepName in JSON) 
&lt;BR /&gt;What is the "proper" method to take a JSON structure, evaluate the column header information and compare it with an expected known good value. Those that don't match get kicked out as exceptions. It doesn't appear that the tSchemaComplianceCheck component will validate column names. A general JSON validator will only validate the JSON structure but not any of the naming of columns. Any other thoughts on this? 
&lt;BR /&gt; 
&lt;B&gt;Examples of data:&lt;/B&gt; 
&lt;BR /&gt;Expected column names 
&lt;BR /&gt; 
&lt;PRE&gt;{&lt;BR /&gt;	"solution": "ladkfj",&lt;BR /&gt;	"stepName": "1234",&lt;BR /&gt;	"stepOrder": 1,&lt;BR /&gt;	"origin": "abc",&lt;BR /&gt;	"actionTimestamp": "2016-02-08T13:53:20.954-06:00",&lt;BR /&gt;	"batch": ,&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;Exceptions of column names 
&lt;BR /&gt; 
&lt;PRE&gt;{&lt;BR /&gt;	"solutionJJ": "ladkfj",&lt;BR /&gt;	"stR2epName": "1234",&lt;BR /&gt;	"stepOrder@": 1,&lt;BR /&gt;	"": "abc",&lt;BR /&gt;	"actionTimestamp": "2016-02-08T13:53:20.954-06:00",&lt;BR /&gt;	"batch": ,&lt;BR /&gt;}&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Feb 2016 16:40:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-10T16:40:52Z</dc:date>
    <item>
      <title>Exception handling with JSON column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256479#M38846</link>
      <description>I'm working on exception handling with our JSON data. Specifically we are able to capture and reject malformed data using the rejection connectors within Talend, but it does not take into account things such as: 
&lt;BR /&gt; 
&lt;BR /&gt;removing a schema column name from JSON (ex. remove "username" from JSON) 
&lt;BR /&gt;renaming a schema column name (ex. rename stepName to strepName in JSON) 
&lt;BR /&gt;What is the "proper" method to take a JSON structure, evaluate the column header information and compare it with an expected known good value. Those that don't match get kicked out as exceptions. It doesn't appear that the tSchemaComplianceCheck component will validate column names. A general JSON validator will only validate the JSON structure but not any of the naming of columns. Any other thoughts on this? 
&lt;BR /&gt; 
&lt;B&gt;Examples of data:&lt;/B&gt; 
&lt;BR /&gt;Expected column names 
&lt;BR /&gt; 
&lt;PRE&gt;{&lt;BR /&gt;	"solution": "ladkfj",&lt;BR /&gt;	"stepName": "1234",&lt;BR /&gt;	"stepOrder": 1,&lt;BR /&gt;	"origin": "abc",&lt;BR /&gt;	"actionTimestamp": "2016-02-08T13:53:20.954-06:00",&lt;BR /&gt;	"batch": ,&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;Exceptions of column names 
&lt;BR /&gt; 
&lt;PRE&gt;{&lt;BR /&gt;	"solutionJJ": "ladkfj",&lt;BR /&gt;	"stR2epName": "1234",&lt;BR /&gt;	"stepOrder@": 1,&lt;BR /&gt;	"": "abc",&lt;BR /&gt;	"actionTimestamp": "2016-02-08T13:53:20.954-06:00",&lt;BR /&gt;	"batch": ,&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Feb 2016 16:40:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256479#M38846</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-10T16:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exception handling with JSON column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256480#M38847</link>
      <description>Hi,
&lt;BR /&gt;I think ,You want to rename your JSON structure. Yes, It is possible.
&lt;BR /&gt;First, you extract JSON using tExtractJsonField component
&lt;BR /&gt;Then, In tExtractJsonField component,&amp;nbsp;
&lt;BR /&gt;Column &amp;nbsp;XpathQuery
&lt;BR /&gt;solution &amp;nbsp;"solutionJJ"
&lt;BR /&gt;stepName "
&lt;FONT size="2"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;stR2epName&lt;/FONT&gt;&lt;/FONT&gt;"
&lt;BR /&gt;......
&lt;BR /&gt;So on.
&lt;BR /&gt;Note that I roughly extract JSON for your hint. Extract JSON as per your need.
&lt;BR /&gt;and
&lt;BR /&gt;Second, pass it to tMap with proper schema and then ,pass it to tWriteJsonField in order to get expected JSON output.
&lt;BR /&gt;I hope, it will help you.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Amol</description>
      <pubDate>Thu, 11 Feb 2016 03:59:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256480#M38847</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-11T03:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Exception handling with JSON column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256481#M38848</link>
      <description>Thanks for the reply, Amol. In actuality, I'm looking to flag those entries where rows exist which contain columns such as "solutionJJ" or "stR2epName" since we are expecting "solution" and "stepName". Hopefully the screenshot below of the tExtractJsonField component will explain what we're going for. 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/293953/JSONextract.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDFQ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154306i91D7D0EF6132951C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDFQ.jpg" alt="0683p000009MDFQ.jpg" /&gt;&lt;/span&gt; &amp;nbsp;&lt;/A&gt;</description>
      <pubDate>Thu, 11 Feb 2016 15:37:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256481#M38848</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-11T15:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Exception handling with JSON column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256482#M38849</link>
      <description>Hi bbrooksux, 
&lt;BR /&gt;First of all, I liked to know that wheather mentioned json is well formed or not.&amp;nbsp; 
&lt;BR /&gt;Input json is : 
&lt;BR /&gt;{"solutionJJ": "ladkfj", "stR2epName": "1234", "stepOrder@": 1, "": "abc","actionTimestamp": "2016-02-08T13:53:20.954-06:00", "batch": } 
&lt;BR /&gt;Note that I slightly changed your json by removing comma (,) after "]" &amp;nbsp;bracket in order to have perfect json. 
&lt;BR /&gt;When I tried to extract json, I uesd to get below error: 
&lt;BR /&gt; 
&lt;FONT color="#ff3333"&gt;Error on line 1 of document &amp;nbsp;: The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.&amp;nbsp;&lt;/FONT&gt; 
&lt;BR /&gt;Interesting thing is that when I made change in json input ,error has gone. 
&lt;BR /&gt;Change in input Json: 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Courier"&gt;{"solutionJJ": "ladkfj",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "stR2epName": "1234",&amp;nbsp;&amp;nbsp; "stepOrder": 1,&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;"actionTimestamp": "2016-02-08T13:53:20.954-06:00",&amp;nbsp;&amp;nbsp; "batch": }&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Courier"&gt;First change : I have removed "@" character from stepOrder&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;Second change: removed &amp;nbsp; 
&lt;FONT size="2"&gt;&lt;FONT face="Courier"&gt;"": "abc"&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;node &amp;nbsp; from json 
&lt;BR /&gt;Then error disappeared. 
&lt;BR /&gt;So, Question is "Is your json is well formed" and can you modify your json input as below in order to fulfill your requirement : 
&lt;BR /&gt;{"solutionJJ": "ladkfj", "stR2epName": "1234", "stepOrder": 1, "actionTimestamp": "2016-02-08T13:53:20.954-06:00", "batch": } 
&lt;BR /&gt;Let me know if it is possible. 
&lt;BR /&gt;so we can find solution for it 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Amol</description>
      <pubDate>Fri, 12 Feb 2016 07:29:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256482#M38849</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-12T07:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Exception handling with JSON column names</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256483#M38850</link>
      <description>Hi Amol, 
&lt;BR /&gt;Sorry about the initial bad JSON in the original post. I've been working on some other malformed JSON testing and I guess I grabbed the wrong line!&amp;nbsp; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;&amp;nbsp;That said, we are able to capture malformed JSON (such as this) with the simple rejection path within Talend (see screenshot). 
&lt;BR /&gt;What this rejection path doesn't capture is the scenario where the naming structure changes (expecting "solution" for column name and get "solutionJJ"). The formatting of the JSON is correct, but the extraction breaks down because it does not see the proper column name. Does this help?&amp;nbsp; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/membersTempo/293953/rejection.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCvf.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140791i3F502ABDC99B1383/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCvf.jpg" alt="0683p000009MCvf.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/A&gt;</description>
      <pubDate>Fri, 12 Feb 2016 15:10:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Exception-handling-with-JSON-column-names/m-p/2256483#M38850</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-12T15:10:48Z</dc:date>
    </item>
  </channel>
</rss>

