This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 582d99c9af MINOR: [C++][FlightRPC] Clarify IsAutoUnique equivalence
between ODBC 2.0 and 3.0+ (#48689)
582d99c9af is described below
commit 582d99c9af2af84fa8891e575fec93ddb9d49139
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Sat Jan 3 09:35:51 2026 +0900
MINOR: [C++][FlightRPC] Clarify IsAutoUnique equivalence between ODBC 2.0
and 3.0+ (#48689)
### Rationale for this change
Clarify that `IsAutoUnique()` correctly maps to both ODBC 2.0
(`AUTO_INCREMENT`) and ODBC 3.0+ (`AUTO_UNIQUE_VALUE`) concepts, resolving a
TODO comment.
Reference:
https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgettypeinfo-function?view=sql-server-ver17
### What changes are included in this PR?
Replace the todo to the explanation of the equivalence.
### Are these changes tested?
No, I did not test.
### Are there any user-facing changes?
No, dev-only.
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: David Li <[email protected]>
---
.../arrow/flight/sql/odbc/odbc_impl/flight_sql_result_set_metadata.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_result_set_metadata.cc
b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_result_set_metadata.cc
index 11f6c60080..9e2f45647a 100644
--- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_result_set_metadata.cc
+++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_result_set_metadata.cc
@@ -222,7 +222,9 @@ Updatability FlightSqlResultSetMetadata::GetUpdatable(int
column_position) {
bool FlightSqlResultSetMetadata::IsAutoUnique(int column_position) {
ColumnMetadata metadata = GetMetadata(schema_->field(column_position - 1));
- // TODO: Is AutoUnique equivalent to AutoIncrement?
+ // AUTO_UNIQUE_VALUE (ODBC 3.0+) is equivalent to
+ // AUTO_INCREMENT (ODBC 2.0). Both indicate columns
+ // that automatically generate unique values.
return metadata.GetIsAutoIncrement().ValueOrElse([] { return false; });
}