GH-47724: [C++][FlightRPC] ODBC: implement SQLDescribeCol#48052
Merged
Conversation
|
|
alinaliBQ
commented
Nov 4, 2025
alinaliBQ
force-pushed
the
gh-47724-sql-describe-col
branch
from
November 10, 2025 23:59
3651989 to
cbaabaf
Compare
Collaborator
Author
|
@lidavidm this draft PR is ready for review! Please have a look. Please note: #48052 (comment) |
alinaliBQ
force-pushed
the
gh-47724-sql-describe-col
branch
3 times, most recently
from
December 4, 2025 23:29
b9480f8 to
b6fdfd6
Compare
alinaliBQ
force-pushed
the
gh-47724-sql-describe-col
branch
2 times, most recently
from
December 15, 2025 22:27
e7e471b to
1cf04e2
Compare
alinaliBQ
force-pushed
the
gh-47724-sql-describe-col
branch
from
January 2, 2026 19:56
1cf04e2 to
d6a9d12
Compare
alinaliBQ
marked this pull request as ready for review
January 2, 2026 19:56
lidavidm
reviewed
Jan 5, 2026
Member
There was a problem hiding this comment.
Is there a better way to name these than '2' and '3'?
Collaborator
Author
There was a problem hiding this comment.
Yup, I have changed ODBC2 to ODBCVer2 and ODBC3 to ODBCVer3 for better readability
This PR depends on SQLColAttribute for descriptor fixes, SQLColumns, SQLTables, and SQLGetTypeInfo for tests Co-Authored-By: rscales <robscales@icloud.com>
Work on David's comment.
alinaliBQ
force-pushed
the
gh-47724-sql-describe-col
branch
from
January 6, 2026 19:59
d6a9d12 to
69fa019
Compare
Collaborator
Author
|
@kou This the last PR to complete Windows ODBC basic functionality. Please have a look |
lidavidm
approved these changes
Jan 9, 2026
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit b126c6e. There weren't enough matching historic benchmark results to make a call on whether there were regressions. The full Conbench report has more details. |
Mottl
pushed a commit
to Mottl/arrow
that referenced
this pull request
May 26, 2026
…he#48052) ### Rationale for this change Implement SQLDescribeCol which "returns the result descriptor - column name,type, column size, decimal digits, and nullability - for one column in the result set. This information also is available in the fields of the IRD." ([Microsoft doc reference](https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqldescribecol-function?view=sql-server-ver17)) ### What changes are included in this PR? - SQLDescribeCol & Tests ### Are these changes tested? Tested locally on MSVC Windows ### Are there any user-facing changes? n/a * GitHub Issue: apache#47724 Authored-by: Alina (Xi) Li <alina.li@improving.com> Signed-off-by: David Li <li.davidm96@gmail.com>
vikrantpuppala
added a commit
to vikrantpuppala/arrow
that referenced
this pull request
Jul 20, 2026
…/decimal_digits width SQLDescribeCol read SQL_DESC_PRECISION (a 2-byte SQLSMALLINT) directly into the caller's 8-byte SQLULEN* column_size output for numeric/decimal columns. The GetAttribute template writes exactly sizeof(T) bytes and ignores the claimed buffer_length, so only the low 2 bytes were written and the upper 6 bytes were left uninitialized garbage. Read the precision into a local SQLSMALLINT and widen-assign it into *column_size_ptr so all 8 bytes are written. Also fix the two decimal_digits sites (SQL_DESC_SCALE and datetime SQL_DESC_PRECISION) to pass sizeof(SQLSMALLINT) -- the true width of the SQLSMALLINT* decimal_digits output -- instead of sizeof(SQLULEN). Add describe_col_test.cc, which pre-fills column_size with an all-ones sentinel and asserts SQLDescribeCol fully overwrites it for DECIMAL and TIMESTAMP columns. Introduced by apacheGH-47724 (apache#48052). Signed-off-by: Vikrant Puppala <vikrantpuppala@gmail.com>
vikrantpuppala
added a commit
to vikrantpuppala/arrow
that referenced
this pull request
Jul 21, 2026
…/decimal_digits width SQLDescribeCol read SQL_DESC_PRECISION (a 2-byte SQLSMALLINT) directly into the caller's 8-byte SQLULEN* column_size output for numeric/decimal columns. The GetAttribute template writes exactly sizeof(T) bytes and ignores the claimed buffer_length, so only the low 2 bytes were written and the upper 6 bytes were left uninitialized garbage. Read the precision into a local SQLSMALLINT and widen-assign it into *column_size_ptr so all 8 bytes are written. Also fix the two decimal_digits sites (SQL_DESC_SCALE and datetime SQL_DESC_PRECISION) to pass sizeof(SQLSMALLINT) -- the true width of the SQLSMALLINT* decimal_digits output -- instead of sizeof(SQLULEN). Add describe_col_test.cc, which pre-fills column_size with an all-ones sentinel and asserts SQLDescribeCol fully overwrites it for DECIMAL and TIMESTAMP columns. Introduced by apacheGH-47724 (apache#48052). Signed-off-by: Vikrant Puppala <vikrantpuppala@gmail.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.
Rationale for this change
Implement SQLDescribeCol which "returns the result descriptor - column name,type, column size, decimal digits, and nullability - for one column in the result set. This information also is available in the fields of the IRD." (Microsoft doc reference)
What changes are included in this PR?
Are these changes tested?
Tested locally on MSVC Windows
Are there any user-facing changes?
n/a