title: How to insert into a snowflake variant field using a DAO?
body: <p>I have the following code:</p>
  
  <pre><code>@RegisterMapper(MyEntity.ResultMapper.class)
  @UseStringTemplate3StatementLocator
  public interface MyDao {
  
      @Transaction(TransactionIsolationLevel.SERIALIZABLE)
      @SqlBatch("INSERT INTO mySchema.myTable (" +
          " id, entity_type, entity_id, flags " +
          " ) VALUES " +
          "(" +
          " :stepId , :entityType , :entityId,parse_json(:flags) " +
          ")")
      @BatchChunkSize(500)
      Object create( @BindBean List&lt;MyEntity&gt; entities );
  }
  </code></pre>
  
  <p>As you can see, I am bulk inserting a list of entities into my Snowflake table using this DAO.</p>
  
  <p>The issue is that I am unable to insert into the flags columns, which is a variant. I have tried <code>to_variant(:flags)</code> and currently <code>parse_json(:flags)</code>, but the JDBI keeps throwing the following error:</p>
  
  <pre><code>net.snowflake.client.jdbc.SnowflakeSQLException: SQL 
  compilation error:
  Invalid expression [PARSE_JSON(?)] in VALUES clause 
  [statement:"INSERT INTO mySchema.myTable ( id, entity_type, 
  entity_id, flags  ) VALUES ( :stepId , :entityType , :entityId,
  parse_json(:flags) )", located:"null", rewritten:"null",
  arguments:{ positional:{}, named:{timeStamp:'null', 
  entityType:MYENTITY,
  flags:'{"client":"myClient","flow":"myFlow"}',stepId:null, 
  entityId:'189643357241513', class:class myOrg.MyEntity}, finder:[]}]
  </code></pre>
  
  <p>How should I pass the value in the flags column ? Has anyone attempted this before? The <code>flags</code> field in MyEntity is in my control, I can keep it as a POJO or a String, whichever helps me resolve this issue.</p>