<?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 Re: Generate Separate UUID for JSON array of objects in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Generate-Separate-UUID-for-JSON-array-of-objects/m-p/298770#M219359</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/72164"&gt;@Biswa&lt;/a&gt;!&lt;BR /&gt;I tried various ways of getting a unique id for each array. Most of them failed. But, I tried to append the array index to the unique id. Even while doing it, I faced many issues. See if the below spec is okay&lt;/P&gt;&lt;PRE&gt;[&lt;BR /&gt; {&lt;BR /&gt;  "operation": "shift",&lt;BR /&gt;  "spec": {&lt;BR /&gt;   "aliases": {&lt;BR /&gt;    "*": {&lt;BR /&gt;     "@0": "alias[&amp;amp;1].name",&lt;BR /&gt;     "$0": "alias[&amp;amp;1].id.${UUID()}-&amp;amp;1"&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;  }&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt;  "operation": "shift",&lt;BR /&gt;  "spec": {&lt;BR /&gt;   "alias": {&lt;BR /&gt;    "*": {&lt;BR /&gt;     "id": {&lt;BR /&gt;      "*": {&lt;BR /&gt;       "$0": "alias[&amp;amp;3].id"&lt;BR /&gt;      }&lt;BR /&gt;     },&lt;BR /&gt;     "*": "alias[&amp;amp;1].&amp;amp;"&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt;]&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jun 2020 15:34:40 GMT</pubDate>
    <dc:creator>PVVK</dc:creator>
    <dc:date>2020-06-28T15:34:40Z</dc:date>
    <item>
      <title>Generate Separate UUID for JSON array of objects</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Generate-Separate-UUID-for-JSON-array-of-objects/m-p/291843#M215751</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to generate separate UUID for JSON array of objects. I tried to use ${UUID()} in JOLT specification, but this is generating same UUID for all the elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;P&gt;Input:&lt;/P&gt;
&lt;P&gt;===============&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; "aliases": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Alias1",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; " Alias2"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;]&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JOLT Specification&lt;/P&gt;
&lt;P&gt;=====================&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;[&lt;BR /&gt;{&lt;BR /&gt;"operation": "shift",&lt;BR /&gt;"spec": {&lt;BR /&gt;"aliases": {&lt;BR /&gt;"*": "alias[&amp;amp;0].name"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"operation": "modify-default-beta",&lt;BR /&gt;"spec": {&lt;BR /&gt;"alias": {&lt;BR /&gt;"*": {&lt;BR /&gt;"id": "${UUID()}"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;Current Output:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;=====================&lt;/P&gt;
&lt;P&gt;"alias" : [ {&lt;BR /&gt;"name" : "Alias1",&lt;BR /&gt;"id" : "&lt;STRONG&gt;2948446b-6213-44ba-b81f-c4e5f7dab2eb&lt;/STRONG&gt;"&lt;BR /&gt;}, {&lt;BR /&gt;"name" : " Alias2",&lt;BR /&gt;"id" : "&lt;STRONG&gt;2948446b-6213-44ba-b81f-c4e5f7dab2eb&lt;/STRONG&gt;"&lt;BR /&gt;} ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any pointers will be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Biswa&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 14:22:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Generate-Separate-UUID-for-JSON-array-of-objects/m-p/291843#M215751</guid>
      <dc:creator>Biswa</dc:creator>
      <dc:date>2020-03-16T14:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Separate UUID for JSON array of objects</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Generate-Separate-UUID-for-JSON-array-of-objects/m-p/298770#M219359</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/72164"&gt;@Biswa&lt;/a&gt;!&lt;BR /&gt;I tried various ways of getting a unique id for each array. Most of them failed. But, I tried to append the array index to the unique id. Even while doing it, I faced many issues. See if the below spec is okay&lt;/P&gt;&lt;PRE&gt;[&lt;BR /&gt; {&lt;BR /&gt;  "operation": "shift",&lt;BR /&gt;  "spec": {&lt;BR /&gt;   "aliases": {&lt;BR /&gt;    "*": {&lt;BR /&gt;     "@0": "alias[&amp;amp;1].name",&lt;BR /&gt;     "$0": "alias[&amp;amp;1].id.${UUID()}-&amp;amp;1"&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;  }&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt;  "operation": "shift",&lt;BR /&gt;  "spec": {&lt;BR /&gt;   "alias": {&lt;BR /&gt;    "*": {&lt;BR /&gt;     "id": {&lt;BR /&gt;      "*": {&lt;BR /&gt;       "$0": "alias[&amp;amp;3].id"&lt;BR /&gt;      }&lt;BR /&gt;     },&lt;BR /&gt;     "*": "alias[&amp;amp;1].&amp;amp;"&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt;]&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jun 2020 15:34:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Generate-Separate-UUID-for-JSON-array-of-objects/m-p/298770#M219359</guid>
      <dc:creator>PVVK</dc:creator>
      <dc:date>2020-06-28T15:34:40Z</dc:date>
    </item>
  </channel>
</rss>

