From 89e90c8fe7b4f42080099ec26bf8603ecb0036c7 Mon Sep 17 00:00:00 2001 From: Neil Chao Date: Thu, 20 Feb 2025 15:14:18 -0800 Subject: [PATCH] Remove variant thrift members and regenerate --- cpp/src/generated/parquet_types.cpp | 44 ++++++++--------------------- cpp/src/generated/parquet_types.h | 16 ++++------- cpp/src/generated/parquet_types.tcc | 37 +----------------------- cpp/src/parquet/parquet.thrift | 2 -- 4 files changed, 18 insertions(+), 81 deletions(-) diff --git a/cpp/src/generated/parquet_types.cpp b/cpp/src/generated/parquet_types.cpp index 8dbd50fab9b85..30b4afd917671 100644 --- a/cpp/src/generated/parquet_types.cpp +++ b/cpp/src/generated/parquet_types.cpp @@ -1792,17 +1792,7 @@ void BsonType::printTo(std::ostream& out) const { VariantType::~VariantType() noexcept { } -VariantType::VariantType() noexcept - : metadata(), - value() { -} - -void VariantType::__set_metadata(const std::string& val) { - this->metadata = val; -} - -void VariantType::__set_value(const std::string& val) { - this->value = val; +VariantType::VariantType() noexcept { } std::ostream& operator<<(std::ostream& out, const VariantType& obj) { @@ -1813,42 +1803,32 @@ std::ostream& operator<<(std::ostream& out, const VariantType& obj) void swap(VariantType &a, VariantType &b) { using ::std::swap; - swap(a.metadata, b.metadata); - swap(a.value, b.value); + (void) a; + (void) b; } -bool VariantType::operator==(const VariantType & rhs) const +bool VariantType::operator==(const VariantType & /* rhs */) const { - if (!(metadata == rhs.metadata)) - return false; - if (!(value == rhs.value)) - return false; return true; } -VariantType::VariantType(const VariantType& other92) { - metadata = other92.metadata; - value = other92.value; +VariantType::VariantType(const VariantType& other92) noexcept { + (void) other92; } VariantType::VariantType(VariantType&& other93) noexcept { - metadata = std::move(other93.metadata); - value = std::move(other93.value); + (void) other93; } -VariantType& VariantType::operator=(const VariantType& other94) { - metadata = other94.metadata; - value = other94.value; +VariantType& VariantType::operator=(const VariantType& other94) noexcept { + (void) other94; return *this; } VariantType& VariantType::operator=(VariantType&& other95) noexcept { - metadata = std::move(other95.metadata); - value = std::move(other95.value); + (void) other95; return *this; } void VariantType::printTo(std::ostream& out) const { using ::apache::thrift::to_string; out << "VariantType("; - out << "metadata=" << to_string(metadata); - out << ", " << "value=" << to_string(value); out << ")"; } @@ -2025,7 +2005,7 @@ bool LogicalType::operator==(const LogicalType & rhs) const return true; } -LogicalType::LogicalType(const LogicalType& other96) { +LogicalType::LogicalType(const LogicalType& other96) noexcept { STRING = other96.STRING; MAP = other96.MAP; LIST = other96.LIST; @@ -2061,7 +2041,7 @@ LogicalType::LogicalType(LogicalType&& other97) noexcept { VARIANT = std::move(other97.VARIANT); __isset = other97.__isset; } -LogicalType& LogicalType::operator=(const LogicalType& other98) { +LogicalType& LogicalType::operator=(const LogicalType& other98) noexcept { STRING = other98.STRING; MAP = other98.MAP; LIST = other98.LIST; diff --git a/cpp/src/generated/parquet_types.h b/cpp/src/generated/parquet_types.h index c31a57ebd03ea..e3fe39595427c 100644 --- a/cpp/src/generated/parquet_types.h +++ b/cpp/src/generated/parquet_types.h @@ -1311,21 +1311,15 @@ std::ostream& operator<<(std::ostream& out, const BsonType& obj); class VariantType { public: - VariantType(const VariantType&); + VariantType(const VariantType&) noexcept; VariantType(VariantType&&) noexcept; - VariantType& operator=(const VariantType&); + VariantType& operator=(const VariantType&) noexcept; VariantType& operator=(VariantType&&) noexcept; VariantType() noexcept; virtual ~VariantType() noexcept; - std::string metadata; - std::string value; - - void __set_metadata(const std::string& val); - - void __set_value(const std::string& val); - bool operator == (const VariantType & rhs) const; + bool operator == (const VariantType & /* rhs */) const; bool operator != (const VariantType &rhs) const { return !(*this == rhs); } @@ -1373,9 +1367,9 @@ typedef struct _LogicalType__isset { class LogicalType { public: - LogicalType(const LogicalType&); + LogicalType(const LogicalType&) noexcept; LogicalType(LogicalType&&) noexcept; - LogicalType& operator=(const LogicalType&); + LogicalType& operator=(const LogicalType&) noexcept; LogicalType& operator=(LogicalType&&) noexcept; LogicalType() noexcept; diff --git a/cpp/src/generated/parquet_types.tcc b/cpp/src/generated/parquet_types.tcc index 498c29e0463fa..2d881af62b3c4 100644 --- a/cpp/src/generated/parquet_types.tcc +++ b/cpp/src/generated/parquet_types.tcc @@ -1201,8 +1201,6 @@ uint32_t VariantType::read(Protocol_* iprot) { using ::apache::thrift::protocol::TProtocolException; - bool isset_metadata = false; - bool isset_value = false; while (true) { @@ -1210,37 +1208,12 @@ uint32_t VariantType::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_STOP) { break; } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->metadata); - isset_metadata = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->value); - isset_value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } + xfer += iprot->skip(ftype); xfer += iprot->readFieldEnd(); } xfer += iprot->readStructEnd(); - if (!isset_metadata) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_value) - throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1250,14 +1223,6 @@ uint32_t VariantType::write(Protocol_* oprot) const { ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); xfer += oprot->writeStructBegin("VariantType"); - xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeBinary(this->metadata); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->value); - xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; diff --git a/cpp/src/parquet/parquet.thrift b/cpp/src/parquet/parquet.thrift index e8643e4c10614..d51e2d9652ef5 100644 --- a/cpp/src/parquet/parquet.thrift +++ b/cpp/src/parquet/parquet.thrift @@ -380,8 +380,6 @@ struct BsonType { * Allowed for physical types: BINARY */ struct VariantType { - 1: required binary metadata - 2: required binary value } /**