Skip to content

GH-55748: [C++][FlightRPC][ODBC] Return Decimal Precision Value from Server - #55819

Open
alinaliBQ wants to merge 2 commits into
apache:mainfrom
dremio:gh-55748-fix-decimal-precision
Open

alinaliBQ wants to merge 2 commits into
apache:mainfrom
dremio:gh-55748-fix-decimal-precision

Conversation

@alinaliBQ

@alinaliBQ alinaliBQ commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Rationale for this change

GH-55748

What changes are included in this PR?

  • Return proper precision value for Decimal data type from the server, instead of hardcoded value 19 (the size of SQL_NUMERIC_STRUCT)
  • Tests against remote server to verify fix.

Are these changes tested?

  • Yes, locally and in CI

Are there any user-facing changes?

Yes, users using ODBC will see correct precision decimal value

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

…DECIMAL columns

FlightSqlResultSetMetadata::GetPrecision returned a hard-coded 19
(sizeof(SQL_NUMERIC_STRUCT)) for DECIMAL/NUMERIC columns, so SQLDescribeCol,
SQLColAttribute and SQLGetDescField reported a precision smaller than the
scale for types such as DECIMAL(38,20). Report the precision declared by the
Arrow Decimal128 type instead, and update the ODBC tests to expect it.
@alinaliBQ alinaliBQ added the CI: Extra: C++ Run extra C++ CI label Nov 27, 2026
@alinaliBQ
alinaliBQ force-pushed the gh-55748-fix-decimal-precision branch from 1eb7fcb to 4e8bd00 Compare November 27, 2026 19:55
@alinaliBQ
alinaliBQ marked this pull request as ready for review November 27, 2026 19:55
@alinaliBQ
alinaliBQ requested a review from lidavidm as a code owner November 27, 2026 19:55
@alinaliBQ
alinaliBQ force-pushed the gh-55748-fix-decimal-precision branch from 4e8bd00 to cf95476 Compare November 27, 2026 20:23
@alinaliBQ

Copy link
Copy Markdown
Collaborator Author

Hi @lidavidm @kou The PR is ready for review, please have a look.
ODBC macOS failures are due to a boost build issue, and they are being fixed by #55749

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][FlightRPC][ODBC] Return correct precision value for Decimal datatype

1 participant