lidavidm commented on code in PR #48708:
URL: https://github.com/apache/arrow/pull/48708#discussion_r2660283383


##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc:
##########
@@ -743,9 +743,12 @@ SQLRETURN ODBCStatement::GetData(SQLSMALLINT 
record_number, SQLSMALLINT c_type,
 
   SQLSMALLINT evaluated_c_type = c_type;
 
-  // TODO: Get proper default precision and scale from abstraction.
-  int precision = 38;  // arrow::Decimal128Type::kMaxPrecision;
-  int scale = 0;
+  // Get precision and scale from IRD (implementation row descriptor) as 
defaults.
+  // These can be overridden by ARD (application row descriptor) if specified.
+  const DescriptorRecord& ird_record = ird_->GetRecords()[record_number - 1];
+  int precision = ird_record.precision > 0 ? ird_record.precision
+                                           : 38;  // Default to max decimal 
precision

Review Comment:
   nit: is it possible to use an existing constant instead of hardcoding `38` 
as the max decimal128 precision?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to