Skip to content

fix(bq_driver): fix Unsupported arrow data type (0) crash for INTERVAL types in HTAPI - #1636

Open
Anshu6250 wants to merge 1 commit into
mainfrom
arrow_fix_2
Open

fix(bq_driver): fix Unsupported arrow data type (0) crash for INTERVAL types in HTAPI#1636
Anshu6250 wants to merge 1 commit into
mainfrom
arrow_fix_2

Conversation

@Anshu6250

@Anshu6250 Anshu6250 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes an Unsupported arrow data type (0) crash that occurs when querying BigQuery INTERVAL data types with HTAPI enabled. Previously, the driver lacked the necessary schema mappings and string formatting for Arrow's specific interval memory layouts. This issue was consistently causing query failures in third-party applications like Excel, PowerBI, and Tableau, specifically when loading the AllDataTypes_2 and RangeIntervalTestTable tables.

Changes Included

  • To resolve this, the PR updates GetArrowSchema to explicitly recognize Arrow's interval memory layouts (INTERVAL_MONTHS, INTERVAL_DAY_TIME, and INTERVAL_MONTH_DAY_NANO) and maps them to the driver's internal BQDataType::kInterval. Furthermore, it adds dedicated handling for each of these layouts within ProcessRecordBatch. This ensures the underlying integer values—such as years, months, days, hours, minutes, seconds, and nanoseconds—are accurately extracted and formatted into the exact Y-M D H:M:S[.fraction] string structure expected by our downstream data translation layers.

perf pipeline : link

@Anshu6250 Anshu6250 changed the title test test: arrow issue fixed Aug 17, 2026
std::make_tuple("RangeIntervalTestTable",
"SELECT * FROM "
"`bigquery-devtools-drivers.DATATYPERANGETEST."
"RangeIntervalTestTable` LIMIT 10000")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have the limit as 100000

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

changed to 1 million

@Anshu6250
Anshu6250 force-pushed the arrow_fix_2 branch 2 times, most recently from 6ebb8af to f5381d1 Compare August 18, 2026 05:10
@Anshu6250 Anshu6250 changed the title test: arrow issue fixed fix(bq_driver): fix Unsupported arrow data type (0) crash for INTERVAL types in HTAPI Aug 18, 2026
@shivamd-gpartner
shivamd-gpartner marked this pull request as ready for review August 20, 2026 09:55
@shivamd-gpartner
shivamd-gpartner requested a review from a team as a code owner August 20, 2026 09:55
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.

2 participants