Skip to content

fix(csharp): metadata(csharp): Thrift GetColumns throws NotSupportedException on GEOMETRY/GEOGRAPHY columns (#568) - #578

Open
peco-engineer-bot[bot] wants to merge 1 commit into
mainfrom
ai/bugfix-568
Open

fix(csharp): metadata(csharp): Thrift GetColumns throws NotSupportedException on GEOMETRY/GEOGRAPHY columns (#568)#578
peco-engineer-bot[bot] wants to merge 1 commit into
mainfrom
ai/bugfix-568

Conversation

@peco-engineer-bot

Copy link
Copy Markdown
Contributor

Summary

Automated fix for #568 — metadata(csharp): Thrift GetColumns throws NotSupportedException on GEOMETRY/GEOGRAPHY columns.

Overrode SetPrecisionScaleAndTypeName in the editable DatabricksConnection to use SqlTypeNameParser.TryParse with a graceful fallback (raw type name + derived base type name) for SQL types the parser registry has no entry for (GEOMETRY/GEOGRAPHY), instead of the base class calling Parse which throws NotSupportedException. Verified via the two live-endpoint E2E tests, which now pass (both were red before the fix).

Files changed

  • csharp/test/E2E/StatementTests.cs
  • csharp/src/DatabricksConnection.cs
  • .claude/knowledge/learning.md

Test plan

  • AdbcDrivers.Databricks.Tests.StatementTests.CanGetColumnsOnGeospatialColumn(geoType: "GEOMETRY" — fails (red) against the original code, passes (green) after the fix
  • columnName: "geom_col") — fails (red) against the original code, passes (green) after the fix
  • AdbcDrivers.Databricks.Tests.StatementTests.CanGetColumnsOnGeospatialColumn(geoType: "GEOGRAPHY" — fails (red) against the original code, passes (green) after the fix
  • columnName: "geog_col") — fails (red) against the original code, passes (green) after the fix

Fixes #568

🤖 Generated by engineer-bot (bug-fix flow)

Not changed in this PR (out of scope)

These facets could not be fixed here. Reason given for each — please follow up as needed:

  • Register GEOMETRY/GEOGRAPHY as first-class SQL types in the shared SqlTypeNameParser registry — SqlTypeNameParser.cs and SparkConnection.cs live in csharp/hiveserver2/, a read-only git submodule (adbc-drivers/hiveserver2) that cannot be edited or PR'd from this repo.

    A cleaner long-term fix would add GEOMETRY/GEOGRAPHY parser entries (and/or a catch-all fallback) to SqlTypeNameParser's s_parserMap/s_parsers in csharp/hiveserver2/csharp/src/AdbcDrivers.HiveServer2/Hive2/SqlTypeNameParser.cs, and remove the throw in SparkConnection.SetPrecisionScaleAndTypeName's default arm. That would benefit all HiveServer2-based drivers (Spark, Impala) rather than only Databricks. The Databricks-side override implemented here fully resolves the reported crash for the Databricks driver.

@peco-engineer-bot peco-engineer-bot Bot added engineer-bot engineer-bot may fix this issue / take over this PR review-bot reviewer-bot reviews this PR labels Jul 8, 2026

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No issues identified by the review bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineer-bot engineer-bot may fix this issue / take over this PR review-bot reviewer-bot reviews this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metadata(csharp): Thrift GetColumns throws NotSupportedException on GEOMETRY/GEOGRAPHY columns

0 participants