Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
The expected behaviour would be for the batch update to execute successfully for batches with more that 1 batch.
{
"sqlText" : "MERGE INTO \"QE_TEST_DEV\".\"PRODUCT_JOURNEY_REQUEST\" AS \"target\"\nUSING (SELECT ? AS \"REQUEST_ID\", ? AS \"MARKETO_LEAD_ID\", ? AS \"EVENT\", ? AS \"STATUS\", ? AS \"PRODUCT_JOURNEY_EVENT\", ? AS \"PRODUCT_JOURNEY_PROCESSED_ON\", ? AS \"REQUEST_PAYLOAD\"\nFROM (VALUES (0)) AS \"t\" (\"ZERO\")) AS \"upsert\" (\"REQUEST_ID\", \"MARKETO_LEAD_ID\", \"EVENT\", \"STATUS\", \"PRODUCT_JOURNEY_EVENT\", \"PRODUCT_JOURNEY_PROCESSED_ON\", \"REQUEST_PAYLOAD\")\nON (\"target\".\"REQUEST_ID\" = \"upsert\".\"REQUEST_ID\")\nWHEN MATCHED THEN UPDATE SET \"MARKETO_LEAD_ID\" = \"upsert\".\"MARKETO_LEAD_ID\", \"EVENT\" = \"upsert\".\"EVENT\", \"STATUS\" = \"upsert\".\"STATUS\", \"PRODUCT_JOURNEY_EVENT\" = \"upsert\".\"PRODUCT_JOURNEY_EVENT\", \"PRODUCT_JOURNEY_PROCESSED_ON\" = \"upsert\".\"PRODUCT_JOURNEY_PROCESSED_ON\", \"REQUEST_PAYLOAD\" = \"upsert\".\"REQUEST_PAYLOAD\"\nWHEN NOT MATCHED THEN INSERT (\"REQUEST_ID\", \"MARKETO_LEAD_ID\", \"EVENT\", \"STATUS\", \"PRODUCT_JOURNEY_EVENT\", \"PRODUCT_JOURNEY_PROCESSED_ON\", \"REQUEST_PAYLOAD\") VALUES (\"upsert\".\"REQUEST_ID\", \"upsert\".\"MARKETO_LEAD_ID\", \"upsert\".\"EVENT\", \"upsert\".\"STATUS\", \"upsert\".\"PRODUCT_JOURNEY_EVENT\", \"upsert\".\"PRODUCT_JOURNEY_PROCESSED_ON\", \"upsert\".\"REQUEST_PAYLOAD\") ;",
"sequenceId" : 10,
"bindings" : {
"1" : {
"type" : "FIXED",
"fmt" : null,
"schema" : null,
"value" : [ "1", "1" ]
},
"2" : {
"type" : "FIXED",
"fmt" : null,
"schema" : null,
"value" : [ "1", "1" ]
},
"3" : {
"type" : "TEXT",
"fmt" : null,
"schema" : null,
"value" : [ "01-01-update", "01-01-update" ]
},
"4" : {
"type" : "TEXT",
"fmt" : null,
"schema" : null,
"value" : [ "open1", "open2" ]
},
"5" : {
"type" : "TEXT",
"fmt" : null,
"schema" : null,
"value" : [ "event1", "event2" ]
},
"6" : {
"type" : "TEXT",
"fmt" : null,
"schema" : null,
"value" : [ "2025-12-18T13:32:54.191712Z", "2025-12-18T13:32:54.191751Z" ]
},
"7" : {
"type" : "TEXT",
"fmt" : null,
"schema" : null,
"value" : [ "something updated 1", "something updated 2" ]
}
},
"bindStage" : null,
"describeOnly" : false,
"parameters" : {
"NEW_SQL_FORMAT" : false,
"CLIENT_RESULT_CHUNK_SIZE" : 96
},
"queryContextDTO" : {
"entries" : [ {
"id" : 0,
"timestamp" : 1766064870431005,
"priority" : 0,
"context" : {
"base64Data" : "COKOswI="
}
} ]
},
"describedJobId" : "01c1222e-0a13-31d8-000b-e103fbac416b",
"querySubmissionTime" : 1766064892836,
"isInternal" : false,
"asyncExec" : false
}
{
"data" : {
"internalError" : false,
"sourceLocationValid" : true,
"unredactedFromSecureObject" : false,
"errorCode" : "002049",
"age" : 0,
"sqlState" : "42601",
"queryId" : "01c1222b-0a13-31c7-000b-e103fbabe753",
"line" : 2,
"pos" : 14,
"type" : "COMPILATION"
},
"code" : "002049",
"message" : "SQL compilation error: error line 2 at position 14\nBind variable ? not set.",
"success" : false,
"headers" : null
}
```
❗ If you need urgent assistance then file a case with Snowflake Support.
Otherwise continue here.
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of JDBC driver are you using?
3.27.1What operating system and processor architecture are you using?
Apple M4What version of Java are you using?
21What did you do?
Create the follwoing tables:
Try to perform a batch update by running (replace sql with the previous query):
When setting the
batchSizeto1the query is executed successfully and the data is upserted.However, when using a batch size greater than 1, the query fails with
SQL compilation error: error line 2 at position 14\nBind variable ? not set.What did you expect to see?
The expected behaviour would be for the batch update to execute successfully for batches with more that 1 batch.
Can you set logging to DEBUG and collect the logs?
Request sent to the Snowflake API:
Response: