diff --git a/cpp/src/generated/parquet_types.cpp b/cpp/src/generated/parquet_types.cpp index 0ee973f2a2d6..e125a911ea0c 100644 --- a/cpp/src/generated/parquet_types.cpp +++ b/cpp/src/generated/parquet_types.cpp @@ -5286,6 +5286,50 @@ void AesGcmCtrV1::printTo(std::ostream& out) const { } +ExternalDBPAV1::~ExternalDBPAV1() noexcept { +} + +ExternalDBPAV1::ExternalDBPAV1() noexcept { +} +std::ostream& operator<<(std::ostream& out, const ExternalDBPAV1& obj) +{ + obj.printTo(out); + return out; +} + + +void swap(ExternalDBPAV1 &a, ExternalDBPAV1 &b) { + using ::std::swap; + (void) a; + (void) b; +} + +bool ExternalDBPAV1::operator==(const ExternalDBPAV1 & /* rhs */) const +{ + return true; +} + +ExternalDBPAV1::ExternalDBPAV1(const ExternalDBPAV1& other344) noexcept { + (void) other344; +} +ExternalDBPAV1::ExternalDBPAV1(ExternalDBPAV1&& other345) noexcept { + (void) other345; +} +ExternalDBPAV1& ExternalDBPAV1::operator=(const ExternalDBPAV1& other346) noexcept { + (void) other346; + return *this; +} +ExternalDBPAV1& ExternalDBPAV1::operator=(ExternalDBPAV1&& other347) noexcept { + (void) other347; + return *this; +} +void ExternalDBPAV1::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "ExternalDBPAV1("; + out << ")"; +} + + EncryptionAlgorithm::~EncryptionAlgorithm() noexcept { } @@ -5301,6 +5345,11 @@ void EncryptionAlgorithm::__set_AES_GCM_CTR_V1(const AesGcmCtrV1& val) { this->AES_GCM_CTR_V1 = val; __isset.AES_GCM_CTR_V1 = true; } + +void EncryptionAlgorithm::__set_EXTERNAL_DBPA_V1(const ExternalDBPAV1& val) { + this->EXTERNAL_DBPA_V1 = val; +__isset.EXTERNAL_DBPA_V1 = true; +} std::ostream& operator<<(std::ostream& out, const EncryptionAlgorithm& obj) { obj.printTo(out); @@ -5312,6 +5361,7 @@ void swap(EncryptionAlgorithm &a, EncryptionAlgorithm &b) { using ::std::swap; swap(a.AES_GCM_V1, b.AES_GCM_V1); swap(a.AES_GCM_CTR_V1, b.AES_GCM_CTR_V1); + swap(a.EXTERNAL_DBPA_V1, b.EXTERNAL_DBPA_V1); swap(a.__isset, b.__isset); } @@ -5325,29 +5375,37 @@ bool EncryptionAlgorithm::operator==(const EncryptionAlgorithm & rhs) const return false; else if (__isset.AES_GCM_CTR_V1 && !(AES_GCM_CTR_V1 == rhs.AES_GCM_CTR_V1)) return false; + if (__isset.EXTERNAL_DBPA_V1 != rhs.__isset.EXTERNAL_DBPA_V1) + return false; + else if (__isset.EXTERNAL_DBPA_V1 && !(EXTERNAL_DBPA_V1 == rhs.EXTERNAL_DBPA_V1)) + return false; return true; } -EncryptionAlgorithm::EncryptionAlgorithm(const EncryptionAlgorithm& other344) { - AES_GCM_V1 = other344.AES_GCM_V1; - AES_GCM_CTR_V1 = other344.AES_GCM_CTR_V1; - __isset = other344.__isset; +EncryptionAlgorithm::EncryptionAlgorithm(const EncryptionAlgorithm& other348) { + AES_GCM_V1 = other348.AES_GCM_V1; + AES_GCM_CTR_V1 = other348.AES_GCM_CTR_V1; + EXTERNAL_DBPA_V1 = other348.EXTERNAL_DBPA_V1; + __isset = other348.__isset; } -EncryptionAlgorithm::EncryptionAlgorithm(EncryptionAlgorithm&& other345) noexcept { - AES_GCM_V1 = std::move(other345.AES_GCM_V1); - AES_GCM_CTR_V1 = std::move(other345.AES_GCM_CTR_V1); - __isset = other345.__isset; +EncryptionAlgorithm::EncryptionAlgorithm(EncryptionAlgorithm&& other349) noexcept { + AES_GCM_V1 = std::move(other349.AES_GCM_V1); + AES_GCM_CTR_V1 = std::move(other349.AES_GCM_CTR_V1); + EXTERNAL_DBPA_V1 = std::move(other349.EXTERNAL_DBPA_V1); + __isset = other349.__isset; } -EncryptionAlgorithm& EncryptionAlgorithm::operator=(const EncryptionAlgorithm& other346) { - AES_GCM_V1 = other346.AES_GCM_V1; - AES_GCM_CTR_V1 = other346.AES_GCM_CTR_V1; - __isset = other346.__isset; +EncryptionAlgorithm& EncryptionAlgorithm::operator=(const EncryptionAlgorithm& other350) { + AES_GCM_V1 = other350.AES_GCM_V1; + AES_GCM_CTR_V1 = other350.AES_GCM_CTR_V1; + EXTERNAL_DBPA_V1 = other350.EXTERNAL_DBPA_V1; + __isset = other350.__isset; return *this; } -EncryptionAlgorithm& EncryptionAlgorithm::operator=(EncryptionAlgorithm&& other347) noexcept { - AES_GCM_V1 = std::move(other347.AES_GCM_V1); - AES_GCM_CTR_V1 = std::move(other347.AES_GCM_CTR_V1); - __isset = other347.__isset; +EncryptionAlgorithm& EncryptionAlgorithm::operator=(EncryptionAlgorithm&& other351) noexcept { + AES_GCM_V1 = std::move(other351.AES_GCM_V1); + AES_GCM_CTR_V1 = std::move(other351.AES_GCM_CTR_V1); + EXTERNAL_DBPA_V1 = std::move(other351.EXTERNAL_DBPA_V1); + __isset = other351.__isset; return *this; } void EncryptionAlgorithm::printTo(std::ostream& out) const { @@ -5355,6 +5413,7 @@ void EncryptionAlgorithm::printTo(std::ostream& out) const { out << "EncryptionAlgorithm("; out << "AES_GCM_V1="; (__isset.AES_GCM_V1 ? (out << to_string(AES_GCM_V1)) : (out << "")); out << ", " << "AES_GCM_CTR_V1="; (__isset.AES_GCM_CTR_V1 ? (out << to_string(AES_GCM_CTR_V1)) : (out << "")); + out << ", " << "EXTERNAL_DBPA_V1="; (__isset.EXTERNAL_DBPA_V1 ? (out << to_string(EXTERNAL_DBPA_V1)) : (out << "")); out << ")"; } @@ -5463,54 +5522,54 @@ bool FileMetaData::operator==(const FileMetaData & rhs) const return true; } -FileMetaData::FileMetaData(const FileMetaData& other372) { - version = other372.version; - schema = other372.schema; - num_rows = other372.num_rows; - row_groups = other372.row_groups; - key_value_metadata = other372.key_value_metadata; - created_by = other372.created_by; - column_orders = other372.column_orders; - encryption_algorithm = other372.encryption_algorithm; - footer_signing_key_metadata = other372.footer_signing_key_metadata; - __isset = other372.__isset; -} -FileMetaData::FileMetaData(FileMetaData&& other373) noexcept { - version = other373.version; - schema = std::move(other373.schema); - num_rows = other373.num_rows; - row_groups = std::move(other373.row_groups); - key_value_metadata = std::move(other373.key_value_metadata); - created_by = std::move(other373.created_by); - column_orders = std::move(other373.column_orders); - encryption_algorithm = std::move(other373.encryption_algorithm); - footer_signing_key_metadata = std::move(other373.footer_signing_key_metadata); - __isset = other373.__isset; -} -FileMetaData& FileMetaData::operator=(const FileMetaData& other374) { - version = other374.version; - schema = other374.schema; - num_rows = other374.num_rows; - row_groups = other374.row_groups; - key_value_metadata = other374.key_value_metadata; - created_by = other374.created_by; - column_orders = other374.column_orders; - encryption_algorithm = other374.encryption_algorithm; - footer_signing_key_metadata = other374.footer_signing_key_metadata; - __isset = other374.__isset; +FileMetaData::FileMetaData(const FileMetaData& other376) { + version = other376.version; + schema = other376.schema; + num_rows = other376.num_rows; + row_groups = other376.row_groups; + key_value_metadata = other376.key_value_metadata; + created_by = other376.created_by; + column_orders = other376.column_orders; + encryption_algorithm = other376.encryption_algorithm; + footer_signing_key_metadata = other376.footer_signing_key_metadata; + __isset = other376.__isset; +} +FileMetaData::FileMetaData(FileMetaData&& other377) noexcept { + version = other377.version; + schema = std::move(other377.schema); + num_rows = other377.num_rows; + row_groups = std::move(other377.row_groups); + key_value_metadata = std::move(other377.key_value_metadata); + created_by = std::move(other377.created_by); + column_orders = std::move(other377.column_orders); + encryption_algorithm = std::move(other377.encryption_algorithm); + footer_signing_key_metadata = std::move(other377.footer_signing_key_metadata); + __isset = other377.__isset; +} +FileMetaData& FileMetaData::operator=(const FileMetaData& other378) { + version = other378.version; + schema = other378.schema; + num_rows = other378.num_rows; + row_groups = other378.row_groups; + key_value_metadata = other378.key_value_metadata; + created_by = other378.created_by; + column_orders = other378.column_orders; + encryption_algorithm = other378.encryption_algorithm; + footer_signing_key_metadata = other378.footer_signing_key_metadata; + __isset = other378.__isset; return *this; } -FileMetaData& FileMetaData::operator=(FileMetaData&& other375) noexcept { - version = other375.version; - schema = std::move(other375.schema); - num_rows = other375.num_rows; - row_groups = std::move(other375.row_groups); - key_value_metadata = std::move(other375.key_value_metadata); - created_by = std::move(other375.created_by); - column_orders = std::move(other375.column_orders); - encryption_algorithm = std::move(other375.encryption_algorithm); - footer_signing_key_metadata = std::move(other375.footer_signing_key_metadata); - __isset = other375.__isset; +FileMetaData& FileMetaData::operator=(FileMetaData&& other379) noexcept { + version = other379.version; + schema = std::move(other379.schema); + num_rows = other379.num_rows; + row_groups = std::move(other379.row_groups); + key_value_metadata = std::move(other379.key_value_metadata); + created_by = std::move(other379.created_by); + column_orders = std::move(other379.column_orders); + encryption_algorithm = std::move(other379.encryption_algorithm); + footer_signing_key_metadata = std::move(other379.footer_signing_key_metadata); + __isset = other379.__isset; return *this; } void FileMetaData::printTo(std::ostream& out) const { @@ -5569,26 +5628,26 @@ bool FileCryptoMetaData::operator==(const FileCryptoMetaData & rhs) const return true; } -FileCryptoMetaData::FileCryptoMetaData(const FileCryptoMetaData& other376) { - encryption_algorithm = other376.encryption_algorithm; - key_metadata = other376.key_metadata; - __isset = other376.__isset; +FileCryptoMetaData::FileCryptoMetaData(const FileCryptoMetaData& other380) { + encryption_algorithm = other380.encryption_algorithm; + key_metadata = other380.key_metadata; + __isset = other380.__isset; } -FileCryptoMetaData::FileCryptoMetaData(FileCryptoMetaData&& other377) noexcept { - encryption_algorithm = std::move(other377.encryption_algorithm); - key_metadata = std::move(other377.key_metadata); - __isset = other377.__isset; +FileCryptoMetaData::FileCryptoMetaData(FileCryptoMetaData&& other381) noexcept { + encryption_algorithm = std::move(other381.encryption_algorithm); + key_metadata = std::move(other381.key_metadata); + __isset = other381.__isset; } -FileCryptoMetaData& FileCryptoMetaData::operator=(const FileCryptoMetaData& other378) { - encryption_algorithm = other378.encryption_algorithm; - key_metadata = other378.key_metadata; - __isset = other378.__isset; +FileCryptoMetaData& FileCryptoMetaData::operator=(const FileCryptoMetaData& other382) { + encryption_algorithm = other382.encryption_algorithm; + key_metadata = other382.key_metadata; + __isset = other382.__isset; return *this; } -FileCryptoMetaData& FileCryptoMetaData::operator=(FileCryptoMetaData&& other379) noexcept { - encryption_algorithm = std::move(other379.encryption_algorithm); - key_metadata = std::move(other379.key_metadata); - __isset = other379.__isset; +FileCryptoMetaData& FileCryptoMetaData::operator=(FileCryptoMetaData&& other383) noexcept { + encryption_algorithm = std::move(other383.encryption_algorithm); + key_metadata = std::move(other383.key_metadata); + __isset = other383.__isset; return *this; } void FileCryptoMetaData::printTo(std::ostream& out) const { diff --git a/cpp/src/generated/parquet_types.h b/cpp/src/generated/parquet_types.h index 1f1e254f5cf2..31ca1cf11577 100644 --- a/cpp/src/generated/parquet_types.h +++ b/cpp/src/generated/parquet_types.h @@ -477,6 +477,8 @@ class AesGcmV1; class AesGcmCtrV1; +class ExternalDBPAV1; + class EncryptionAlgorithm; class FileMetaData; @@ -3663,10 +3665,42 @@ void swap(AesGcmCtrV1 &a, AesGcmCtrV1 &b); std::ostream& operator<<(std::ostream& out, const AesGcmCtrV1& obj); + +class ExternalDBPAV1 { + public: + + ExternalDBPAV1(const ExternalDBPAV1&) noexcept; + ExternalDBPAV1(ExternalDBPAV1&&) noexcept; + ExternalDBPAV1& operator=(const ExternalDBPAV1&) noexcept; + ExternalDBPAV1& operator=(ExternalDBPAV1&&) noexcept; + ExternalDBPAV1() noexcept; + + virtual ~ExternalDBPAV1() noexcept; + + bool operator == (const ExternalDBPAV1 & /* rhs */) const; + bool operator != (const ExternalDBPAV1 &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ExternalDBPAV1 & ) const; + + template + uint32_t read(Protocol_* iprot); + template + uint32_t write(Protocol_* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(ExternalDBPAV1 &a, ExternalDBPAV1 &b); + +std::ostream& operator<<(std::ostream& out, const ExternalDBPAV1& obj); + typedef struct _EncryptionAlgorithm__isset { - _EncryptionAlgorithm__isset() : AES_GCM_V1(false), AES_GCM_CTR_V1(false) {} + _EncryptionAlgorithm__isset() : AES_GCM_V1(false), AES_GCM_CTR_V1(false), EXTERNAL_DBPA_V1(false) {} bool AES_GCM_V1 :1; bool AES_GCM_CTR_V1 :1; + bool EXTERNAL_DBPA_V1 :1; } _EncryptionAlgorithm__isset; class EncryptionAlgorithm { @@ -3681,6 +3715,7 @@ class EncryptionAlgorithm { virtual ~EncryptionAlgorithm() noexcept; AesGcmV1 AES_GCM_V1; AesGcmCtrV1 AES_GCM_CTR_V1; + ExternalDBPAV1 EXTERNAL_DBPA_V1; _EncryptionAlgorithm__isset __isset; @@ -3688,6 +3723,8 @@ class EncryptionAlgorithm { void __set_AES_GCM_CTR_V1(const AesGcmCtrV1& val); + void __set_EXTERNAL_DBPA_V1(const ExternalDBPAV1& val); + bool operator == (const EncryptionAlgorithm & rhs) const; bool operator != (const EncryptionAlgorithm &rhs) const { return !(*this == rhs); diff --git a/cpp/src/generated/parquet_types.tcc b/cpp/src/generated/parquet_types.tcc index 78e3e2549394..37b45881c22e 100644 --- a/cpp/src/generated/parquet_types.tcc +++ b/cpp/src/generated/parquet_types.tcc @@ -4957,6 +4957,46 @@ uint32_t AesGcmCtrV1::write(Protocol_* oprot) const { return xfer; } +template +uint32_t ExternalDBPAV1::read(Protocol_* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +template +uint32_t ExternalDBPAV1::write(Protocol_* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ExternalDBPAV1"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + template uint32_t EncryptionAlgorithm::read(Protocol_* iprot) { @@ -4995,6 +5035,14 @@ uint32_t EncryptionAlgorithm::read(Protocol_* iprot) { xfer += iprot->skip(ftype); } break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->EXTERNAL_DBPA_V1.read(iprot); + this->__isset.EXTERNAL_DBPA_V1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -5023,6 +5071,11 @@ uint32_t EncryptionAlgorithm::write(Protocol_* oprot) const { xfer += this->AES_GCM_CTR_V1.write(oprot); xfer += oprot->writeFieldEnd(); } + if (this->__isset.EXTERNAL_DBPA_V1) { + xfer += oprot->writeFieldBegin("EXTERNAL_DBPA_V1", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->EXTERNAL_DBPA_V1.write(oprot); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -5066,14 +5119,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->schema.clear(); - uint32_t _size348; - ::apache::thrift::protocol::TType _etype351; - xfer += iprot->readListBegin(_etype351, _size348); - this->schema.resize(_size348); - uint32_t _i352; - for (_i352 = 0; _i352 < _size348; ++_i352) + uint32_t _size352; + ::apache::thrift::protocol::TType _etype355; + xfer += iprot->readListBegin(_etype355, _size352); + this->schema.resize(_size352); + uint32_t _i356; + for (_i356 = 0; _i356 < _size352; ++_i356) { - xfer += this->schema[_i352].read(iprot); + xfer += this->schema[_i356].read(iprot); } xfer += iprot->readListEnd(); } @@ -5094,14 +5147,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->row_groups.clear(); - uint32_t _size353; - ::apache::thrift::protocol::TType _etype356; - xfer += iprot->readListBegin(_etype356, _size353); - this->row_groups.resize(_size353); - uint32_t _i357; - for (_i357 = 0; _i357 < _size353; ++_i357) + uint32_t _size357; + ::apache::thrift::protocol::TType _etype360; + xfer += iprot->readListBegin(_etype360, _size357); + this->row_groups.resize(_size357); + uint32_t _i361; + for (_i361 = 0; _i361 < _size357; ++_i361) { - xfer += this->row_groups[_i357].read(iprot); + xfer += this->row_groups[_i361].read(iprot); } xfer += iprot->readListEnd(); } @@ -5114,14 +5167,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->key_value_metadata.clear(); - uint32_t _size358; - ::apache::thrift::protocol::TType _etype361; - xfer += iprot->readListBegin(_etype361, _size358); - this->key_value_metadata.resize(_size358); - uint32_t _i362; - for (_i362 = 0; _i362 < _size358; ++_i362) + uint32_t _size362; + ::apache::thrift::protocol::TType _etype365; + xfer += iprot->readListBegin(_etype365, _size362); + this->key_value_metadata.resize(_size362); + uint32_t _i366; + for (_i366 = 0; _i366 < _size362; ++_i366) { - xfer += this->key_value_metadata[_i362].read(iprot); + xfer += this->key_value_metadata[_i366].read(iprot); } xfer += iprot->readListEnd(); } @@ -5142,14 +5195,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->column_orders.clear(); - uint32_t _size363; - ::apache::thrift::protocol::TType _etype366; - xfer += iprot->readListBegin(_etype366, _size363); - this->column_orders.resize(_size363); - uint32_t _i367; - for (_i367 = 0; _i367 < _size363; ++_i367) + uint32_t _size367; + ::apache::thrift::protocol::TType _etype370; + xfer += iprot->readListBegin(_etype370, _size367); + this->column_orders.resize(_size367); + uint32_t _i371; + for (_i371 = 0; _i371 < _size367; ++_i371) { - xfer += this->column_orders[_i367].read(iprot); + xfer += this->column_orders[_i371].read(iprot); } xfer += iprot->readListEnd(); } @@ -5207,10 +5260,10 @@ uint32_t FileMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->schema.size())); - std::vector ::const_iterator _iter368; - for (_iter368 = this->schema.begin(); _iter368 != this->schema.end(); ++_iter368) + std::vector ::const_iterator _iter372; + for (_iter372 = this->schema.begin(); _iter372 != this->schema.end(); ++_iter372) { - xfer += (*_iter368).write(oprot); + xfer += (*_iter372).write(oprot); } xfer += oprot->writeListEnd(); } @@ -5223,10 +5276,10 @@ uint32_t FileMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("row_groups", ::apache::thrift::protocol::T_LIST, 4); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->row_groups.size())); - std::vector ::const_iterator _iter369; - for (_iter369 = this->row_groups.begin(); _iter369 != this->row_groups.end(); ++_iter369) + std::vector ::const_iterator _iter373; + for (_iter373 = this->row_groups.begin(); _iter373 != this->row_groups.end(); ++_iter373) { - xfer += (*_iter369).write(oprot); + xfer += (*_iter373).write(oprot); } xfer += oprot->writeListEnd(); } @@ -5236,10 +5289,10 @@ uint32_t FileMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("key_value_metadata", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->key_value_metadata.size())); - std::vector ::const_iterator _iter370; - for (_iter370 = this->key_value_metadata.begin(); _iter370 != this->key_value_metadata.end(); ++_iter370) + std::vector ::const_iterator _iter374; + for (_iter374 = this->key_value_metadata.begin(); _iter374 != this->key_value_metadata.end(); ++_iter374) { - xfer += (*_iter370).write(oprot); + xfer += (*_iter374).write(oprot); } xfer += oprot->writeListEnd(); } @@ -5254,10 +5307,10 @@ uint32_t FileMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("column_orders", ::apache::thrift::protocol::T_LIST, 7); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->column_orders.size())); - std::vector ::const_iterator _iter371; - for (_iter371 = this->column_orders.begin(); _iter371 != this->column_orders.end(); ++_iter371) + std::vector ::const_iterator _iter375; + for (_iter375 = this->column_orders.begin(); _iter375 != this->column_orders.end(); ++_iter375) { - xfer += (*_iter371).write(oprot); + xfer += (*_iter375).write(oprot); } xfer += oprot->writeListEnd(); } diff --git a/cpp/src/parquet/encryption/encryption_internal.cc b/cpp/src/parquet/encryption/encryption_internal.cc index 657198f1701a..a833941681cc 100644 --- a/cpp/src/parquet/encryption/encryption_internal.cc +++ b/cpp/src/parquet/encryption/encryption_internal.cc @@ -61,6 +61,11 @@ class AesCryptoContext { length_buffer_length_ = include_length ? kBufferSizeLength : 0; ciphertext_size_delta_ = length_buffer_length_ + kNonceLength; + if (ParquetCipher::EXTERNAL_DBPA_V1 == alg_id) { + std::stringstream ss; + ss << "ExternalDataBatchProtectionAgent (DBPA) algorithm is not yet implemented"; + throw ParquetException(ss.str()); + } if (ParquetCipher::AES_GCM_V1 != alg_id && ParquetCipher::AES_GCM_CTR_V1 != alg_id) { std::stringstream ss; ss << "Crypto algorithm " << alg_id << " is not supported"; diff --git a/cpp/src/parquet/encryption/write_configurations_test.cc b/cpp/src/parquet/encryption/write_configurations_test.cc index f27da8269487..b7f1d1a17158 100644 --- a/cpp/src/parquet/encryption/write_configurations_test.cc +++ b/cpp/src/parquet/encryption/write_configurations_test.cc @@ -223,6 +223,31 @@ TEST_F(TestEncryptionConfiguration, EncryptTwoColumnsAndFooterUseAES_GCM_CTR) { "tmp_encrypt_columns_and_footer_ctr.parquet.encrypted")); } +TEST_F(TestEncryptionConfiguration, EncryptOneColumnAndUseExternalDBPA) { + std::map> + encryption_cols; + parquet::ColumnEncryptionProperties::Builder encryption_col_builder( + path_to_double_field_); + encryption_col_builder.key(kColumnEncryptionKey1_)->key_id("kc1"); + + encryption_cols[path_to_double_field_] = encryption_col_builder.build(); + + parquet::FileEncryptionProperties::Builder file_encryption_builder( + kFooterEncryptionKey_); + + try { + this->EncryptFile(file_encryption_builder.footer_key_metadata("kf") + ->encrypted_columns(encryption_cols) + ->algorithm(parquet::ParquetCipher::EXTERNAL_DBPA_V1) + ->build(), + "tmp_encrypt_one_column_and_use_external_dbpa.parquet.encrypted"); + FAIL() << "Expected ParquetException was not thrown"; + } catch (const parquet::ParquetException& e) { + EXPECT_STREQ("ExternalDataBatchProtectionAgent (DBPA) algorithm is not yet implemented", + e.what()); + } +} + // Set temp_dir before running the write/read tests. The encrypted files will // be written/read from this directory. void TestEncryptionConfiguration::SetUpTestCase() { diff --git a/cpp/src/parquet/parquet.thrift b/cpp/src/parquet/parquet.thrift index e3cc5adb9648..1037b938a25a 100644 --- a/cpp/src/parquet/parquet.thrift +++ b/cpp/src/parquet/parquet.thrift @@ -1237,9 +1237,12 @@ struct AesGcmCtrV1 { 3: optional bool supply_aad_prefix } +struct ExternalDBPAV1 {} + union EncryptionAlgorithm { 1: AesGcmV1 AES_GCM_V1 2: AesGcmCtrV1 AES_GCM_CTR_V1 + 3: ExternalDBPAV1 EXTERNAL_DBPA_V1 } /** diff --git a/cpp/src/parquet/thrift_internal.h b/cpp/src/parquet/thrift_internal.h index e18fb36c02d5..5fe6b69846bc 100644 --- a/cpp/src/parquet/thrift_internal.h +++ b/cpp/src/parquet/thrift_internal.h @@ -241,6 +241,8 @@ static inline EncryptionAlgorithm FromThrift(format::EncryptionAlgorithm encrypt } else if (encryption.__isset.AES_GCM_CTR_V1) { encryption_algorithm.algorithm = ParquetCipher::AES_GCM_CTR_V1; encryption_algorithm.aad = FromThrift(encryption.AES_GCM_CTR_V1); + } else if (encryption.__isset.EXTERNAL_DBPA_V1) { + encryption_algorithm.algorithm = ParquetCipher::EXTERNAL_DBPA_V1; } else { throw ParquetException("Unsupported algorithm"); } @@ -382,12 +384,19 @@ static inline format::AesGcmCtrV1 ToAesGcmCtrV1Thrift(AadMetadata aad) { return aesGcmCtrV1; } +static inline format::ExternalDBPAV1 ToExternalDBPAV1Thrift() { + format::ExternalDBPAV1 externalDBPAV1; + return externalDBPAV1; +} + static inline format::EncryptionAlgorithm ToThrift(EncryptionAlgorithm encryption) { format::EncryptionAlgorithm encryption_algorithm; if (encryption.algorithm == ParquetCipher::AES_GCM_V1) { encryption_algorithm.__set_AES_GCM_V1(ToAesGcmV1Thrift(encryption.aad)); - } else { + } else if (encryption.algorithm == ParquetCipher::AES_GCM_CTR_V1) { encryption_algorithm.__set_AES_GCM_CTR_V1(ToAesGcmCtrV1Thrift(encryption.aad)); + } else { + encryption_algorithm.__set_EXTERNAL_DBPA_V1(ToExternalDBPAV1Thrift()); } return encryption_algorithm; } diff --git a/cpp/src/parquet/types.h b/cpp/src/parquet/types.h index 1ad6dc962861..61b35cfb46c2 100644 --- a/cpp/src/parquet/types.h +++ b/cpp/src/parquet/types.h @@ -518,7 +518,7 @@ PARQUET_EXPORT std::unique_ptr GetCodec(Compression::type codec, int compression_level); struct ParquetCipher { - enum type { AES_GCM_V1 = 0, AES_GCM_CTR_V1 = 1 }; + enum type { AES_GCM_V1 = 0, AES_GCM_CTR_V1 = 1, EXTERNAL_DBPA_V1 = 2 }; }; struct AadMetadata { diff --git a/python/pyarrow/_parquet.pxd b/python/pyarrow/_parquet.pxd index f7df8a052a1f..09ef69fbb51f 100644 --- a/python/pyarrow/_parquet.pxd +++ b/python/pyarrow/_parquet.pxd @@ -195,6 +195,7 @@ cdef extern from "parquet/api/schema.h" namespace "parquet" nogil: enum ParquetCipher" parquet::ParquetCipher::type": ParquetCipher_AES_GCM_V1" parquet::ParquetCipher::AES_GCM_V1" ParquetCipher_AES_GCM_CTR_V1" parquet::ParquetCipher::AES_GCM_CTR_V1" + ParquetCipher_EXTERNAL_DBPA_V1" parquet::ParquetCipher::EXTERNAL_DBPA_V1" struct AadMetadata: c_string aad_prefix diff --git a/python/pyarrow/_parquet_encryption.pxd b/python/pyarrow/_parquet_encryption.pxd index d52669501a40..721e8f74a8c4 100644 --- a/python/pyarrow/_parquet_encryption.pxd +++ b/python/pyarrow/_parquet_encryption.pxd @@ -26,7 +26,8 @@ from pyarrow._parquet cimport (ParquetCipher, FileEncryptionProperties, FileDecryptionProperties, ParquetCipher_AES_GCM_V1, - ParquetCipher_AES_GCM_CTR_V1) + ParquetCipher_AES_GCM_CTR_V1, + ParquetCipher_EXTERNAL_DBPA_V1) from pyarrow.lib cimport _Weakrefable cdef class CryptoFactory(_Weakrefable): diff --git a/python/pyarrow/_parquet_encryption.pyx b/python/pyarrow/_parquet_encryption.pyx index 81bd421dcbce..333ce8cf70d1 100644 --- a/python/pyarrow/_parquet_encryption.pyx +++ b/python/pyarrow/_parquet_encryption.pyx @@ -34,6 +34,8 @@ cdef ParquetCipher cipher_from_name(name): return ParquetCipher_AES_GCM_V1 elif name == 'AES_GCM_CTR_V1': return ParquetCipher_AES_GCM_CTR_V1 + elif name == 'EXTERNAL_DBPA_V1': + return ParquetCipher_EXTERNAL_DBPA_V1 else: raise ValueError(f'Invalid cipher name: {name!r}') @@ -43,6 +45,8 @@ cdef cipher_to_name(ParquetCipher cipher): return 'AES_GCM_V1' elif ParquetCipher_AES_GCM_CTR_V1 == cipher: return 'AES_GCM_CTR_V1' + elif ParquetCipher_EXTERNAL_DBPA_V1 == cipher: + return 'EXTERNAL_DBPA_V1' else: raise ValueError('Invalid cipher value: {0}'.format(cipher)) diff --git a/python/pyarrow/includes/libparquet_encryption.pxd b/python/pyarrow/includes/libparquet_encryption.pxd index 2b40414ce538..45d1d203a725 100644 --- a/python/pyarrow/includes/libparquet_encryption.pxd +++ b/python/pyarrow/includes/libparquet_encryption.pxd @@ -22,7 +22,8 @@ from pyarrow._parquet cimport (ParquetCipher, CFileEncryptionProperties, CFileDecryptionProperties, ParquetCipher_AES_GCM_V1, - ParquetCipher_AES_GCM_CTR_V1) + ParquetCipher_AES_GCM_CTR_V1, + ParquetCipher_EXTERNAL_DBPA_V1) cdef extern from "parquet/encryption/kms_client.h" \