-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix(go/adbc/driver/flightsql): Parsing column metadata in FlightSQL driver #2481
base: main
Are you sure you want to change the base?
fix(go/adbc/driver/flightsql): Parsing column metadata in FlightSQL driver #2481
Conversation
I will take a look. |
|
||
suite.Equal(tt.columnName, columnName, "columnName") | ||
//suite.Equal(tt.ordinalPosition, ordinalPosition, "ordinalPosition") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we losing the ordinal positions for comparison?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. The ordinal position is set based on the order in which the columns are processed unless there's a metadata key ORDINAL_POSITION
.
While writing the test I realized that even tho the schema is built always in the same order, the deserialization would (sometimes) cause columns to be in different order. I couldn't exactly understand the issue (if it even is an issue).
To work around this, I ignored the ordinal position (flight doesn't even set ORDINAL_POSITION
) and appended the name of the columns being processed to every fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most likely the reason for that is because of the usage of a map. Golang maps do not have a guaranteed order and are in fact randomized when iterating. So you can't rely on the order of a map during iteration.
shared_utils.go
XDBC_
fields using fields metadataToXdbcDataType
function toshared_utils.go
to resolve circular dependency issuesCOMMENT
,CHARACTER_MAXIMUM_LENGTH
,XDBC_SCALE
,XDBC_PRECISION
)*
COMMENT
,CHARACTER_MAXIMUM_LENGTH
seem to be snowflake specific even though it seems snowflake adbc driver has a separate implementation.XDBC_SCALE
,XDBC_PRECISION