From 2961afbf32a1831d7a79df5ce35b0d95abab97bb Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 25 Sep 2025 17:10:21 -0700 Subject: [PATCH 1/4] Replace `boost::make_optional` with std Fix null std::optional read issue [In prog] Add missing std::optional header Add std optional header NOT TESTED - draft for change to std::optional --- .../sql/odbc/odbc_impl/blocking_queue.h | 6 +++--- .../odbc/odbc_impl/flight_sql_auth_method.cc | 3 ++- .../odbc/odbc_impl/flight_sql_connection.cc | 19 +++++++++++-------- .../odbc/odbc_impl/flight_sql_connection.h | 6 +++--- .../odbc_impl/flight_sql_connection_test.cc | 10 ++++++---- .../odbc/odbc_impl/flight_sql_statement.cc | 14 +++++++++----- .../sql/odbc/odbc_impl/flight_sql_statement.h | 6 ++++-- .../flight_sql_stream_chunk_buffer.cc | 10 +++++++--- .../sql/odbc/odbc_impl/odbc_connection.cc | 3 ++- .../sql/odbc/odbc_impl/odbc_statement.cc | 6 +++--- .../sql/odbc/odbc_impl/spi/connection.h | 4 ++-- .../flight/sql/odbc/odbc_impl/spi/statement.h | 8 ++++---- .../arrow/flight/sql/odbc/odbc_impl/types.h | 4 ++-- .../arrow/flight/sql/odbc/odbc_impl/util.cc | 12 ++++++------ .../arrow/flight/sql/odbc/odbc_impl/util.h | 6 +++--- 15 files changed, 67 insertions(+), 50 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/blocking_queue.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/blocking_queue.h index 5c9e6609d58..e52c305e461 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/blocking_queue.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/blocking_queue.h @@ -18,9 +18,9 @@ #pragma once #include -#include #include #include +#include #include #include @@ -43,7 +43,7 @@ class BlockingQueue { std::atomic closed_{false}; public: - typedef std::function(void)> Supplier; + typedef std::function(void)> Supplier; explicit BlockingQueue(size_t capacity) : capacity_(capacity), buffer_(capacity) {} @@ -58,7 +58,7 @@ class BlockingQueue { // Only one thread at a time be notified and call supplier auto item = supplier(); - if (!item) break; + if (!item.has_value()) break; Push(*item); } diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_auth_method.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_auth_method.cc index 5ea456a0716..cc3043bcc62 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_auth_method.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_auth_method.cc @@ -24,6 +24,7 @@ #include "arrow/result.h" #include "arrow/status.h" +#include #include namespace arrow::flight::sql::odbc { @@ -74,7 +75,7 @@ class UserPasswordAuthMethod : public FlightSqlAuthMethod { void Authenticate(FlightSqlConnection& connection, FlightCallOptions& call_options) override { FlightCallOptions auth_call_options; - const boost::optional& login_timeout = + const std::optional& login_timeout = connection.GetAttribute(Connection::LOGIN_TIMEOUT); if (login_timeout && boost::get(*login_timeout) > 0) { // ODBC's LOGIN_TIMEOUT attribute and FlightCallOptions.timeout use diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.cc index e1b7106250d..a08d9b698c9 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.cc @@ -31,7 +31,6 @@ #include #include #include -#include #include "arrow/flight/sql/odbc/odbc_impl/exceptions.h" #include @@ -205,7 +204,7 @@ void FlightSqlConnection::PopulateMetadataSettings( metadata_settings_.chunk_buffer_capacity = GetChunkBufferCapacity(conn_property_map); } -boost::optional FlightSqlConnection::GetStringColumnLength( +std::optional FlightSqlConnection::GetStringColumnLength( const Connection::ConnPropertyMap& conn_property_map) { const int32_t min_string_column_length = 1; @@ -220,7 +219,7 @@ boost::optional FlightSqlConnection::GetStringColumnLength( "01000", ODBCErrorCodes_GENERAL_WARNING); } - return boost::none; + return std::nullopt; } bool FlightSqlConnection::GetUseWideChar(const ConnPropertyMap& conn_property_map) { @@ -256,7 +255,7 @@ const FlightCallOptions& FlightSqlConnection::PopulateCallOptions( const ConnPropertyMap& props) { // Set CONNECTION_TIMEOUT attribute or LOGIN_TIMEOUT depending on if this // is the first request. - const boost::optional& connection_timeout = + const std::optional& connection_timeout = closed_ ? GetAttribute(LOGIN_TIMEOUT) : GetAttribute(CONNECTION_TIMEOUT); if (connection_timeout && boost::get(*connection_timeout) > 0) { call_options_.timeout = @@ -394,17 +393,21 @@ bool FlightSqlConnection::SetAttribute(Connection::AttributeId attribute, } } -boost::optional FlightSqlConnection::GetAttribute( +std::optional FlightSqlConnection::GetAttribute( Connection::AttributeId attribute) { switch (attribute) { case ACCESS_MODE: // FlightSQL does not provide this metadata. - return boost::make_optional(Attribute(static_cast(SQL_MODE_READ_WRITE))); + return std::make_optional(Attribute(static_cast(SQL_MODE_READ_WRITE))); case PACKET_SIZE: - return boost::make_optional(Attribute(static_cast(0))); + return std::make_optional(Attribute(static_cast(0))); default: const auto& it = attribute_.find(attribute); - return boost::make_optional(it != attribute_.end(), it->second); + if (it != attribute_.end()) { + return std::make_optional(it->second); + } else { + return std::nullopt; + } } } diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h index cc53ef1a08a..784c0767600 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h @@ -19,6 +19,7 @@ #include "arrow/flight/sql/odbc/odbc_impl/spi/connection.h" +#include #include #include "arrow/flight/api.h" #include "arrow/flight/sql/api.h" @@ -91,7 +92,7 @@ class FlightSqlConnection : public Connection { bool SetAttribute(AttributeId attribute, const Attribute& value) override; - boost::optional GetAttribute( + std::optional GetAttribute( Connection::AttributeId attribute) override; Info GetInfo(uint16_t info_type) override; @@ -119,8 +120,7 @@ class FlightSqlConnection : public Connection { /// \note Visible for testing void SetClosed(bool is_closed); - boost::optional GetStringColumnLength( - const ConnPropertyMap& conn_property_map); + std::optional GetStringColumnLength(const ConnPropertyMap& conn_property_map); bool GetUseWideChar(const ConnPropertyMap& conn_property_map); diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection_test.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection_test.cc index 55b9beddb9e..a63e385e2e8 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection_test.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection_test.cc @@ -21,6 +21,8 @@ #include "arrow/flight/types.h" #include "gtest/gtest.h" +#include + namespace arrow::flight::sql::odbc { using arrow::flight::Location; @@ -31,7 +33,7 @@ TEST(AttributeTests, SetAndGetAttribute) { connection.SetClosed(false); connection.SetAttribute(Connection::CONNECTION_TIMEOUT, static_cast(200)); - const boost::optional first_value = + const std::optional first_value = connection.GetAttribute(Connection::CONNECTION_TIMEOUT); EXPECT_TRUE(first_value); @@ -40,7 +42,7 @@ TEST(AttributeTests, SetAndGetAttribute) { connection.SetAttribute(Connection::CONNECTION_TIMEOUT, static_cast(300)); - const boost::optional change_value = + const std::optional change_value = connection.GetAttribute(Connection::CONNECTION_TIMEOUT); EXPECT_TRUE(change_value); @@ -52,7 +54,7 @@ TEST(AttributeTests, SetAndGetAttribute) { TEST(AttributeTests, GetAttributeWithoutSetting) { FlightSqlConnection connection(OdbcVersion::V_3); - const boost::optional optional = + const std::optional optional = connection.GetAttribute(Connection::CONNECTION_TIMEOUT); connection.SetClosed(false); @@ -77,7 +79,7 @@ TEST(MetadataSettingsTest, StringColumnLengthTest) { std::to_string(expected_string_column_length)}, }; - const boost::optional actual_string_column_length = + const std::optional actual_string_column_length = connection.GetStringColumnLength(properties); EXPECT_TRUE(actual_string_column_length); diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.cc index f983f85a098..6857e95fcda 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.cc @@ -29,7 +29,7 @@ #include "arrow/flight/sql/odbc/odbc_impl/util.h" #include "arrow/io/memory.h" -#include +#include #include #include "arrow/flight/sql/odbc/odbc_impl/exceptions.h" @@ -109,13 +109,17 @@ bool FlightSqlStatement::SetAttribute(StatementAttributeId attribute, } } -boost::optional FlightSqlStatement::GetAttribute( +std::optional FlightSqlStatement::GetAttribute( StatementAttributeId attribute) { const auto& it = attribute_.find(attribute); - return boost::make_optional(it != attribute_.end(), it->second); + if (it != attribute_.end()) { + return std::make_optional(it->second); + } else { + return std::nullopt; + } } -boost::optional> FlightSqlStatement::Prepare( +std::optional> FlightSqlStatement::Prepare( const std::string& query) { ClosePreparedStatementIfAny(prepared_statement_, call_options_); @@ -127,7 +131,7 @@ boost::optional> FlightSqlStatement::Prepare( const auto& result_set_metadata = std::make_shared( prepared_statement_->dataset_schema(), metadata_settings_); - return boost::optional>(result_set_metadata); + return std::optional>(result_set_metadata); } bool FlightSqlStatement::ExecutePrepared() { diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.h index ea765295c35..4e4ca2c56ac 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement.h @@ -26,6 +26,8 @@ #include "arrow/flight/sql/api.h" #include "arrow/flight/types.h" +#include + namespace arrow::flight::sql::odbc { class FlightSqlStatement : public Statement { @@ -55,9 +57,9 @@ class FlightSqlStatement : public Statement { bool SetAttribute(StatementAttributeId attribute, const Attribute& value) override; - boost::optional GetAttribute(StatementAttributeId attribute) override; + std::optional GetAttribute(StatementAttributeId attribute) override; - boost::optional> Prepare( + std::optional> Prepare( const std::string& query) override; bool ExecutePrepared() override; diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_stream_chunk_buffer.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_stream_chunk_buffer.cc index ade7fd5b57f..bf10aecbb22 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_stream_chunk_buffer.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_stream_chunk_buffer.cc @@ -69,9 +69,13 @@ FlightStreamChunkBuffer::FlightStreamChunkBuffer( // call. temp_flight_sql_client is intentionally null if the list of endpoint // Locations is empty. // After all data is fetched from reader, the temp client is closed. - return boost::make_optional( - is_not_ok || is_not_empty, - std::make_pair(std::move(result), temp_flight_sql_client)); + if (is_not_ok || is_not_empty) { + return std::make_optional( + std::make_pair(std::move(result), temp_flight_sql_client)); + } else { + return std::optional< + std::pair, std::shared_ptr>>{}; + } }; queue_.AddProducer(std::move(supplier)); } diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_connection.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_connection.cc index 395aa04d1fb..5207c505bc5 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_connection.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_connection.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include using ODBC::ODBCConnection; @@ -525,7 +526,7 @@ SQLRETURN ODBCConnection::GetConnectAttr(SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER* output_length, bool is_unicode) { using arrow::flight::sql::odbc::Connection; - boost::optional spi_attribute; + std::optional spi_attribute; switch (attribute) { // Internal connection attributes diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc index 4ff452892bd..2656701df72 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc @@ -29,8 +29,8 @@ #include #include #include -#include #include +#include #include using ODBC::DescriptorRecord; @@ -284,7 +284,7 @@ void ODBCStatement::CopyAttributesFromConnection(ODBCConnection& connection) { bool ODBCStatement::IsPrepared() const { return is_prepared_; } void ODBCStatement::Prepare(const std::string& query) { - boost::optional > metadata = + std::optional > metadata = spi_statement_->Prepare(query); if (metadata) { @@ -378,7 +378,7 @@ void ODBCStatement::GetStmtAttr(SQLINTEGER statement_attribute, SQLPOINTER outpu SQLINTEGER buffer_size, SQLINTEGER* str_len_ptr, bool is_unicode) { using arrow::flight::sql::odbc::Statement; - boost::optional spi_attribute; + std::optional spi_attribute; switch (statement_attribute) { // Descriptor accessor attributes case SQL_ATTR_APP_PARAM_DESC: diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h index ec0e3e727ee..73983209208 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h @@ -18,10 +18,10 @@ #pragma once #include -#include #include #include #include +#include #include #include @@ -86,7 +86,7 @@ class Connection { /// \brief Retrieve a connection attribute /// \param attribute [in] Attribute to be retrieved. - virtual boost::optional GetAttribute( + virtual std::optional GetAttribute( Connection::AttributeId attribute) = 0; /// \brief Retrieves info from the database (see ODBC's SQLGetInfo). diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/statement.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/statement.h index 970e447dfdc..d8b8daf1ec4 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/statement.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/statement.h @@ -17,14 +17,14 @@ #pragma once -#include #include #include +#include #include namespace arrow::flight::sql::odbc { -using boost::optional; +using std::optional; class ResultSet; @@ -74,9 +74,9 @@ class Statement { /// \brief Prepares the statement. /// Returns ResultSetMetadata if query returns a result set, - /// otherwise it returns `boost::none`. + /// otherwise it returns `std::nullopt`. /// \param query The SQL query to prepare. - virtual boost::optional> Prepare( + virtual std::optional> Prepare( const std::string& query) = 0; /// \brief Execute the prepared statement. diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h index b4d7a5e3d1a..4e19c95a5cb 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h @@ -17,7 +17,7 @@ #pragma once -#include +#include #include "arrow/flight/sql/odbc/odbc_impl/platform.h" namespace arrow::flight::sql::odbc { @@ -171,7 +171,7 @@ enum RowStatus : uint16_t { }; struct MetadataSettings { - boost::optional string_column_length{boost::none}; + std::optional string_column_length{std::nullopt}; size_t chunk_buffer_capacity; bool use_wide_char; }; diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc index d663841d8f9..37cd4a3da97 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc @@ -1109,17 +1109,17 @@ int32_t GetDecimalTypePrecision(const std::shared_ptr& decimal_ return decimal128_type->precision(); } -boost::optional AsBool(const std::string& value) { +std::optional AsBool(const std::string& value) { if (boost::iequals(value, "true") || boost::iequals(value, "1")) { return true; } else if (boost::iequals(value, "false") || boost::iequals(value, "0")) { return false; } else { - return boost::none; + return std::nullopt; } } -boost::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, +std::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, const std::string_view& property_name) { auto extracted_property = conn_property_map.find(std::string(property_name)); @@ -1127,10 +1127,10 @@ boost::optional AsBool(const Connection::ConnPropertyMap& conn_property_ma return AsBool(extracted_property->second); } - return boost::none; + return std::nullopt; } -boost::optional AsInt32(int32_t min_value, +std::optional AsInt32(int32_t min_value, const Connection::ConnPropertyMap& conn_property_map, const std::string_view& property_name) { auto extracted_property = conn_property_map.find(std::string(property_name)); @@ -1142,7 +1142,7 @@ boost::optional AsInt32(int32_t min_value, return string_column_length; } } - return boost::none; + return std::nullopt; } } // namespace util diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h index a2f549a3f1b..707f2534106 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h @@ -121,14 +121,14 @@ int32_t GetDecimalTypePrecision(const std::shared_ptr& decimal_ /// Parse a string value to a boolean. /// \param value the value to be parsed. /// \return the parsed valued. -boost::optional AsBool(const std::string& value); +std::optional AsBool(const std::string& value); /// Looks up for a value inside the ConnPropertyMap and then try to parse it. /// In case it does not find or it cannot parse, the default value will be returned. /// \param conn_property_map the map with the connection properties. /// \param property_name the name of the property that will be looked up. /// \return the parsed valued. -boost::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, +std::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, const std::string_view& property_name); /// Looks up for a value inside the ConnPropertyMap and then try to parse it. @@ -139,7 +139,7 @@ boost::optional AsBool(const Connection::ConnPropertyMap& conn_property_ma /// looked up. \return the parsed valued. \exception /// std::invalid_argument exception from std::stoi \exception /// std::out_of_range exception from std::stoi -boost::optional AsInt32(int32_t min_value, +std::optional AsInt32(int32_t min_value, const Connection::ConnPropertyMap& conn_property_map, const std::string_view& property_name); From 706bec528cb4d7e6033fac98787a94f18f906f7e Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 2 Oct 2025 10:48:03 -0700 Subject: [PATCH 2/4] Fix code formatting --- cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc index 37cd4a3da97..9467e2acf1d 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc @@ -1120,7 +1120,7 @@ std::optional AsBool(const std::string& value) { } std::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, - const std::string_view& property_name) { + const std::string_view& property_name) { auto extracted_property = conn_property_map.find(std::string(property_name)); if (extracted_property != conn_property_map.end()) { @@ -1131,8 +1131,8 @@ std::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, } std::optional AsInt32(int32_t min_value, - const Connection::ConnPropertyMap& conn_property_map, - const std::string_view& property_name) { + const Connection::ConnPropertyMap& conn_property_map, + const std::string_view& property_name) { auto extracted_property = conn_property_map.find(std::string(property_name)); if (extracted_property != conn_property_map.end()) { From 986395dd70a40747e4e32c3e81d5b5ef7eed3bda Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 2 Oct 2025 11:29:59 -0700 Subject: [PATCH 3/4] More code formatting fixes --- cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h index 707f2534106..1c102d5552e 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h @@ -129,7 +129,7 @@ std::optional AsBool(const std::string& value); /// \param property_name the name of the property that will be looked up. /// \return the parsed valued. std::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, - const std::string_view& property_name); + const std::string_view& property_name); /// Looks up for a value inside the ConnPropertyMap and then try to parse it. /// In case it does not find or it cannot parse, the default value will be returned. @@ -140,8 +140,8 @@ std::optional AsBool(const Connection::ConnPropertyMap& conn_property_map, /// std::invalid_argument exception from std::stoi \exception /// std::out_of_range exception from std::stoi std::optional AsInt32(int32_t min_value, - const Connection::ConnPropertyMap& conn_property_map, - const std::string_view& property_name); + const Connection::ConnPropertyMap& conn_property_map, + const std::string_view& property_name); } // namespace util } // namespace arrow::flight::sql::odbc From a754c5277522e90367757ebbd45c0ebd1a4d6d2c Mon Sep 17 00:00:00 2001 From: "Alina (Xi) Li" Date: Thu, 2 Oct 2025 11:53:53 -0700 Subject: [PATCH 4/4] Attempt to fix build issue --- cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h b/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h index 4e19c95a5cb..e9817fa2387 100644 --- a/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h +++ b/cpp/src/arrow/flight/sql/odbc/odbc_impl/types.h @@ -17,6 +17,7 @@ #pragma once +#include #include #include "arrow/flight/sql/odbc/odbc_impl/platform.h"