Simba ODBC batch queries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 09:32 AM
I'm using Simba ODBC driver to Connect to databricks. Since this driver doesn't support transactions, I was trying to run a DELETE and then INSERT query from a within a single execute, but I get an error. Is there an alternate way to perform a batch of operations together so that if one fails, others aren't commited.
org.apache.spark.sql.catalyst.parser.ParseException:
[PARSE_SYNTAX_ERROR] Syntax error at or near 'DELETE': extra input 'DELETE'. SQLSTATE: 42601 (line 2, pos 1)
The query that I'm trying to run through single command.ExecuteNonQuery() is:
INSERT into test.samples.employee values('5','value5');
DELETE FROM test.samples.employee where empid = 1;
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2024 03:02 AM
Hey @DBUser2
It looks that delete is not supported at all based on documentation:
Write-back
The Simba Apache Spark ODBC Connector supports translation for the following
syntax when connecting to a Spark Thrift Server instance that is running Spark 1.3 or
later:
l INSERT
l CREATE
l DROP
Spark does not support UPDATE or DELETE syntax.
If the statement contains non-standard SQL-92 syntax, then the connector is unable to
translate the statement to SQL and instead falls back to using HiveQL.
Doc: