title: Snowflake 'GET': (VARCHAR(16777216), VARCHAR(12))
body: <p>I have loaded a JSON file on to a Snowflake stage. <br>
  Now my goal is to COPY the contents of the file into a relational table.</p>
  <p>Table is defined as have either varchar or Boolean columns.</p>
  <pre><code>{
    &quot;requestRefid&quot;: &quot;W2W8P&quot;,
    &quot;requestid&quot;: &quot;kki8786f1b-03eb&quot;,
    &quot;requestTypes&quot;: [
      &quot;Do not sell it&quot;
    ],
    &quot;subjectTypes&quot;: [
      &quot;Current customer&quot;
    ],
    &quot;firstName&quot;: &quot;Dan&quot;,
    &quot;lastName&quot;: &quot;Murrary&quot;,
    &quot;email&quot;: &quot;k99008a85ki@gmail.com&quot;,
    &quot;phone&quot;: &quot;410000869&quot;,
    &quot;emailValidation&quot;: true,
    &quot;phoneValidation&quot;: true,
    &quot;message&quot;: &quot;Confirm&quot;,
  }
  </code></pre>
  <p>Here is the COPY statement that I am using:</p>
  <pre><code>copy into TEST.&quot;PUBLIC&quot;.REQUESTS(REQUESTREFID, REQUESTID, FIRSTNAME, LASTNAME, EMAIL, PHONE, EMAILVALIDATION, PHONEVALIDATION, IDVALIDATION, MESSAGE, CHANNEL)
     from (select $1:requestRefid, $1:requestid, $1:firstName, $1:lastName, $1:email, $1:phone, $1:emailValidation, $1:phoneValidation, $1:idValidation, $1:message, $1:channel
     from @sf_tut_stage/sample.json t);
  </code></pre>
  <p>Here is the error that I get:</p>
  <blockquote>
  <p>SQL Error [1044] [42P13]:</p>
  <p>SQL compilation error: error line 2 at position 18</p>
  <p>Invalid argument types for function 'GET': (VARCHAR(16777216),
  VARCHAR(12))</p>
  <p>SQL compilation error: error line 2 at position 18</p>
  <p>Invalid argument types for function 'GET': (VARCHAR(16777216),
  VARCHAR(12))</p>
  <p>SQL compilation error: error line 2 at position 18</p>
  <p>Invalid argument types for function 'GET': (VARCHAR(16777216),
  VARCHAR(12))</p>
  </blockquote>
  <p>I am able to query the contents of the JSON file in the stage using following query:</p>
  <pre><code>select $1
     from @sf_tut_stage/sample.json;  
  </code></pre>
  <p>What am I doing wrong?</p>
  <p>I also tried add following to the copy statement:</p>
  <pre><code>file_format = (format_name = SF_TUT_CSV_FORMAT));
  </code></pre>
  <p>but no luck.</p>
  <p>What is the right way to write this statement so it can load items within <code>$1</code> to individual relational table columns.</p>