Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jan 2, 2026

Rationale for this change

// TODO: Get proper default precision and scale from abstraction.
int precision = 38; // arrow::Decimal128Type::kMaxPrecision;
int scale = 0;

This was introduced by ed36107

The GetData function was using hardcoded precision (38) and scale (0) values instead of retrieving them from the IRD (Implementation Row Descriptor). This fix ensures that precision/scale are properly retrieved from the IRD as defaults, and can be overridden by ARD (Application Row Descriptor) values when specified, following ODBC specification behavior.

What changes are included in this PR?

  • Modified ODBCStatement::GetData() to use IRD precision/scale as defaults instead of hardcoded values
  • ARD precision/scale now properly override IRD values when SQL_ARD_TYPE or SQL_C_DEFAULT is used
  • Added unit tests to verify IRD defaults and ARD override behavior

Are these changes tested?

Yes. Added two tests in statement_test.cc:

  • TestGetDataPrecisionScaleUsesIRDAsDefault: Verifies IRD precision/scale are used as defaults
  • TestGetDataPrecisionScaleUsesARDWhenSet: Verifies ARD precision/scale override IRD when set

Are there any user-facing changes?

I think it's fair to say a no. This is an internal fix that ensures correct ODBC behavior.

@HyukjinKwon HyukjinKwon requested a review from lidavidm as a code owner January 2, 2026 02:58
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

⚠️ GitHub issue #48707 has been automatically assigned in GitHub to PR creator.

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.

1 participant