Skip to content

fix(csharp): use Int8Type for BUFFER_LENGTH in column metadata schema#24

Closed
msrathore-db wants to merge 1 commit into
adbc-drivers:mainfrom
msrathore-db:fix/buffer-length-int8
Closed

fix(csharp): use Int8Type for BUFFER_LENGTH in column metadata schema#24
msrathore-db wants to merge 1 commit into
adbc-drivers:mainfrom
msrathore-db:fix/buffer-length-int8

Conversation

@msrathore-db

Copy link
Copy Markdown
Contributor

What's Changed

The Databricks Thrift server returns BUFFER_LENGTH as Int8Type. The schema factory was incorrectly using Int32Type, causing type mismatches between Thrift and SEA metadata results.

Please fill in a description of the changes here.

This contains breaking changes.

Closes #NNN.

The Databricks Thrift server returns BUFFER_LENGTH as Int8Type. The
schema factory was incorrectly using Int32Type, causing type mismatches
between Thrift and SEA metadata results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
msrathore-db added a commit to adbc-drivers/databricks that referenced this pull request Mar 6, 2026
Points to adbc-drivers/hiveserver2#24 which changes BUFFER_LENGTH
from Int32Type to Int8Type in MetadataSchemaFactory to match the
Thrift server's actual return type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
new Field("DATA_TYPE", Int32Type.Default, true),
new Field("TYPE_NAME", StringType.Default, true),
new Field("COLUMN_SIZE", Int32Type.Default, true),
new Field("BUFFER_LENGTH", Int32Type.Default, true),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nope Int8 is just up to 128, which is way to small for buffer length, we should use int32.

msrathore-db added a commit to adbc-drivers/databricks that referenced this pull request Mar 9, 2026
…builder

Revert hiveserver2 submodule to e42efb4 (MetadataSchemaFactory keeps
BUFFER_LENGTH as Int32Type per JDBC spec). Revert FlatColumnsResultBuilder
to Int32Array.Builder to match the schema.

The Thrift server returns Int8 for BUFFER_LENGTH and the Thrift builder
(DatabricksStatement line 830) uses Int8Array.Builder — those are unchanged.
Tests assert Int8Type which matches the CreateExtendedColumnsResult code path.

The schema factory fix (Int32→Int8) will be handled separately via
adbc-drivers/hiveserver2#24 if needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CurtHagenlocher

Copy link
Copy Markdown
Collaborator

@msrathore-db, I'm going to close this PR. Feel free to re-open if you think this is in error.

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.

3 participants