lidavidm commented on code in PR #46099: URL: https://github.com/apache/arrow/pull/46099#discussion_r2297260899
########## cpp/src/arrow/flight/sql/odbc/flight_sql/accessors/timestamp_array_accessor.cc: ########## @@ -85,6 +88,10 @@ RowStatus TimestampArrayFlightSqlAccessor<TARGET_TYPE, UNIT>::MoveSingleCell_imp ColumnBinding* binding, int64_t arrow_row, int64_t cell_counter, int64_t& value_offset, bool update_value_offset, odbcabstraction::Diagnostics& diagnostics) { + // Times less than the minimum integer number of seconds that can be represented + // for each time unit will not convert correctly. This is mostly interesting for Review Comment: Can we detect & error? ########## cpp/src/arrow/flight/sql/odbc/install/install_amd64.cmd: ########## Review Comment: What about this is specific to amd64? ########## cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h: ########## @@ -77,4 +78,39 @@ inline size_t ConvertToSqlWChar(const std::string& str, SQLWCHAR* buffer, } } +/// \brief Convert buffer of SqlWchar to standard string +/// \param[in] wchar_msg SqlWchar to convert +/// \param[in] msg_len Number of characters in wchar_msg +/// \return wchar_msg in std::string format +inline std::string SqlWcharToString(SQLWCHAR* wchar_msg, SQLINTEGER msg_len = SQL_NTS) { + if (!wchar_msg || wchar_msg[0] == 0 || msg_len == 0) { + return std::string(); + } + + thread_local std::vector<uint8_t> utf8_str; + + if (msg_len == SQL_NTS) { + WcsToUtf8((void*)wchar_msg, &utf8_str); + } else { + WcsToUtf8((void*)wchar_msg, msg_len, &utf8_str); + } + + return std::string(utf8_str.begin(), utf8_str.end()); +} + +inline std::string SqlStringToString(const unsigned char* sqlStr, + int32_t sqlStrLen = SQL_NTS) { Review Comment: ```suggestion inline std::string SqlStringToString(const unsigned char* sql_str, int32_t sql_str_len = SQL_NTS) { ``` etc. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org