databricks-sql-go icon indicating copy to clipboard operation
databricks-sql-go copied to clipboard

Escape and subtitute query arguments client side

Open nyergler opened this issue 2 years ago • 4 comments

Coming from other Go database drivers the lack of query argument support was a surprise. This commit ports approximately what the Python Databricks library does in order to handle query arguments.

Feedback, suggestions, etc welcome!

nyergler avatar Jan 24 '23 17:01 nyergler

Got it, @andrefurlan-db . Is there an expected timeline for that development? I'm sure there's a lot in flight, just curious how far along that is.

nyergler avatar Jan 24 '23 18:01 nyergler

I did a bit of digging and it seems the parametrized query feature has been released in Spark 3.4.0 (merged since December 2022). However, it is not exposed in the thrift server which is used by databricks-sql-go to connect to Spark. https://issues.apache.org/jira/browse/SPARK-41271 https://github.com/apache/spark/pull/38864 https://github.com/apache/spark/blob/master/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala#L226

To me it looks like the feature is ready but not exposed to external clients.

nohajc avatar May 01 '23 10:05 nohajc

Hi @nohajc! The library got a support for named query parameters since v1.5.0. Can you please try it and let us know if it works for you? Thanks!

kravets-levko avatar Apr 16 '24 09:04 kravets-levko

Hi, thank you for the information. I noticed the support has been added but I'm not using databricks at the moment. When I come back to it at some point, I will definitely try.

Cheers!

nohajc avatar Apr 16 '24 09:04 nohajc