cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Simba ODBC batch queries

DBUser2
New Contributor III

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

1 REPLY 1

PiotrMi
Contributor

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:

https://docs.databricks.com/en/_extras/documents/Simba-Apache-Spark-ODBC-Connector-Install-and-Confi...

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now