<?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: JOLT to concat values of the repetitive keys in the same key in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307673#M223302</link>
    <description>&lt;P&gt;I got the result using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "main": "main.[&amp;amp;1]"
      }
    }
  },
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "main": "=join('\n',@(1,main))"
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;Not sure whether is the best approach. But it works. Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 16:12:23 GMT</pubDate>
    <dc:creator>opalo54</dc:creator>
    <dc:date>2020-12-14T16:12:23Z</dc:date>
    <item>
      <title>JOLT to concat values of the repetitive keys in the same key</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307668#M223297</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to concat all the values of a repetitive key and put all of them as the value of one unique key with the same name.&lt;/P&gt;&lt;P&gt;The input would be like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "main": "id;Date;Time;Trigger_time_open;Trigger_time_close;Door;Door_Cycle;Motor_current;Motor_voltage;DLS;DCS;Inclinometer;Temperature"
  },
  {
    "main": "00000;2020/7/18;04:53:37.211;04:53:37.524;04:53:51.847;01;36688;12.062867;0.000000;-1;-1;12.078014;26.303200"
  },
  {
    "main": "00001;;04:53:37.212;;;;;12.064088;0.000000;-1;-1;;"
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An the output something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
"main":"id;Date;Time;Trigger_time_open;Trigger_time_close;Door;Door_Cycle;Motor_current;Motor_voltage;DLS;DCS;Inclinometer;Temperature00000;2020/7/18;04:53:37.211;04:53:37.524;04:53:51.847;01;36688;12.062867;0.000000;-1;-1;12.078014;26.30320000001;;04:53:37.212;;;;;12.064088;0.000000;-1;-1;;"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying with join and concat, but I'm completely new to Jolt transformations, and it's been a pain to find the way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the result would be a big string containing all the records of a csv.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 14:57:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307668#M223297</guid>
      <dc:creator>opalo54</dc:creator>
      <dc:date>2020-12-14T14:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: JOLT to concat values of the repetitive keys in the same key</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307670#M223299</link>
      <description>&lt;P&gt;with this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "main": "main"
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to get this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "main" : [ "id;Date;Time;Trigger_time_open;Trigger_time_close;Door;Door_Cycle;Motor_current;Motor_voltage;DLS;DCS;Inclinometer;Temperature", "00000;2020/7/18;04:53:37.211;04:53:37.524;04:53:51.847;01;36688;12.062867;0.000000;-1;-1;12.078014;26.303200", "00001;;04:53:37.212;;;;;12.064088;0.000000;-1;-1;;" ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But what I need is a main element with all the values concatenated with a \n among them&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 15:21:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307670#M223299</guid>
      <dc:creator>opalo54</dc:creator>
      <dc:date>2020-12-14T15:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: JOLT to concat values of the repetitive keys in the same key</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307673#M223302</link>
      <description>&lt;P&gt;I got the result using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "main": "main.[&amp;amp;1]"
      }
    }
  },
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "main": "=join('\n',@(1,main))"
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;Not sure whether is the best approach. But it works. Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:12:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307673#M223302</guid>
      <dc:creator>opalo54</dc:creator>
      <dc:date>2020-12-14T16:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: JOLT to concat values of the repetitive keys in the same key</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307674#M223303</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/34412"&gt;@opalo54&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for posting your solution!&lt;BR /&gt;I was just trying too but I think your input data has to be set to an array for this. Am I getting right?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:21:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307674#M223303</guid>
      <dc:creator>justenji</dc:creator>
      <dc:date>2020-12-14T16:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: JOLT to concat values of the repetitive keys in the same key</title>
      <link>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307695#M223319</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/67599"&gt;@justenji&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, exactly. All "main" elements are part of an array in the input.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 08:44:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/JOLT-to-concat-values-of-the-repetitive-keys-in-the-same-key/m-p/307695#M223319</guid>
      <dc:creator>opalo54</dc:creator>
      <dc:date>2020-12-15T08:44:51Z</dc:date>
    </item>
  </channel>
</rss>

