-
Notifications
You must be signed in to change notification settings - Fork 105
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
go/adbc/driver/snowflake: Without the DB name the GetObjects call fails #1332
Comments
To elaborate when a connection is being made using the current driver without a database name, no We were able to reduce the time it takes for the I was looking at adding the cursor back to have A bit about the current GetObjects API:It fetches the catalogs, schemas, tables, table constraints (currently not implemented for Snowflake Go Driver), and columns. It also does this by making the following calls:
and missing implementation:
Constrast to ODBC:The following analysis is based on SIMBA ODBC Snowflake driver, ODBC Test and QueryHistory for client generated calls in Snowflake.
Therefore, the Proposal:Instead of making four separate calls, the design could be changed to just making one SQL call that is for the highest depth and inferring all the other information for the previous depths from it. Example: For the worst case scenario with the depth as Now, to decide the underlying API, there are two ways we can go about this: Underlying API Proposal 1:Make Pros:
Cons:
Underlying API Proposal 2:Continue with the Pros:
Cons:
Please let me know your thoughts about the changes in design and which API would be better among Underlying API Proposal 3:Hybrid approach, where we let the caller pick which API should be used based on the tradeoffs. Additional Questions:
|
@davidhcoe @zeroshade @jduo @lidavidm Please review and suggest your thoughts about the proposal. TL;DR
|
I think proposal 3 is probably best, allowing the consumer to choose the pros and cons. I'm not a fan of the fact that it would truncate the results if we go with the first proposal, but the performance benefits seem significant. So it's a tough call. @lidavidm thoughts? |
Created a draft pull request for reducing the SQL calls: #1351 I will create another draft PR with removing the cursor call and generating the necessary SQL in Go. |
So long as the maintenance burden is not excessive. We should also default to the 'correct' method and only use the 'fast' method if desired by the caller. |
Created a draft PR with reduced SQL calls (though this makes 2 and doesn't use cursor): #1352 |
Yeah it makes sense to choose the one that's better in the long run. The code without cursor makes an extra SQL call but is slightly faster in the conditions that I have tested. Need to see which would be better consider all scenarios. |
@ryan-syed - I think this can be closed now, yes? |
Closing this as the number of SQL calls have been reduced and the performance is reasonable. |
Currently the Snowflake Go driver needs the database name to make the
GetObjects
call. However, ODBC based driver just requires the server name and warehouse. To make the experience more inline with other existing snowflake drivers, should theGetObjects
be able get the information without needing a database being passed as a default.The text was updated successfully, but these errors were encountered: