feat(csharp): add shared schema factories and GetInfo builder#2
Open
msrathore-db wants to merge 5 commits intofeat/extract-metadata-utilities-part1from
Open
feat(csharp): add shared schema factories and GetInfo builder#2msrathore-db wants to merge 5 commits intofeat/extract-metadata-utilities-part1from
msrathore-db wants to merge 5 commits intofeat/extract-metadata-utilities-part1from
Conversation
8c7dd92 to
bb4dc21
Compare
…ng[PECO-2934] (adbc-drivers#23) ## Summary - `STRING COLLATE UNICODE_CI_AI` and other collated string types are valid Databricks column type names returned by `GetColumns`, but were rejected by `SqlTypeNameParser` with `NotSupportedException: Unsupported SQL type name` - Updated `SqlVarcharTypeParser` and `SqlCharTypeParser` regexes to accept an optional `COLLATE <name>` suffix - The collation name is parsed but ignored — `BaseTypeName` remains `STRING`/`VARCHAR`/`CHAR`, and the Arrow type remains `StringType` - Collation is a server-side concern; clients like Power BI receive the standard base type as expected ## Test plan - [ ] Added `CanParseVarcharWithCollation` tests: `STRING COLLATE UNICODE_CI_AI`, `VARCHAR(255) COLLATE UNICODE_CI_AI`, `STRING COLLATE UTF8_BINARY`, case-insensitive variant - [ ] Added `CanParseCharWithCollation` tests: `CHAR(10) COLLATE UNICODE_CI_AI`, `NCHAR(5) COLLATE UTF8_BINARY` - [ ] All 272 existing unit tests continue to pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Add MetadataSchemaFactory to MetadataSchemaDefinitions.cs with: - Schema factories: CreateCatalogsSchema, CreateSchemasSchema, CreateTablesSchema, CreateColumnMetadataSchema, CreatePrimaryKeysSchema, CreateCrossReferenceSchema - Empty result helpers: CreateEmpty*Result for each schema type - Result builders: BuildPrimaryKeysResult, BuildCrossReferenceResult - BuildGetInfoResult: shared DenseUnionArray builder for GetInfo Refactor HiveServer2Connection.GetInfo to use BuildGetInfoResult, replacing ~150 lines of inline DenseUnionArray construction. Values are now lazily resolved per requested info code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VendorSql → bool, all others → string. The union type is determined by the code, not by runtime type inspection of the value. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8af9c9c to
9ee6339
Compare
…r, TableInfo, and shared metadata types (adbc-drivers#21) ## 🥞 Stacked PR - [**feat/extract-metadata-utilities-part1**](adbc-drivers#21) [[Files changed](https://github.com/adbc-drivers/hiveserver2/pull/21/files)] - [feat/extract-metadata-utilities-part2](adbc-drivers#22) [[Files changed](https://github.com/adbc-drivers/hiveserver2/pull/22/files/9926495..bb4dc21)] ## Summary Extract reusable metadata utilities from HiveServer2Connection for sharing between Thrift and SEA protocols. ### Extracted classes - **GetObjectsResultBuilder**: async BuildGetObjectsResultAsync orchestrating depth-based cascade with shared CancellationToken - **IGetObjectsDataProvider**: async interface (GetCatalogsAsync, GetSchemasAsync, GetTablesAsync, PopulateColumnInfoAsync) — all accept CancellationToken from GetObjects caller - **TableInfo**: shared struct for column metadata - **HiveInfoArrowStream**: lightweight IArrowArrayStream for metadata results - **MetadataColumnNames**: shared column name constants ### Changes to existing code - HiveServer2Connection implements IGetObjectsDataProvider with async/await (no .Result blocking) - GetObjects creates one CancellationToken and passes through the entire chain - GetArrowType changed from private to internal static for cross-protocol reuse - EnhanceGetColumnsResult inlined back into HiveServer2Statement (was ColumnsResultEnhancer — Thrift-only, no need for separate class) - Backward-compatible constant aliases in HiveServer2Connection for subclass access - No changes to ImpalaConnection, SparkConnection, HiveServer2ExtendedConnection behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MetadataSchemaFactorywith schema factories for Catalogs, Schemas, Tables, Columns, PrimaryKeys, CrossReferenceCreateEmpty*Result) for each schema typeBuildPrimaryKeysResultandBuildCrossReferenceResultbuildersBuildGetInfoResult— shared DenseUnionArray builder for GetInfoHiveServer2Connection.GetInfoto useBuildGetInfoResult(lazy evaluation, ~120 lines removed)Test plan
dotnet buildsucceeds with 0 warnings🤖 Generated with Claude Code
Stack: 2/2 — depends on #1