<?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>question Jolt Specification to complex structure in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Jolt-Specification-to-complex-structure/m-p/296557#M218287</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've got an INPUT-json that looks like this:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;{&lt;BR /&gt;"vendor" : "myINC",&lt;BR /&gt;"beginTime" : "2020-01-21T10:00:00+08:00",&lt;BR /&gt;"userLabel" : "DB",&lt;BR /&gt;"Types" : [ {&lt;BR /&gt;"Name" : "type001",&lt;BR /&gt;"subTypes" : [ {&lt;BR /&gt;"subtype003" : {&lt;BR /&gt;"counter1" : "0",&lt;BR /&gt;"counter5" : "0",&lt;BR /&gt;"counter54" : "0"&lt;BR /&gt;}&lt;BR /&gt;},{&lt;BR /&gt;"subtype001": {&lt;BR /&gt;"counter002": "0",&lt;BR /&gt;"counter5": "0",&lt;BR /&gt;"counter65": "0"&lt;BR /&gt;}&lt;BR /&gt;} ]&lt;BR /&gt;}, {&lt;BR /&gt;"Name" : "type002",&lt;BR /&gt;"subTypes" : [ {&lt;BR /&gt;"subtype006" : {&lt;BR /&gt;"counter1" : "0",&lt;BR /&gt;"counter5" : "0",&lt;BR /&gt;"counter54" : "0"&lt;BR /&gt;}},{&lt;BR /&gt;"subtype009" : {&lt;BR /&gt;"counter002": "0",&lt;BR /&gt;"counter5": "0",&lt;BR /&gt;"counter65": "0"&lt;BR /&gt;}&lt;BR /&gt;}]&lt;BR /&gt;} ]&lt;BR /&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and would need a OUTPUT-json like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;{&lt;BR /&gt;"vendor" : "myINC",&lt;BR /&gt;"beginTime" : "2020-01-21T10:00:00+08:00",&lt;BR /&gt;"userLabel" : "DG",&lt;BR /&gt;"Types" : [ {&lt;BR /&gt;"Name" : "type001",&lt;BR /&gt;"subType" : [ {&lt;BR /&gt;"Name": "subtype003",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter1",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter54",&lt;BR /&gt;"value": "0"&lt;BR /&gt;} ]&lt;BR /&gt;},{&lt;BR /&gt;"Name": "subtype001",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter002",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter65",&lt;BR /&gt;"value": "0"&lt;BR /&gt;}]&lt;BR /&gt;} ]&lt;BR /&gt;}, {&lt;BR /&gt;"Name" : "type002",&lt;BR /&gt;"subType" : [ {&lt;BR /&gt;"Name": "subtype006",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter1",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter54",&lt;BR /&gt;"value": "0"&lt;BR /&gt;} ]&lt;BR /&gt;},{&lt;BR /&gt;"Name": "subtype009",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter002",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter65",&lt;BR /&gt;"value": "0"&lt;BR /&gt;}]&lt;BR /&gt;} ]&lt;BR /&gt;} ]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couldn't make any real breakthrough if not getting till here, some help really appreciated.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 May 2020 15:35:34 GMT</pubDate>
    <dc:creator>dg</dc:creator>
    <dc:date>2020-05-25T15:35:34Z</dc:date>
    <item>
      <title>Jolt Specification to complex structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Jolt-Specification-to-complex-structure/m-p/296557#M218287</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've got an INPUT-json that looks like this:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;{&lt;BR /&gt;"vendor" : "myINC",&lt;BR /&gt;"beginTime" : "2020-01-21T10:00:00+08:00",&lt;BR /&gt;"userLabel" : "DB",&lt;BR /&gt;"Types" : [ {&lt;BR /&gt;"Name" : "type001",&lt;BR /&gt;"subTypes" : [ {&lt;BR /&gt;"subtype003" : {&lt;BR /&gt;"counter1" : "0",&lt;BR /&gt;"counter5" : "0",&lt;BR /&gt;"counter54" : "0"&lt;BR /&gt;}&lt;BR /&gt;},{&lt;BR /&gt;"subtype001": {&lt;BR /&gt;"counter002": "0",&lt;BR /&gt;"counter5": "0",&lt;BR /&gt;"counter65": "0"&lt;BR /&gt;}&lt;BR /&gt;} ]&lt;BR /&gt;}, {&lt;BR /&gt;"Name" : "type002",&lt;BR /&gt;"subTypes" : [ {&lt;BR /&gt;"subtype006" : {&lt;BR /&gt;"counter1" : "0",&lt;BR /&gt;"counter5" : "0",&lt;BR /&gt;"counter54" : "0"&lt;BR /&gt;}},{&lt;BR /&gt;"subtype009" : {&lt;BR /&gt;"counter002": "0",&lt;BR /&gt;"counter5": "0",&lt;BR /&gt;"counter65": "0"&lt;BR /&gt;}&lt;BR /&gt;}]&lt;BR /&gt;} ]&lt;BR /&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and would need a OUTPUT-json like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;{&lt;BR /&gt;"vendor" : "myINC",&lt;BR /&gt;"beginTime" : "2020-01-21T10:00:00+08:00",&lt;BR /&gt;"userLabel" : "DG",&lt;BR /&gt;"Types" : [ {&lt;BR /&gt;"Name" : "type001",&lt;BR /&gt;"subType" : [ {&lt;BR /&gt;"Name": "subtype003",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter1",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter54",&lt;BR /&gt;"value": "0"&lt;BR /&gt;} ]&lt;BR /&gt;},{&lt;BR /&gt;"Name": "subtype001",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter002",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter65",&lt;BR /&gt;"value": "0"&lt;BR /&gt;}]&lt;BR /&gt;} ]&lt;BR /&gt;}, {&lt;BR /&gt;"Name" : "type002",&lt;BR /&gt;"subType" : [ {&lt;BR /&gt;"Name": "subtype006",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter1",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter54",&lt;BR /&gt;"value": "0"&lt;BR /&gt;} ]&lt;BR /&gt;},{&lt;BR /&gt;"Name": "subtype009",&lt;BR /&gt;"Counters": [&lt;BR /&gt;{&lt;BR /&gt;"name": "counter002",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter5",&lt;BR /&gt;"value": "0"&lt;BR /&gt;},{&lt;BR /&gt;"name": "counter65",&lt;BR /&gt;"value": "0"&lt;BR /&gt;}]&lt;BR /&gt;} ]&lt;BR /&gt;} ]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couldn't make any real breakthrough if not getting till here, some help really appreciated.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 15:35:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Jolt-Specification-to-complex-structure/m-p/296557#M218287</guid>
      <dc:creator>dg</dc:creator>
      <dc:date>2020-05-25T15:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Jolt Specification to complex structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Jolt-Specification-to-complex-structure/m-p/298022#M218945</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/70093"&gt;@dg&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Your desired output contains DG as value for userLabel. I am not sure if it is a typo, so, I tried converting it as well. If not needed, you can remove the modify-overwrite-beta part.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;[&lt;BR /&gt;  {&lt;BR /&gt;    "operation": "modify-overwrite-beta",&lt;BR /&gt;    "spec": {&lt;BR /&gt;      "userLabel": "DG"&lt;BR /&gt;    }&lt;BR /&gt;  },&lt;BR /&gt;  {&lt;BR /&gt;    "operation": "shift",&lt;BR /&gt;    "spec": {&lt;BR /&gt;      "Types": {&lt;BR /&gt;        "*": {&lt;BR /&gt;          "subTypes": {&lt;BR /&gt;            "*": {&lt;BR /&gt;              "*": {&lt;BR /&gt;                "$0": "Types[&amp;amp;4].subType[&amp;amp;2].Name",&lt;BR /&gt;                "*": {&lt;BR /&gt;                  "$": "Types[&amp;amp;5].subType[&amp;amp;3].CounterNames[]",&lt;BR /&gt;                  "@": "Types[&amp;amp;5].subType[&amp;amp;3].CounterValues[]"&lt;BR /&gt;                }&lt;BR /&gt;              }&lt;BR /&gt;            }&lt;BR /&gt;          },&lt;BR /&gt;          "*": "Types[&amp;amp;1].&amp;amp;"&lt;BR /&gt;        }&lt;BR /&gt;      },&lt;BR /&gt;      "*": "&amp;amp;"&lt;BR /&gt;    }&lt;BR /&gt;  },&lt;BR /&gt;  {&lt;BR /&gt;    "operation": "shift",&lt;BR /&gt;    "spec": {&lt;BR /&gt;      "Types": {&lt;BR /&gt;        "*": {&lt;BR /&gt;          "subType": {&lt;BR /&gt;            "*": {&lt;BR /&gt;              "CounterNames": {&lt;BR /&gt;                "*": "Types[&amp;amp;4].subType[&amp;amp;2].Counters[&amp;amp;].name"&lt;BR /&gt;              },&lt;BR /&gt;              "CounterValues": {&lt;BR /&gt;                "*": "Types[&amp;amp;4].subType[&amp;amp;2].Counters[&amp;amp;].value"&lt;BR /&gt;              },&lt;BR /&gt;              "*": "Types[&amp;amp;3].subType[&amp;amp;1].&amp;amp;"&lt;BR /&gt;            }&lt;BR /&gt;          },&lt;BR /&gt;          "*": "Types[&amp;amp;1].&amp;amp;"&lt;BR /&gt;        }&lt;BR /&gt;      },&lt;BR /&gt;      "*": "&amp;amp;"&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;]&lt;/PRE&gt;&lt;P&gt;Here, the second spec(first shift) gives the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "vendor" : "myINC",
  "beginTime" : "2020-01-21T10:00:00+08:00",
  "userLabel" : "DG",
  "Types" : [ {
    "Name" : "type001",
    "subType" : [ {
      "Name" : "subtype003",
      "CounterNames" : [ "counter1", "counter5", "counter54" ],
      "CounterValues" : [ "0", "0", "0" ]
    }, {
      "Name" : "subtype001",
      "CounterNames" : [ "counter002", "counter5", "counter65" ],
      "CounterValues" : [ "0", "0", "0" ]
    } ]
  }, {
    "Name" : "type002",
    "subType" : [ {
      "Name" : "subtype006",
      "CounterNames" : [ "counter1", "counter5", "counter54" ],
      "CounterValues" : [ "0", "0", "0" ]
    }, {
      "Name" : "subtype009",
      "CounterNames" : [ "counter002", "counter5", "counter65" ],
      "CounterValues" : [ "0", "0", "0" ]
    } ]
  } ]
}&lt;/LI-CODE&gt;&lt;P&gt;The last spec gives you the desired output&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 13:23:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Jolt-Specification-to-complex-structure/m-p/298022#M218945</guid>
      <dc:creator>PVVK</dc:creator>
      <dc:date>2020-06-14T13:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Jolt Specification to complex structure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Jolt-Specification-to-complex-structure/m-p/298046#M218960</link>
      <description>&lt;P&gt;Hi Pvvk,&lt;/P&gt;&lt;P&gt;I really want to thank You!&lt;/P&gt;&lt;P&gt;Your Jolt is great.&lt;/P&gt;&lt;P&gt;I really need to work on my jolt skills and this helps me, have to exercise my reading of specs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Davide&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 07:00:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Jolt-Specification-to-complex-structure/m-p/298046#M218960</guid>
      <dc:creator>dg</dc:creator>
      <dc:date>2020-06-15T07:00:21Z</dc:date>
    </item>
  </channel>
</rss>

