kou commented on code in PR #55869:
URL: https://github.com/apache/arrow/pull/55869#discussion_r4781186145


##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/config/configuration.cc:
##########


Review Comment:
   How about replacing the existing `RemoveAllKnownKeys()` and `for (auto key : 
customKeys)` loop in `LoadDsn()` with the following instead of reading 
`StringColumnLength`, `UseWideChar`, `ChunkBufferCapacity` and `User ID` 
explicitly?
   
   ```suggestion
     for (const auto& key : customKeys) {
       if (arrow::internal::AsciiEqualsCaseInsensitive(key, 
FlightSqlConnection::DSN) ||
           arrow::internal::AsciiEqualsCaseInsensitive(key, 
FlightSqlConnection::DRIVER)) {
         continue;
       }
       Emplace(key, ReadDsnString(dsn, key));
     }
   ```
   
   `Emplace()` doesn't overwrite the keys that are read explicitly. 
`PropertyMap` is case-insensitive.
   
   With this approach, we don't need to update `LoadDsn()` when we add a new 
key to `ALL_KEYS`. We also don't need the `LoadDsnReadsAllKnownKeys` test.
   



##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.cc:
##########
@@ -67,6 +67,20 @@ const std::vector<std::string_view> 
FlightSqlConnection::ALL_KEYS = {
     FlightSqlConnection::USE_WIDE_CHAR,
     FlightSqlConnection::CHUNK_BUFFER_CAPACITY};
 
+const std::vector<std::string_view> FlightSqlConnection::DSN_DIALOG_KEYS = {
+    FlightSqlConnection::DSN,
+    FlightSqlConnection::DRIVER,
+    FlightSqlConnection::HOST,
+    FlightSqlConnection::PORT,
+    FlightSqlConnection::TOKEN,
+    FlightSqlConnection::UID,
+    FlightSqlConnection::USER_ID,

Review Comment:
   It seems that we don't have an input field for `USER_ID`. Should we remove 
`USER_ID`?
   
   ```suggestion
   ```



-- 
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