Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jun 26, 2023

Conversation

rcypher-databricks
Copy link
Contributor

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

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>
Copy link
Contributor

@susodapop susodapop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mattdeekay mattdeekay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rcypher-databricks rcypher-databricks merged commit 341b55e into databricks:main Jun 26, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants