title: Jolt reference first element in array as target name
body: <p>I have been looking at this for a few weeks (in the background) and am stumped on how to convert JSON data approximating a CSV into a tagged set using the NiFi JoltTransformJson processor. What I mean by this is to use the data from the first row of an array in the input as the JSON object name in the output.</p>
  
  <p>As an example I have this input data:</p>
  
  <pre><code>[
    [
      "Company",
      "Retail Cost",
      "Percentage"
    ],
    [
      "ABC",
      "5,368.11",
      "17.09%"
    ],
    [
      "DEF",
      "101.47",
      "0.32%"
    ],
    [
      "GHI",
      "83.79",
      "0.27%"
    ]
  ]
  </code></pre>
  
  <p>and what I am trying to get as output is: </p>
  
  <pre><code>[
    {
      "Company": "ABC",
      "Retail Cost": "5,368.11",
      "Percentage": "17.09%"
    },
    {
      "Company": "DEF",
      "Retail Cost": "101.47",
      "Percentage": "0.32%"
    },
    {
      "Company": "GHI",
      "Retail Cost": "83.79",
      "Percentage": "0.27%"
    }
  ]
  </code></pre>
  
  <p>I see this as primarily 2 problems: getting access to the content of the first array and then making sure that the output data does not include that first array.</p>
  
  <p>I would love to post a Jolt Specification showing myself getting somewhat close, but the closest gives me the correct shape of output without the correct content. It looks like this:</p>
  
  <pre><code>[
    {
      "operation": "shift",
      "spec": {
        "*": {
          "*": "[&amp;1].&amp;0"
        }
      }
    }
  ]
  </code></pre>
  
  <p>But it results in an output like this:</p>
  
  <pre><code>[ {
    "0" : "Company",
    "1" : "Retail Cost",
    "2" : "Percentage"
  }, {
    "0" : "ABC",
    "1" : "5,368.11",
    "2" : "17.09%"
  }, {
    "0" : "DEF",
    "1" : "101.47",
    "2" : "0.32%"
  }, {
    "0" : "GHI",
    "1" : "83.79",
    "2" : "0.27%"
  } ]
  </code></pre>
  
  <p>Which clearly has the wrong object name and it has 1 too many elements in the output.</p>