Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ class UserPasswordAuthMethod : public FlightSqlAuthMethod {
FlightCallOptions auth_call_options;
const std::optional<Connection::Attribute>& login_timeout =
connection.GetAttribute(Connection::LOGIN_TIMEOUT);
if (login_timeout && boost::get<uint32_t>(*login_timeout) > 0) {
if (login_timeout && std::get<uint32_t>(*login_timeout) > 0) {
// ODBC's LOGIN_TIMEOUT attribute and FlightCallOptions.timeout use
// seconds as time unit.
double timeout_seconds = static_cast<double>(boost::get<uint32_t>(*login_timeout));
double timeout_seconds = static_cast<double>(std::get<uint32_t>(*login_timeout));
if (timeout_seconds > 0) {
auth_call_options.timeout = TimeoutDuration{timeout_seconds};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ const FlightCallOptions& FlightSqlConnection::PopulateCallOptions(
// is the first request.
const std::optional<Connection::Attribute>& connection_timeout =
closed_ ? GetAttribute(LOGIN_TIMEOUT) : GetAttribute(CONNECTION_TIMEOUT);
if (connection_timeout && boost::get<uint32_t>(*connection_timeout) > 0) {
if (connection_timeout && std::get<uint32_t>(*connection_timeout) > 0) {
call_options_.timeout =
TimeoutDuration{static_cast<double>(boost::get<uint32_t>(*connection_timeout))};
TimeoutDuration{static_cast<double>(std::get<uint32_t>(*connection_timeout))};
}

for (auto prop : props) {
Expand Down Expand Up @@ -416,7 +416,7 @@ Connection::Info FlightSqlConnection::GetInfo(uint16_t info_type) {
if (info_type == SQL_DBMS_NAME || info_type == SQL_SERVER_NAME) {
// Update the database component reported in error messages.
// We do this lazily for performance reasons.
diagnostics_.SetDataSourceComponent(boost::get<std::string>(result));
diagnostics_.SetDataSourceComponent(std::get<std::string>(result));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ TEST(AttributeTests, SetAndGetAttribute) {

EXPECT_TRUE(first_value);

EXPECT_EQ(boost::get<uint32_t>(*first_value), static_cast<uint32_t>(200));
EXPECT_EQ(std::get<uint32_t>(*first_value), static_cast<uint32_t>(200));

connection.SetAttribute(Connection::CONNECTION_TIMEOUT, static_cast<uint32_t>(300));

const std::optional<Connection::Attribute> change_value =
connection.GetAttribute(Connection::CONNECTION_TIMEOUT);

EXPECT_TRUE(change_value);
EXPECT_EQ(boost::get<uint32_t>(*change_value), static_cast<uint32_t>(300));
EXPECT_EQ(std::get<uint32_t>(*change_value), static_cast<uint32_t>(300));

connection.Close();
}
Expand All @@ -58,7 +58,7 @@ TEST(AttributeTests, GetAttributeWithoutSetting) {
connection.GetAttribute(Connection::CONNECTION_TIMEOUT);
connection.SetClosed(false);

EXPECT_EQ(0, boost::get<uint32_t>(*optional));
EXPECT_EQ(0, std::get<uint32_t>(*optional));

connection.Close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ bool FlightSqlStatement::SetAttribute(StatementAttributeId attribute,
case MAX_LENGTH:
return CheckIfSetToOnlyValidValue(value, static_cast<size_t>(0));
case QUERY_TIMEOUT:
if (boost::get<size_t>(value) > 0) {
if (std::get<size_t>(value) > 0) {
call_options_.timeout =
TimeoutDuration{static_cast<double>(boost::get<size_t>(value))};
TimeoutDuration{static_cast<double>(std::get<size_t>(value))};
} else {
call_options_.timeout = TimeoutDuration{-1};
// Intentional fall-through.
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ SQLRETURN ODBCConnection::GetInfo(SQLUSMALLINT info_type, SQLPOINTER value,
case SQL_SPECIAL_CHARACTERS:
case SQL_XOPEN_CLI_YEAR: {
const auto& info = spi_connection_->GetInfo(info_type);
const std::string& info_value = boost::get<std::string>(info);
const std::string& info_value = std::get<std::string>(info);
return GetStringAttribute(is_unicode, info_value, true, value, buffer_length,
output_length, GetDiagnostics());
}
Expand Down Expand Up @@ -349,7 +349,7 @@ SQLRETURN ODBCConnection::GetInfo(SQLUSMALLINT info_type, SQLPOINTER value,
case SQL_SQL92_VALUE_EXPRESSIONS:
case SQL_STANDARD_CLI_CONFORMANCE: {
const auto& info = spi_connection_->GetInfo(info_type);
uint32_t info_value = boost::get<uint32_t>(info);
uint32_t info_value = std::get<uint32_t>(info);
GetAttribute(info_value, value, buffer_length, output_length);
return SQL_SUCCESS;
}
Expand Down Expand Up @@ -384,7 +384,7 @@ SQLRETURN ODBCConnection::GetInfo(SQLUSMALLINT info_type, SQLPOINTER value,
case SQL_ODBC_SQL_CONFORMANCE:
case SQL_ODBC_SAG_CLI_CONFORMANCE: {
const auto& info = spi_connection_->GetInfo(info_type);
uint16_t info_value = boost::get<uint16_t>(info);
uint16_t info_value = std::get<uint16_t>(info);
GetAttribute(info_value, value, buffer_length, output_length);
return SQL_SUCCESS;
}
Expand All @@ -395,7 +395,7 @@ SQLRETURN ODBCConnection::GetInfo(SQLUSMALLINT info_type, SQLPOINTER value,
if (!attr) {
throw DriverException("Optional feature not supported.", "HYC00");
}
const std::string& info_value = boost::get<std::string>(*attr);
const std::string& info_value = std::get<std::string>(*attr);
return GetStringAttribute(is_unicode, info_value, true, value, buffer_length,
output_length, GetDiagnostics());
}
Expand Down Expand Up @@ -591,7 +591,7 @@ SQLRETURN ODBCConnection::GetConnectAttr(SQLINTEGER attribute, SQLPOINTER value,
if (!catalog) {
throw DriverException("Optional feature not supported.", "HYC00");
}
const std::string& info_value = boost::get<std::string>(*catalog);
const std::string& info_value = std::get<std::string>(*catalog);
return GetStringAttribute(is_unicode, info_value, true, value, buffer_length,
output_length, GetDiagnostics());
}
Expand Down Expand Up @@ -620,7 +620,7 @@ SQLRETURN ODBCConnection::GetConnectAttr(SQLINTEGER attribute, SQLPOINTER value,
throw DriverException("Invalid attribute", "HY092");
}

GetAttribute(static_cast<SQLUINTEGER>(boost::get<uint32_t>(*spi_attribute)), value,
GetAttribute(static_cast<SQLUINTEGER>(std::get<uint32_t>(*spi_attribute)), value,
buffer_length, output_length);
return SQL_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void ODBCStatement::GetStmtAttr(SQLINTEGER statement_attribute, SQLPOINTER outpu
}

if (spi_attribute) {
GetAttribute(static_cast<SQLULEN>(boost::get<size_t>(*spi_attribute)), output,
GetAttribute(static_cast<SQLULEN>(std::get<size_t>(*spi_attribute)), output,
buffer_size, str_len_ptr);
return;
}
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <map>
#include <optional>
#include <string>
#include <variant>
#include <vector>

#include "arrow/flight/sql/odbc/odbc_impl/diagnostics.h"
Expand Down Expand Up @@ -61,8 +62,8 @@ class Connection {
PACKET_SIZE, // uint32_t - The Packet Size
};

typedef boost::variant<std::string, void*, uint64_t, uint32_t> Attribute;
typedef boost::variant<std::string, uint32_t, uint16_t> Info;
typedef std::variant<std::string, void*, uint64_t, uint32_t> Attribute;
typedef std::variant<std::string, uint32_t, uint16_t> Info;
typedef PropertyMap ConnPropertyMap;

/// \brief Establish the connection.
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#pragma once

#include <boost/variant.hpp>
#include <map>
#include <optional>
#include <variant>
#include <vector>

namespace arrow::flight::sql::odbc {
Expand Down Expand Up @@ -51,7 +51,7 @@ class Statement {
// have no timeout.
};

typedef boost::variant<size_t> Attribute;
typedef std::variant<size_t> Attribute;

/// \brief Set a statement attribute (may be called at any time)
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ std::string TestConnection(
// This should have been checked before enabling the Test button.
assert(missing_properties.empty());
std::string server_name =
boost::get<std::string>(flight_sql_conn->GetInfo(SQL_SERVER_NAME));
std::get<std::string>(flight_sql_conn->GetInfo(SQL_SERVER_NAME));
std::string server_version =
boost::get<std::string>(flight_sql_conn->GetInfo(SQL_DBMS_VER));
std::get<std::string>(flight_sql_conn->GetInfo(SQL_DBMS_VER));
return "Server Name: " + server_name + "\n" + "Server Version: " + server_version;
}
} // namespace
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/flight/sql/odbc/odbc_impl/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ inline void ThrowIfNotOK(const arrow::Status& status) {

template <typename T, typename AttributeTypeT>
inline bool CheckIfSetToOnlyValidValue(const AttributeTypeT& value, T allowed_value) {
return boost::get<T>(value) == allowed_value;
return std::get<T>(value) == allowed_value;
}

template <typename BUILDER, typename T>
Expand Down
2 changes: 0 additions & 2 deletions cpp/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
"boost-filesystem",
"boost-locale",
"boost-multiprecision",
"boost-optional",
"boost-process",
"boost-system",
"boost-variant",
"boost-xpressive",
"brotli",
"bzip2",
Expand Down
Loading