databricks / databricks-sql-go

Golang database/sql driver for Databricks SQL.
Apache License 2.0
37 stars 41 forks source link

Bug fix for query that doesn't produce rows #136

Closed rcypher-databricks closed 1 year ago

rcypher-databricks commented 1 year ago

When executing a statement that doesn't produce rows (ex. CREATE TABLE ....) using DB.Query() instead of DB.Exec() the driver would panic. When DB.Query() is used we try to create a row object. In this case there was a mismatch in the schema metadata returned by thrift and the arrow schema metadata. The thrift schema was indicating a single column named 'Result' while the arrow schema metadata was indicating no columns. Moved the code creating the arrow schema and column info into separate functions. Updated creation of the column info to handle mismatch between the arrow and thrift schemas.
Signed-off-by: Raymond Cypher raymond.cypher@databricks.com