Skip to content

Commit

Permalink
fix(go/adbc/driver/flightsql): Parsing column metadata in FlightSQL d…
Browse files Browse the repository at this point in the history
…river (#2481)

* Fixes [#2434](#2434)
* Moved driver-agnostic metadata parsing out of `shared_utils.go`
* Each driver can now implement its own logic for handling `XDBC_`
fields using fields metadata
* Snowflake and BigQuery drivers seem unaffected as they use separate
implementations
* Relocated `ToXdbcDataType` function to `shared_utils.go` to resolve
circular dependency issues
* Aligned implementation with documentation by:
  * Ensuring all documented XDBC_ fields are properly fetched
* Removing undocumented fields (`COMMENT`, `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.
* Couldn't find any documentation regarding `XDBC_SCALE`,
`XDBC_PRECISION`
* Restored tests that verify proper metadata field population
  • Loading branch information
xborder authored Jan 31, 2025
1 parent 3034496 commit 9c5cd73
Show file tree
Hide file tree
Showing 6 changed files with 718 additions and 302 deletions.
2 changes: 1 addition & 1 deletion go/adbc/driver/bigquery/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (c *connectionImpl) GetTablesForDBSchema(ctx context.Context, catalog strin
if err != nil {
return nil, err
}
xdbcDataType := driverbase.ToXdbcDataType(field.Type)
xdbcDataType := internal.ToXdbcDataType(field.Type)

columns = append(columns, driverbase.ColumnInfo{
ColumnName: fieldschema.Name,
Expand Down
Loading

0 comments on commit 9c5cd73

Please sign in to comment.