diff --git a/cpp/src/generated/parquet_types.cpp b/cpp/src/generated/parquet_types.cpp index 1ba0c4626233f..f580c7905e8b4 100644 --- a/cpp/src/generated/parquet_types.cpp +++ b/cpp/src/generated/parquet_types.cpp @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.19.0) + * Autogenerated by Thrift Compiler (0.20.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -78,12 +78,12 @@ int _kConvertedTypeValues[] = { ConvertedType::ENUM, /** * A decimal value. - * + * * This may be used to annotate binary or fixed primitive types. The * underlying byte array stores the unscaled value encoded as two's * complement using big-endian byte order (the most significant byte is the * zeroth element). The value of the decimal is the value * 10^{-scale}. - * + * * This must be accompanied by a (maximum) precision and a scale in the * SchemaElement. The precision specifies the number of digits in the decimal * and the scale stores the location of the decimal point. For example 1.23 @@ -93,47 +93,47 @@ int _kConvertedTypeValues[] = { ConvertedType::DECIMAL, /** * A Date - * + * * Stored as days since Unix epoch, encoded as the INT32 physical type. - * + * */ ConvertedType::DATE, /** * A time - * + * * The total number of milliseconds since midnight. The value is stored * as an INT32 physical type. */ ConvertedType::TIME_MILLIS, /** * A time. - * + * * The total number of microseconds since midnight. The value is stored as * an INT64 physical type. */ ConvertedType::TIME_MICROS, /** * A date/time combination - * + * * Date and time recorded as milliseconds since the Unix epoch. Recorded as * a physical type of INT64. */ ConvertedType::TIMESTAMP_MILLIS, /** * A date/time combination - * + * * Date and time recorded as microseconds since the Unix epoch. The value is * stored as an INT64 physical type. */ ConvertedType::TIMESTAMP_MICROS, /** * An unsigned integer value. - * + * * The number describes the maximum number of meaningful data bits in * the stored value. 8, 16 and 32 bit values are stored using the * INT32 physical type. 64 bit values are stored using the INT64 * physical type. - * + * */ ConvertedType::UINT_8, ConvertedType::UINT_16, @@ -141,12 +141,12 @@ int _kConvertedTypeValues[] = { ConvertedType::UINT_64, /** * A signed integer value. - * + * * The number describes the maximum number of meaningful data bits in * the stored value. 8, 16 and 32 bit values are stored using the * INT32 physical type. 64 bit values are stored using the INT64 * physical type. - * + * */ ConvertedType::INT_8, ConvertedType::INT_16, @@ -154,19 +154,19 @@ int _kConvertedTypeValues[] = { ConvertedType::INT_64, /** * An embedded JSON document - * + * * A JSON document embedded within a single UTF8 column. */ ConvertedType::JSON, /** * An embedded BSON document - * + * * A BSON document embedded within a single BINARY column. */ ConvertedType::BSON, /** * An interval of time - * + * * This type annotates data stored as a FIXED_LEN_BYTE_ARRAY of length 12 * This data is composed of three separate little endian unsigned * integers. Each stores a component of a duration of time. The first @@ -202,12 +202,12 @@ const char* _kConvertedTypeNames[] = { "ENUM", /** * A decimal value. - * + * * This may be used to annotate binary or fixed primitive types. The * underlying byte array stores the unscaled value encoded as two's * complement using big-endian byte order (the most significant byte is the * zeroth element). The value of the decimal is the value * 10^{-scale}. - * + * * This must be accompanied by a (maximum) precision and a scale in the * SchemaElement. The precision specifies the number of digits in the decimal * and the scale stores the location of the decimal point. For example 1.23 @@ -217,47 +217,47 @@ const char* _kConvertedTypeNames[] = { "DECIMAL", /** * A Date - * + * * Stored as days since Unix epoch, encoded as the INT32 physical type. - * + * */ "DATE", /** * A time - * + * * The total number of milliseconds since midnight. The value is stored * as an INT32 physical type. */ "TIME_MILLIS", /** * A time. - * + * * The total number of microseconds since midnight. The value is stored as * an INT64 physical type. */ "TIME_MICROS", /** * A date/time combination - * + * * Date and time recorded as milliseconds since the Unix epoch. Recorded as * a physical type of INT64. */ "TIMESTAMP_MILLIS", /** * A date/time combination - * + * * Date and time recorded as microseconds since the Unix epoch. The value is * stored as an INT64 physical type. */ "TIMESTAMP_MICROS", /** * An unsigned integer value. - * + * * The number describes the maximum number of meaningful data bits in * the stored value. 8, 16 and 32 bit values are stored using the * INT32 physical type. 64 bit values are stored using the INT64 * physical type. - * + * */ "UINT_8", "UINT_16", @@ -265,12 +265,12 @@ const char* _kConvertedTypeNames[] = { "UINT_64", /** * A signed integer value. - * + * * The number describes the maximum number of meaningful data bits in * the stored value. 8, 16 and 32 bit values are stored using the * INT32 physical type. 64 bit values are stored using the INT64 * physical type. - * + * */ "INT_8", "INT_16", @@ -278,19 +278,19 @@ const char* _kConvertedTypeNames[] = { "INT_64", /** * An embedded JSON document - * + * * A JSON document embedded within a single UTF8 column. */ "JSON", /** * An embedded BSON document - * + * * A BSON document embedded within a single BINARY column. */ "BSON", /** * An interval of time - * + * * This type annotates data stored as a FIXED_LEN_BYTE_ARRAY of length 12 * This data is composed of three separate little endian unsigned * integers. Each stores a component of a duration of time. The first @@ -372,6 +372,84 @@ std::string to_string(const FieldRepetitionType::type& val) { } } +int _kEdgesValues[] = { + Edges::PLANAR, + Edges::SPHERICAL +}; +const char* _kEdgesNames[] = { + "PLANAR", + "SPHERICAL" +}; +const std::map _Edges_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kEdgesValues, _kEdgesNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const Edges::type& val) { + std::map::const_iterator it = _Edges_VALUES_TO_NAMES.find(val); + if (it != _Edges_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const Edges::type& val) { + std::map::const_iterator it = _Edges_VALUES_TO_NAMES.find(val); + if (it != _Edges_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + +int _kGeometryEncodingValues[] = { + /** + * Allowed for physical type: BYTE_ARRAY. + * + * Well-known binary (WKB) representations of geometries. It supports 2D or + * 3D geometries of the standard geometry types (Point, LineString, Polygon, + * MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). This + * is the preferred option for maximum portability. + * + * This encoding enables GeometryStatistics to be set in the column chunk + * and page index. + */ + GeometryEncoding::WKB +}; +const char* _kGeometryEncodingNames[] = { + /** + * Allowed for physical type: BYTE_ARRAY. + * + * Well-known binary (WKB) representations of geometries. It supports 2D or + * 3D geometries of the standard geometry types (Point, LineString, Polygon, + * MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). This + * is the preferred option for maximum portability. + * + * This encoding enables GeometryStatistics to be set in the column chunk + * and page index. + */ + "WKB" +}; +const std::map _GeometryEncoding_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(1, _kGeometryEncodingValues, _kGeometryEncodingNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr)); + +std::ostream& operator<<(std::ostream& out, const GeometryEncoding::type& val) { + std::map::const_iterator it = _GeometryEncoding_VALUES_TO_NAMES.find(val); + if (it != _GeometryEncoding_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +std::string to_string(const GeometryEncoding::type& val) { + std::map::const_iterator it = _GeometryEncoding_VALUES_TO_NAMES.find(val); + if (it != _GeometryEncoding_VALUES_TO_NAMES.end()) { + return std::string(it->second); + } else { + return std::to_string(static_cast(val)); + } +} + int _kEncodingValues[] = { /** * Default encoding. @@ -421,12 +499,15 @@ int _kEncodingValues[] = { */ Encoding::RLE_DICTIONARY, /** - * Encoding for floating-point data. + * Encoding for fixed-width data (FLOAT, DOUBLE, INT32, INT64, FIXED_LEN_BYTE_ARRAY). * K byte-streams are created where K is the size in bytes of the data type. - * The individual bytes of an FP value are scattered to the corresponding stream and + * The individual bytes of a value are scattered to the corresponding stream and * the streams are concatenated. * This itself does not reduce the size of the data but can lead to better compression * afterwards. + * + * Added in 2.8 for FLOAT and DOUBLE. + * Support for INT32, INT64 and FIXED_LEN_BYTE_ARRAY added in 2.11. */ Encoding::BYTE_STREAM_SPLIT }; @@ -479,12 +560,15 @@ const char* _kEncodingNames[] = { */ "RLE_DICTIONARY", /** - * Encoding for floating-point data. + * Encoding for fixed-width data (FLOAT, DOUBLE, INT32, INT64, FIXED_LEN_BYTE_ARRAY). * K byte-streams are created where K is the size in bytes of the data type. - * The individual bytes of an FP value are scattered to the corresponding stream and + * The individual bytes of a value are scattered to the corresponding stream and * the streams are concatenated. * This itself does not reduce the size of the data but can lead to better compression * afterwards. + * + * Added in 2.8 for FLOAT and DOUBLE. + * Support for INT32, INT64 and FIXED_LEN_BYTE_ARRAY added in 2.11. */ "BYTE_STREAM_SPLIT" }; @@ -684,6 +768,246 @@ void SizeStatistics::printTo(std::ostream& out) const { } +Covering::~Covering() noexcept { +} + + +void Covering::__set_kind(const std::string& val) { + this->kind = val; +} + +void Covering::__set_value(const std::string& val) { + this->value = val; +} +std::ostream& operator<<(std::ostream& out, const Covering& obj) +{ + obj.printTo(out); + return out; +} + + +void swap(Covering &a, Covering &b) { + using ::std::swap; + swap(a.kind, b.kind); + swap(a.value, b.value); +} + +Covering::Covering(const Covering& other16) { + kind = other16.kind; + value = other16.value; +} +Covering::Covering(Covering&& other17) noexcept { + kind = std::move(other17.kind); + value = std::move(other17.value); +} +Covering& Covering::operator=(const Covering& other18) { + kind = other18.kind; + value = other18.value; + return *this; +} +Covering& Covering::operator=(Covering&& other19) noexcept { + kind = std::move(other19.kind); + value = std::move(other19.value); + return *this; +} +void Covering::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "Covering("; + out << "kind=" << to_string(kind); + out << ", " << "value=" << to_string(value); + out << ")"; +} + + +BoundingBox::~BoundingBox() noexcept { +} + + +void BoundingBox::__set_xmin(const double val) { + this->xmin = val; +} + +void BoundingBox::__set_xmax(const double val) { + this->xmax = val; +} + +void BoundingBox::__set_ymin(const double val) { + this->ymin = val; +} + +void BoundingBox::__set_ymax(const double val) { + this->ymax = val; +} + +void BoundingBox::__set_zmin(const double val) { + this->zmin = val; +__isset.zmin = true; +} + +void BoundingBox::__set_zmax(const double val) { + this->zmax = val; +__isset.zmax = true; +} + +void BoundingBox::__set_mmin(const double val) { + this->mmin = val; +__isset.mmin = true; +} + +void BoundingBox::__set_mmax(const double val) { + this->mmax = val; +__isset.mmax = true; +} +std::ostream& operator<<(std::ostream& out, const BoundingBox& obj) +{ + obj.printTo(out); + return out; +} + + +void swap(BoundingBox &a, BoundingBox &b) { + using ::std::swap; + swap(a.xmin, b.xmin); + swap(a.xmax, b.xmax); + swap(a.ymin, b.ymin); + swap(a.ymax, b.ymax); + swap(a.zmin, b.zmin); + swap(a.zmax, b.zmax); + swap(a.mmin, b.mmin); + swap(a.mmax, b.mmax); + swap(a.__isset, b.__isset); +} + +BoundingBox::BoundingBox(const BoundingBox& other20) noexcept { + xmin = other20.xmin; + xmax = other20.xmax; + ymin = other20.ymin; + ymax = other20.ymax; + zmin = other20.zmin; + zmax = other20.zmax; + mmin = other20.mmin; + mmax = other20.mmax; + __isset = other20.__isset; +} +BoundingBox::BoundingBox(BoundingBox&& other21) noexcept { + xmin = other21.xmin; + xmax = other21.xmax; + ymin = other21.ymin; + ymax = other21.ymax; + zmin = other21.zmin; + zmax = other21.zmax; + mmin = other21.mmin; + mmax = other21.mmax; + __isset = other21.__isset; +} +BoundingBox& BoundingBox::operator=(const BoundingBox& other22) noexcept { + xmin = other22.xmin; + xmax = other22.xmax; + ymin = other22.ymin; + ymax = other22.ymax; + zmin = other22.zmin; + zmax = other22.zmax; + mmin = other22.mmin; + mmax = other22.mmax; + __isset = other22.__isset; + return *this; +} +BoundingBox& BoundingBox::operator=(BoundingBox&& other23) noexcept { + xmin = other23.xmin; + xmax = other23.xmax; + ymin = other23.ymin; + ymax = other23.ymax; + zmin = other23.zmin; + zmax = other23.zmax; + mmin = other23.mmin; + mmax = other23.mmax; + __isset = other23.__isset; + return *this; +} +void BoundingBox::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "BoundingBox("; + out << "xmin=" << to_string(xmin); + out << ", " << "xmax=" << to_string(xmax); + out << ", " << "ymin=" << to_string(ymin); + out << ", " << "ymax=" << to_string(ymax); + out << ", " << "zmin="; (__isset.zmin ? (out << to_string(zmin)) : (out << "")); + out << ", " << "zmax="; (__isset.zmax ? (out << to_string(zmax)) : (out << "")); + out << ", " << "mmin="; (__isset.mmin ? (out << to_string(mmin)) : (out << "")); + out << ", " << "mmax="; (__isset.mmax ? (out << to_string(mmax)) : (out << "")); + out << ")"; +} + + +GeometryStatistics::~GeometryStatistics() noexcept { +} + + +void GeometryStatistics::__set_bbox(const BoundingBox& val) { + this->bbox = val; +__isset.bbox = true; +} + +void GeometryStatistics::__set_coverings(const std::vector & val) { + this->coverings = val; +__isset.coverings = true; +} + +void GeometryStatistics::__set_geometry_types(const std::vector & val) { + this->geometry_types = val; +__isset.geometry_types = true; +} +std::ostream& operator<<(std::ostream& out, const GeometryStatistics& obj) +{ + obj.printTo(out); + return out; +} + + +void swap(GeometryStatistics &a, GeometryStatistics &b) { + using ::std::swap; + swap(a.bbox, b.bbox); + swap(a.coverings, b.coverings); + swap(a.geometry_types, b.geometry_types); + swap(a.__isset, b.__isset); +} + +GeometryStatistics::GeometryStatistics(const GeometryStatistics& other36) { + bbox = other36.bbox; + coverings = other36.coverings; + geometry_types = other36.geometry_types; + __isset = other36.__isset; +} +GeometryStatistics::GeometryStatistics(GeometryStatistics&& other37) noexcept { + bbox = std::move(other37.bbox); + coverings = std::move(other37.coverings); + geometry_types = std::move(other37.geometry_types); + __isset = other37.__isset; +} +GeometryStatistics& GeometryStatistics::operator=(const GeometryStatistics& other38) { + bbox = other38.bbox; + coverings = other38.coverings; + geometry_types = other38.geometry_types; + __isset = other38.__isset; + return *this; +} +GeometryStatistics& GeometryStatistics::operator=(GeometryStatistics&& other39) noexcept { + bbox = std::move(other39.bbox); + coverings = std::move(other39.coverings); + geometry_types = std::move(other39.geometry_types); + __isset = other39.__isset; + return *this; +} +void GeometryStatistics::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GeometryStatistics("; + out << "bbox="; (__isset.bbox ? (out << to_string(bbox)) : (out << "")); + out << ", " << "coverings="; (__isset.coverings ? (out << to_string(coverings)) : (out << "")); + out << ", " << "geometry_types="; (__isset.geometry_types ? (out << to_string(geometry_types)) : (out << "")); + out << ")"; +} + + Statistics::~Statistics() noexcept { } @@ -727,6 +1051,11 @@ void Statistics::__set_is_min_value_exact(const bool val) { this->is_min_value_exact = val; __isset.is_min_value_exact = true; } + +void Statistics::__set_geometry_stats(const GeometryStatistics& val) { + this->geometry_stats = val; +__isset.geometry_stats = true; +} std::ostream& operator<<(std::ostream& out, const Statistics& obj) { obj.printTo(out); @@ -744,53 +1073,58 @@ void swap(Statistics &a, Statistics &b) { swap(a.min_value, b.min_value); swap(a.is_max_value_exact, b.is_max_value_exact); swap(a.is_min_value_exact, b.is_min_value_exact); + swap(a.geometry_stats, b.geometry_stats); swap(a.__isset, b.__isset); } -Statistics::Statistics(const Statistics& other16) { - max = other16.max; - min = other16.min; - null_count = other16.null_count; - distinct_count = other16.distinct_count; - max_value = other16.max_value; - min_value = other16.min_value; - is_max_value_exact = other16.is_max_value_exact; - is_min_value_exact = other16.is_min_value_exact; - __isset = other16.__isset; -} -Statistics::Statistics(Statistics&& other17) noexcept { - max = std::move(other17.max); - min = std::move(other17.min); - null_count = other17.null_count; - distinct_count = other17.distinct_count; - max_value = std::move(other17.max_value); - min_value = std::move(other17.min_value); - is_max_value_exact = other17.is_max_value_exact; - is_min_value_exact = other17.is_min_value_exact; - __isset = other17.__isset; -} -Statistics& Statistics::operator=(const Statistics& other18) { - max = other18.max; - min = other18.min; - null_count = other18.null_count; - distinct_count = other18.distinct_count; - max_value = other18.max_value; - min_value = other18.min_value; - is_max_value_exact = other18.is_max_value_exact; - is_min_value_exact = other18.is_min_value_exact; - __isset = other18.__isset; +Statistics::Statistics(const Statistics& other40) { + max = other40.max; + min = other40.min; + null_count = other40.null_count; + distinct_count = other40.distinct_count; + max_value = other40.max_value; + min_value = other40.min_value; + is_max_value_exact = other40.is_max_value_exact; + is_min_value_exact = other40.is_min_value_exact; + geometry_stats = other40.geometry_stats; + __isset = other40.__isset; +} +Statistics::Statistics(Statistics&& other41) noexcept { + max = std::move(other41.max); + min = std::move(other41.min); + null_count = other41.null_count; + distinct_count = other41.distinct_count; + max_value = std::move(other41.max_value); + min_value = std::move(other41.min_value); + is_max_value_exact = other41.is_max_value_exact; + is_min_value_exact = other41.is_min_value_exact; + geometry_stats = std::move(other41.geometry_stats); + __isset = other41.__isset; +} +Statistics& Statistics::operator=(const Statistics& other42) { + max = other42.max; + min = other42.min; + null_count = other42.null_count; + distinct_count = other42.distinct_count; + max_value = other42.max_value; + min_value = other42.min_value; + is_max_value_exact = other42.is_max_value_exact; + is_min_value_exact = other42.is_min_value_exact; + geometry_stats = other42.geometry_stats; + __isset = other42.__isset; return *this; } -Statistics& Statistics::operator=(Statistics&& other19) noexcept { - max = std::move(other19.max); - min = std::move(other19.min); - null_count = other19.null_count; - distinct_count = other19.distinct_count; - max_value = std::move(other19.max_value); - min_value = std::move(other19.min_value); - is_max_value_exact = other19.is_max_value_exact; - is_min_value_exact = other19.is_min_value_exact; - __isset = other19.__isset; +Statistics& Statistics::operator=(Statistics&& other43) noexcept { + max = std::move(other43.max); + min = std::move(other43.min); + null_count = other43.null_count; + distinct_count = other43.distinct_count; + max_value = std::move(other43.max_value); + min_value = std::move(other43.min_value); + is_max_value_exact = other43.is_max_value_exact; + is_min_value_exact = other43.is_min_value_exact; + geometry_stats = std::move(other43.geometry_stats); + __isset = other43.__isset; return *this; } void Statistics::printTo(std::ostream& out) const { @@ -804,6 +1138,7 @@ void Statistics::printTo(std::ostream& out) const { out << ", " << "min_value="; (__isset.min_value ? (out << to_string(min_value)) : (out << "")); out << ", " << "is_max_value_exact="; (__isset.is_max_value_exact ? (out << to_string(is_max_value_exact)) : (out << "")); out << ", " << "is_min_value_exact="; (__isset.is_min_value_exact ? (out << to_string(is_min_value_exact)) : (out << "")); + out << ", " << "geometry_stats="; (__isset.geometry_stats ? (out << to_string(geometry_stats)) : (out << "")); out << ")"; } @@ -824,18 +1159,18 @@ void swap(StringType &a, StringType &b) { (void) b; } -StringType::StringType(const StringType& other20) noexcept { - (void) other20; +StringType::StringType(const StringType& other44) noexcept { + (void) other44; } -StringType::StringType(StringType&& other21) noexcept { - (void) other21; +StringType::StringType(StringType&& other45) noexcept { + (void) other45; } -StringType& StringType::operator=(const StringType& other22) noexcept { - (void) other22; +StringType& StringType::operator=(const StringType& other46) noexcept { + (void) other46; return *this; } -StringType& StringType::operator=(StringType&& other23) noexcept { - (void) other23; +StringType& StringType::operator=(StringType&& other47) noexcept { + (void) other47; return *this; } void StringType::printTo(std::ostream& out) const { @@ -861,18 +1196,18 @@ void swap(UUIDType &a, UUIDType &b) { (void) b; } -UUIDType::UUIDType(const UUIDType& other24) noexcept { - (void) other24; +UUIDType::UUIDType(const UUIDType& other48) noexcept { + (void) other48; } -UUIDType::UUIDType(UUIDType&& other25) noexcept { - (void) other25; +UUIDType::UUIDType(UUIDType&& other49) noexcept { + (void) other49; } -UUIDType& UUIDType::operator=(const UUIDType& other26) noexcept { - (void) other26; +UUIDType& UUIDType::operator=(const UUIDType& other50) noexcept { + (void) other50; return *this; } -UUIDType& UUIDType::operator=(UUIDType&& other27) noexcept { - (void) other27; +UUIDType& UUIDType::operator=(UUIDType&& other51) noexcept { + (void) other51; return *this; } void UUIDType::printTo(std::ostream& out) const { @@ -898,18 +1233,18 @@ void swap(MapType &a, MapType &b) { (void) b; } -MapType::MapType(const MapType& other28) noexcept { - (void) other28; +MapType::MapType(const MapType& other52) noexcept { + (void) other52; } -MapType::MapType(MapType&& other29) noexcept { - (void) other29; +MapType::MapType(MapType&& other53) noexcept { + (void) other53; } -MapType& MapType::operator=(const MapType& other30) noexcept { - (void) other30; +MapType& MapType::operator=(const MapType& other54) noexcept { + (void) other54; return *this; } -MapType& MapType::operator=(MapType&& other31) noexcept { - (void) other31; +MapType& MapType::operator=(MapType&& other55) noexcept { + (void) other55; return *this; } void MapType::printTo(std::ostream& out) const { @@ -935,18 +1270,18 @@ void swap(ListType &a, ListType &b) { (void) b; } -ListType::ListType(const ListType& other32) noexcept { - (void) other32; +ListType::ListType(const ListType& other56) noexcept { + (void) other56; } -ListType::ListType(ListType&& other33) noexcept { - (void) other33; +ListType::ListType(ListType&& other57) noexcept { + (void) other57; } -ListType& ListType::operator=(const ListType& other34) noexcept { - (void) other34; +ListType& ListType::operator=(const ListType& other58) noexcept { + (void) other58; return *this; } -ListType& ListType::operator=(ListType&& other35) noexcept { - (void) other35; +ListType& ListType::operator=(ListType&& other59) noexcept { + (void) other59; return *this; } void ListType::printTo(std::ostream& out) const { @@ -972,18 +1307,18 @@ void swap(EnumType &a, EnumType &b) { (void) b; } -EnumType::EnumType(const EnumType& other36) noexcept { - (void) other36; +EnumType::EnumType(const EnumType& other60) noexcept { + (void) other60; } -EnumType::EnumType(EnumType&& other37) noexcept { - (void) other37; +EnumType::EnumType(EnumType&& other61) noexcept { + (void) other61; } -EnumType& EnumType::operator=(const EnumType& other38) noexcept { - (void) other38; +EnumType& EnumType::operator=(const EnumType& other62) noexcept { + (void) other62; return *this; } -EnumType& EnumType::operator=(EnumType&& other39) noexcept { - (void) other39; +EnumType& EnumType::operator=(EnumType&& other63) noexcept { + (void) other63; return *this; } void EnumType::printTo(std::ostream& out) const { @@ -1009,18 +1344,18 @@ void swap(DateType &a, DateType &b) { (void) b; } -DateType::DateType(const DateType& other40) noexcept { - (void) other40; +DateType::DateType(const DateType& other64) noexcept { + (void) other64; } -DateType::DateType(DateType&& other41) noexcept { - (void) other41; +DateType::DateType(DateType&& other65) noexcept { + (void) other65; } -DateType& DateType::operator=(const DateType& other42) noexcept { - (void) other42; +DateType& DateType::operator=(const DateType& other66) noexcept { + (void) other66; return *this; } -DateType& DateType::operator=(DateType&& other43) noexcept { - (void) other43; +DateType& DateType::operator=(DateType&& other67) noexcept { + (void) other67; return *this; } void DateType::printTo(std::ostream& out) const { @@ -1046,18 +1381,18 @@ void swap(Float16Type &a, Float16Type &b) { (void) b; } -Float16Type::Float16Type(const Float16Type& other44) noexcept { - (void) other44; +Float16Type::Float16Type(const Float16Type& other68) noexcept { + (void) other68; } -Float16Type::Float16Type(Float16Type&& other45) noexcept { - (void) other45; +Float16Type::Float16Type(Float16Type&& other69) noexcept { + (void) other69; } -Float16Type& Float16Type::operator=(const Float16Type& other46) noexcept { - (void) other46; +Float16Type& Float16Type::operator=(const Float16Type& other70) noexcept { + (void) other70; return *this; } -Float16Type& Float16Type::operator=(Float16Type&& other47) noexcept { - (void) other47; +Float16Type& Float16Type::operator=(Float16Type&& other71) noexcept { + (void) other71; return *this; } void Float16Type::printTo(std::ostream& out) const { @@ -1083,18 +1418,18 @@ void swap(NullType &a, NullType &b) { (void) b; } -NullType::NullType(const NullType& other48) noexcept { - (void) other48; +NullType::NullType(const NullType& other72) noexcept { + (void) other72; } -NullType::NullType(NullType&& other49) noexcept { - (void) other49; +NullType::NullType(NullType&& other73) noexcept { + (void) other73; } -NullType& NullType::operator=(const NullType& other50) noexcept { - (void) other50; +NullType& NullType::operator=(const NullType& other74) noexcept { + (void) other74; return *this; } -NullType& NullType::operator=(NullType&& other51) noexcept { - (void) other51; +NullType& NullType::operator=(NullType&& other75) noexcept { + (void) other75; return *this; } void NullType::printTo(std::ostream& out) const { @@ -1128,22 +1463,22 @@ void swap(DecimalType &a, DecimalType &b) { swap(a.precision, b.precision); } -DecimalType::DecimalType(const DecimalType& other52) noexcept { - scale = other52.scale; - precision = other52.precision; +DecimalType::DecimalType(const DecimalType& other76) noexcept { + scale = other76.scale; + precision = other76.precision; } -DecimalType::DecimalType(DecimalType&& other53) noexcept { - scale = other53.scale; - precision = other53.precision; +DecimalType::DecimalType(DecimalType&& other77) noexcept { + scale = other77.scale; + precision = other77.precision; } -DecimalType& DecimalType::operator=(const DecimalType& other54) noexcept { - scale = other54.scale; - precision = other54.precision; +DecimalType& DecimalType::operator=(const DecimalType& other78) noexcept { + scale = other78.scale; + precision = other78.precision; return *this; } -DecimalType& DecimalType::operator=(DecimalType&& other55) noexcept { - scale = other55.scale; - precision = other55.precision; +DecimalType& DecimalType::operator=(DecimalType&& other79) noexcept { + scale = other79.scale; + precision = other79.precision; return *this; } void DecimalType::printTo(std::ostream& out) const { @@ -1171,18 +1506,18 @@ void swap(MilliSeconds &a, MilliSeconds &b) { (void) b; } -MilliSeconds::MilliSeconds(const MilliSeconds& other56) noexcept { - (void) other56; +MilliSeconds::MilliSeconds(const MilliSeconds& other80) noexcept { + (void) other80; } -MilliSeconds::MilliSeconds(MilliSeconds&& other57) noexcept { - (void) other57; +MilliSeconds::MilliSeconds(MilliSeconds&& other81) noexcept { + (void) other81; } -MilliSeconds& MilliSeconds::operator=(const MilliSeconds& other58) noexcept { - (void) other58; +MilliSeconds& MilliSeconds::operator=(const MilliSeconds& other82) noexcept { + (void) other82; return *this; } -MilliSeconds& MilliSeconds::operator=(MilliSeconds&& other59) noexcept { - (void) other59; +MilliSeconds& MilliSeconds::operator=(MilliSeconds&& other83) noexcept { + (void) other83; return *this; } void MilliSeconds::printTo(std::ostream& out) const { @@ -1208,18 +1543,18 @@ void swap(MicroSeconds &a, MicroSeconds &b) { (void) b; } -MicroSeconds::MicroSeconds(const MicroSeconds& other60) noexcept { - (void) other60; +MicroSeconds::MicroSeconds(const MicroSeconds& other84) noexcept { + (void) other84; } -MicroSeconds::MicroSeconds(MicroSeconds&& other61) noexcept { - (void) other61; +MicroSeconds::MicroSeconds(MicroSeconds&& other85) noexcept { + (void) other85; } -MicroSeconds& MicroSeconds::operator=(const MicroSeconds& other62) noexcept { - (void) other62; +MicroSeconds& MicroSeconds::operator=(const MicroSeconds& other86) noexcept { + (void) other86; return *this; } -MicroSeconds& MicroSeconds::operator=(MicroSeconds&& other63) noexcept { - (void) other63; +MicroSeconds& MicroSeconds::operator=(MicroSeconds&& other87) noexcept { + (void) other87; return *this; } void MicroSeconds::printTo(std::ostream& out) const { @@ -1245,18 +1580,18 @@ void swap(NanoSeconds &a, NanoSeconds &b) { (void) b; } -NanoSeconds::NanoSeconds(const NanoSeconds& other64) noexcept { - (void) other64; +NanoSeconds::NanoSeconds(const NanoSeconds& other88) noexcept { + (void) other88; } -NanoSeconds::NanoSeconds(NanoSeconds&& other65) noexcept { - (void) other65; +NanoSeconds::NanoSeconds(NanoSeconds&& other89) noexcept { + (void) other89; } -NanoSeconds& NanoSeconds::operator=(const NanoSeconds& other66) noexcept { - (void) other66; +NanoSeconds& NanoSeconds::operator=(const NanoSeconds& other90) noexcept { + (void) other90; return *this; } -NanoSeconds& NanoSeconds::operator=(NanoSeconds&& other67) noexcept { - (void) other67; +NanoSeconds& NanoSeconds::operator=(NanoSeconds&& other91) noexcept { + (void) other91; return *this; } void NanoSeconds::printTo(std::ostream& out) const { @@ -1299,30 +1634,30 @@ void swap(TimeUnit &a, TimeUnit &b) { swap(a.__isset, b.__isset); } -TimeUnit::TimeUnit(const TimeUnit& other68) noexcept { - MILLIS = other68.MILLIS; - MICROS = other68.MICROS; - NANOS = other68.NANOS; - __isset = other68.__isset; +TimeUnit::TimeUnit(const TimeUnit& other92) noexcept { + MILLIS = other92.MILLIS; + MICROS = other92.MICROS; + NANOS = other92.NANOS; + __isset = other92.__isset; } -TimeUnit::TimeUnit(TimeUnit&& other69) noexcept { - MILLIS = std::move(other69.MILLIS); - MICROS = std::move(other69.MICROS); - NANOS = std::move(other69.NANOS); - __isset = other69.__isset; +TimeUnit::TimeUnit(TimeUnit&& other93) noexcept { + MILLIS = std::move(other93.MILLIS); + MICROS = std::move(other93.MICROS); + NANOS = std::move(other93.NANOS); + __isset = other93.__isset; } -TimeUnit& TimeUnit::operator=(const TimeUnit& other70) noexcept { - MILLIS = other70.MILLIS; - MICROS = other70.MICROS; - NANOS = other70.NANOS; - __isset = other70.__isset; +TimeUnit& TimeUnit::operator=(const TimeUnit& other94) noexcept { + MILLIS = other94.MILLIS; + MICROS = other94.MICROS; + NANOS = other94.NANOS; + __isset = other94.__isset; return *this; } -TimeUnit& TimeUnit::operator=(TimeUnit&& other71) noexcept { - MILLIS = std::move(other71.MILLIS); - MICROS = std::move(other71.MICROS); - NANOS = std::move(other71.NANOS); - __isset = other71.__isset; +TimeUnit& TimeUnit::operator=(TimeUnit&& other95) noexcept { + MILLIS = std::move(other95.MILLIS); + MICROS = std::move(other95.MICROS); + NANOS = std::move(other95.NANOS); + __isset = other95.__isset; return *this; } void TimeUnit::printTo(std::ostream& out) const { @@ -1359,22 +1694,22 @@ void swap(TimestampType &a, TimestampType &b) { swap(a.unit, b.unit); } -TimestampType::TimestampType(const TimestampType& other72) noexcept { - isAdjustedToUTC = other72.isAdjustedToUTC; - unit = other72.unit; +TimestampType::TimestampType(const TimestampType& other96) noexcept { + isAdjustedToUTC = other96.isAdjustedToUTC; + unit = other96.unit; } -TimestampType::TimestampType(TimestampType&& other73) noexcept { - isAdjustedToUTC = other73.isAdjustedToUTC; - unit = std::move(other73.unit); +TimestampType::TimestampType(TimestampType&& other97) noexcept { + isAdjustedToUTC = other97.isAdjustedToUTC; + unit = std::move(other97.unit); } -TimestampType& TimestampType::operator=(const TimestampType& other74) noexcept { - isAdjustedToUTC = other74.isAdjustedToUTC; - unit = other74.unit; +TimestampType& TimestampType::operator=(const TimestampType& other98) noexcept { + isAdjustedToUTC = other98.isAdjustedToUTC; + unit = other98.unit; return *this; } -TimestampType& TimestampType::operator=(TimestampType&& other75) noexcept { - isAdjustedToUTC = other75.isAdjustedToUTC; - unit = std::move(other75.unit); +TimestampType& TimestampType::operator=(TimestampType&& other99) noexcept { + isAdjustedToUTC = other99.isAdjustedToUTC; + unit = std::move(other99.unit); return *this; } void TimestampType::printTo(std::ostream& out) const { @@ -1410,22 +1745,22 @@ void swap(TimeType &a, TimeType &b) { swap(a.unit, b.unit); } -TimeType::TimeType(const TimeType& other76) noexcept { - isAdjustedToUTC = other76.isAdjustedToUTC; - unit = other76.unit; +TimeType::TimeType(const TimeType& other100) noexcept { + isAdjustedToUTC = other100.isAdjustedToUTC; + unit = other100.unit; } -TimeType::TimeType(TimeType&& other77) noexcept { - isAdjustedToUTC = other77.isAdjustedToUTC; - unit = std::move(other77.unit); +TimeType::TimeType(TimeType&& other101) noexcept { + isAdjustedToUTC = other101.isAdjustedToUTC; + unit = std::move(other101.unit); } -TimeType& TimeType::operator=(const TimeType& other78) noexcept { - isAdjustedToUTC = other78.isAdjustedToUTC; - unit = other78.unit; +TimeType& TimeType::operator=(const TimeType& other102) noexcept { + isAdjustedToUTC = other102.isAdjustedToUTC; + unit = other102.unit; return *this; } -TimeType& TimeType::operator=(TimeType&& other79) noexcept { - isAdjustedToUTC = other79.isAdjustedToUTC; - unit = std::move(other79.unit); +TimeType& TimeType::operator=(TimeType&& other103) noexcept { + isAdjustedToUTC = other103.isAdjustedToUTC; + unit = std::move(other103.unit); return *this; } void TimeType::printTo(std::ostream& out) const { @@ -1461,22 +1796,22 @@ void swap(IntType &a, IntType &b) { swap(a.isSigned, b.isSigned); } -IntType::IntType(const IntType& other80) noexcept { - bitWidth = other80.bitWidth; - isSigned = other80.isSigned; +IntType::IntType(const IntType& other104) noexcept { + bitWidth = other104.bitWidth; + isSigned = other104.isSigned; } -IntType::IntType(IntType&& other81) noexcept { - bitWidth = other81.bitWidth; - isSigned = other81.isSigned; +IntType::IntType(IntType&& other105) noexcept { + bitWidth = other105.bitWidth; + isSigned = other105.isSigned; } -IntType& IntType::operator=(const IntType& other82) noexcept { - bitWidth = other82.bitWidth; - isSigned = other82.isSigned; +IntType& IntType::operator=(const IntType& other106) noexcept { + bitWidth = other106.bitWidth; + isSigned = other106.isSigned; return *this; } -IntType& IntType::operator=(IntType&& other83) noexcept { - bitWidth = other83.bitWidth; - isSigned = other83.isSigned; +IntType& IntType::operator=(IntType&& other107) noexcept { + bitWidth = other107.bitWidth; + isSigned = other107.isSigned; return *this; } void IntType::printTo(std::ostream& out) const { @@ -1504,18 +1839,18 @@ void swap(JsonType &a, JsonType &b) { (void) b; } -JsonType::JsonType(const JsonType& other84) noexcept { - (void) other84; +JsonType::JsonType(const JsonType& other108) noexcept { + (void) other108; } -JsonType::JsonType(JsonType&& other85) noexcept { - (void) other85; +JsonType::JsonType(JsonType&& other109) noexcept { + (void) other109; } -JsonType& JsonType::operator=(const JsonType& other86) noexcept { - (void) other86; +JsonType& JsonType::operator=(const JsonType& other110) noexcept { + (void) other110; return *this; } -JsonType& JsonType::operator=(JsonType&& other87) noexcept { - (void) other87; +JsonType& JsonType::operator=(JsonType&& other111) noexcept { + (void) other111; return *this; } void JsonType::printTo(std::ostream& out) const { @@ -1541,18 +1876,18 @@ void swap(BsonType &a, BsonType &b) { (void) b; } -BsonType::BsonType(const BsonType& other88) noexcept { - (void) other88; +BsonType::BsonType(const BsonType& other112) noexcept { + (void) other112; } -BsonType::BsonType(BsonType&& other89) noexcept { - (void) other89; +BsonType::BsonType(BsonType&& other113) noexcept { + (void) other113; } -BsonType& BsonType::operator=(const BsonType& other90) noexcept { - (void) other90; +BsonType& BsonType::operator=(const BsonType& other114) noexcept { + (void) other114; return *this; } -BsonType& BsonType::operator=(BsonType&& other91) noexcept { - (void) other91; +BsonType& BsonType::operator=(BsonType&& other115) noexcept { + (void) other115; return *this; } void BsonType::printTo(std::ostream& out) const { @@ -1562,6 +1897,95 @@ void BsonType::printTo(std::ostream& out) const { } +GeometryType::~GeometryType() noexcept { +} + + +void GeometryType::__set_encoding(const GeometryEncoding::type val) { + this->encoding = val; +} + +void GeometryType::__set_edges(const Edges::type val) { + this->edges = val; +} + +void GeometryType::__set_crs(const std::string& val) { + this->crs = val; +__isset.crs = true; +} + +void GeometryType::__set_crs_encoding(const std::string& val) { + this->crs_encoding = val; +__isset.crs_encoding = true; +} + +void GeometryType::__set_metadata(const std::string& val) { + this->metadata = val; +__isset.metadata = true; +} +std::ostream& operator<<(std::ostream& out, const GeometryType& obj) +{ + obj.printTo(out); + return out; +} + + +void swap(GeometryType &a, GeometryType &b) { + using ::std::swap; + swap(a.encoding, b.encoding); + swap(a.edges, b.edges); + swap(a.crs, b.crs); + swap(a.crs_encoding, b.crs_encoding); + swap(a.metadata, b.metadata); + swap(a.__isset, b.__isset); +} + +GeometryType::GeometryType(const GeometryType& other118) { + encoding = other118.encoding; + edges = other118.edges; + crs = other118.crs; + crs_encoding = other118.crs_encoding; + metadata = other118.metadata; + __isset = other118.__isset; +} +GeometryType::GeometryType(GeometryType&& other119) noexcept { + encoding = other119.encoding; + edges = other119.edges; + crs = std::move(other119.crs); + crs_encoding = std::move(other119.crs_encoding); + metadata = std::move(other119.metadata); + __isset = other119.__isset; +} +GeometryType& GeometryType::operator=(const GeometryType& other120) { + encoding = other120.encoding; + edges = other120.edges; + crs = other120.crs; + crs_encoding = other120.crs_encoding; + metadata = other120.metadata; + __isset = other120.__isset; + return *this; +} +GeometryType& GeometryType::operator=(GeometryType&& other121) noexcept { + encoding = other121.encoding; + edges = other121.edges; + crs = std::move(other121.crs); + crs_encoding = std::move(other121.crs_encoding); + metadata = std::move(other121.metadata); + __isset = other121.__isset; + return *this; +} +void GeometryType::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "GeometryType("; + out << "encoding=" << to_string(encoding); + out << ", " << "edges=" << to_string(edges); + out << ", " << "crs="; (__isset.crs ? (out << to_string(crs)) : (out << "")); + out << ", " << "crs_encoding="; (__isset.crs_encoding ? (out << to_string(crs_encoding)) : (out << "")); + out << ", " << "metadata="; (__isset.metadata ? (out << to_string(metadata)) : (out << "")); + out << ")"; +} + + LogicalType::~LogicalType() noexcept { } @@ -1635,6 +2059,11 @@ void LogicalType::__set_FLOAT16(const Float16Type& val) { this->FLOAT16 = val; __isset.FLOAT16 = true; } + +void LogicalType::__set_GEOMETRY(const GeometryType& val) { + this->GEOMETRY = val; +__isset.GEOMETRY = true; +} std::ostream& operator<<(std::ostream& out, const LogicalType& obj) { obj.printTo(out); @@ -1658,77 +2087,82 @@ void swap(LogicalType &a, LogicalType &b) { swap(a.BSON, b.BSON); swap(a.UUID, b.UUID); swap(a.FLOAT16, b.FLOAT16); + swap(a.GEOMETRY, b.GEOMETRY); swap(a.__isset, b.__isset); } -LogicalType::LogicalType(const LogicalType& other92) noexcept { - STRING = other92.STRING; - MAP = other92.MAP; - LIST = other92.LIST; - ENUM = other92.ENUM; - DECIMAL = other92.DECIMAL; - DATE = other92.DATE; - TIME = other92.TIME; - TIMESTAMP = other92.TIMESTAMP; - INTEGER = other92.INTEGER; - UNKNOWN = other92.UNKNOWN; - JSON = other92.JSON; - BSON = other92.BSON; - UUID = other92.UUID; - FLOAT16 = other92.FLOAT16; - __isset = other92.__isset; +LogicalType::LogicalType(const LogicalType& other122) { + STRING = other122.STRING; + MAP = other122.MAP; + LIST = other122.LIST; + ENUM = other122.ENUM; + DECIMAL = other122.DECIMAL; + DATE = other122.DATE; + TIME = other122.TIME; + TIMESTAMP = other122.TIMESTAMP; + INTEGER = other122.INTEGER; + UNKNOWN = other122.UNKNOWN; + JSON = other122.JSON; + BSON = other122.BSON; + UUID = other122.UUID; + FLOAT16 = other122.FLOAT16; + GEOMETRY = other122.GEOMETRY; + __isset = other122.__isset; } -LogicalType::LogicalType(LogicalType&& other93) noexcept { - STRING = std::move(other93.STRING); - MAP = std::move(other93.MAP); - LIST = std::move(other93.LIST); - ENUM = std::move(other93.ENUM); - DECIMAL = std::move(other93.DECIMAL); - DATE = std::move(other93.DATE); - TIME = std::move(other93.TIME); - TIMESTAMP = std::move(other93.TIMESTAMP); - INTEGER = std::move(other93.INTEGER); - UNKNOWN = std::move(other93.UNKNOWN); - JSON = std::move(other93.JSON); - BSON = std::move(other93.BSON); - UUID = std::move(other93.UUID); - FLOAT16 = std::move(other93.FLOAT16); - __isset = other93.__isset; +LogicalType::LogicalType(LogicalType&& other123) noexcept { + STRING = std::move(other123.STRING); + MAP = std::move(other123.MAP); + LIST = std::move(other123.LIST); + ENUM = std::move(other123.ENUM); + DECIMAL = std::move(other123.DECIMAL); + DATE = std::move(other123.DATE); + TIME = std::move(other123.TIME); + TIMESTAMP = std::move(other123.TIMESTAMP); + INTEGER = std::move(other123.INTEGER); + UNKNOWN = std::move(other123.UNKNOWN); + JSON = std::move(other123.JSON); + BSON = std::move(other123.BSON); + UUID = std::move(other123.UUID); + FLOAT16 = std::move(other123.FLOAT16); + GEOMETRY = std::move(other123.GEOMETRY); + __isset = other123.__isset; } -LogicalType& LogicalType::operator=(const LogicalType& other94) noexcept { - STRING = other94.STRING; - MAP = other94.MAP; - LIST = other94.LIST; - ENUM = other94.ENUM; - DECIMAL = other94.DECIMAL; - DATE = other94.DATE; - TIME = other94.TIME; - TIMESTAMP = other94.TIMESTAMP; - INTEGER = other94.INTEGER; - UNKNOWN = other94.UNKNOWN; - JSON = other94.JSON; - BSON = other94.BSON; - UUID = other94.UUID; - FLOAT16 = other94.FLOAT16; - __isset = other94.__isset; +LogicalType& LogicalType::operator=(const LogicalType& other124) { + STRING = other124.STRING; + MAP = other124.MAP; + LIST = other124.LIST; + ENUM = other124.ENUM; + DECIMAL = other124.DECIMAL; + DATE = other124.DATE; + TIME = other124.TIME; + TIMESTAMP = other124.TIMESTAMP; + INTEGER = other124.INTEGER; + UNKNOWN = other124.UNKNOWN; + JSON = other124.JSON; + BSON = other124.BSON; + UUID = other124.UUID; + FLOAT16 = other124.FLOAT16; + GEOMETRY = other124.GEOMETRY; + __isset = other124.__isset; return *this; } -LogicalType& LogicalType::operator=(LogicalType&& other95) noexcept { - STRING = std::move(other95.STRING); - MAP = std::move(other95.MAP); - LIST = std::move(other95.LIST); - ENUM = std::move(other95.ENUM); - DECIMAL = std::move(other95.DECIMAL); - DATE = std::move(other95.DATE); - TIME = std::move(other95.TIME); - TIMESTAMP = std::move(other95.TIMESTAMP); - INTEGER = std::move(other95.INTEGER); - UNKNOWN = std::move(other95.UNKNOWN); - JSON = std::move(other95.JSON); - BSON = std::move(other95.BSON); - UUID = std::move(other95.UUID); - FLOAT16 = std::move(other95.FLOAT16); - __isset = other95.__isset; +LogicalType& LogicalType::operator=(LogicalType&& other125) noexcept { + STRING = std::move(other125.STRING); + MAP = std::move(other125.MAP); + LIST = std::move(other125.LIST); + ENUM = std::move(other125.ENUM); + DECIMAL = std::move(other125.DECIMAL); + DATE = std::move(other125.DATE); + TIME = std::move(other125.TIME); + TIMESTAMP = std::move(other125.TIMESTAMP); + INTEGER = std::move(other125.INTEGER); + UNKNOWN = std::move(other125.UNKNOWN); + JSON = std::move(other125.JSON); + BSON = std::move(other125.BSON); + UUID = std::move(other125.UUID); + FLOAT16 = std::move(other125.FLOAT16); + GEOMETRY = std::move(other125.GEOMETRY); + __isset = other125.__isset; return *this; } void LogicalType::printTo(std::ostream& out) const { @@ -1748,6 +2182,7 @@ void LogicalType::printTo(std::ostream& out) const { out << ", " << "BSON="; (__isset.BSON ? (out << to_string(BSON)) : (out << "")); out << ", " << "UUID="; (__isset.UUID ? (out << to_string(UUID)) : (out << "")); out << ", " << "FLOAT16="; (__isset.FLOAT16 ? (out << to_string(FLOAT16)) : (out << "")); + out << ", " << "GEOMETRY="; (__isset.GEOMETRY ? (out << to_string(GEOMETRY)) : (out << "")); out << ")"; } @@ -1826,58 +2261,58 @@ void swap(SchemaElement &a, SchemaElement &b) { swap(a.__isset, b.__isset); } -SchemaElement::SchemaElement(const SchemaElement& other99) { - type = other99.type; - type_length = other99.type_length; - repetition_type = other99.repetition_type; - name = other99.name; - num_children = other99.num_children; - converted_type = other99.converted_type; - scale = other99.scale; - precision = other99.precision; - field_id = other99.field_id; - logicalType = other99.logicalType; - __isset = other99.__isset; -} -SchemaElement::SchemaElement(SchemaElement&& other100) noexcept { - type = other100.type; - type_length = other100.type_length; - repetition_type = other100.repetition_type; - name = std::move(other100.name); - num_children = other100.num_children; - converted_type = other100.converted_type; - scale = other100.scale; - precision = other100.precision; - field_id = other100.field_id; - logicalType = std::move(other100.logicalType); - __isset = other100.__isset; -} -SchemaElement& SchemaElement::operator=(const SchemaElement& other101) { - type = other101.type; - type_length = other101.type_length; - repetition_type = other101.repetition_type; - name = other101.name; - num_children = other101.num_children; - converted_type = other101.converted_type; - scale = other101.scale; - precision = other101.precision; - field_id = other101.field_id; - logicalType = other101.logicalType; - __isset = other101.__isset; +SchemaElement::SchemaElement(const SchemaElement& other129) { + type = other129.type; + type_length = other129.type_length; + repetition_type = other129.repetition_type; + name = other129.name; + num_children = other129.num_children; + converted_type = other129.converted_type; + scale = other129.scale; + precision = other129.precision; + field_id = other129.field_id; + logicalType = other129.logicalType; + __isset = other129.__isset; +} +SchemaElement::SchemaElement(SchemaElement&& other130) noexcept { + type = other130.type; + type_length = other130.type_length; + repetition_type = other130.repetition_type; + name = std::move(other130.name); + num_children = other130.num_children; + converted_type = other130.converted_type; + scale = other130.scale; + precision = other130.precision; + field_id = other130.field_id; + logicalType = std::move(other130.logicalType); + __isset = other130.__isset; +} +SchemaElement& SchemaElement::operator=(const SchemaElement& other131) { + type = other131.type; + type_length = other131.type_length; + repetition_type = other131.repetition_type; + name = other131.name; + num_children = other131.num_children; + converted_type = other131.converted_type; + scale = other131.scale; + precision = other131.precision; + field_id = other131.field_id; + logicalType = other131.logicalType; + __isset = other131.__isset; return *this; } -SchemaElement& SchemaElement::operator=(SchemaElement&& other102) noexcept { - type = other102.type; - type_length = other102.type_length; - repetition_type = other102.repetition_type; - name = std::move(other102.name); - num_children = other102.num_children; - converted_type = other102.converted_type; - scale = other102.scale; - precision = other102.precision; - field_id = other102.field_id; - logicalType = std::move(other102.logicalType); - __isset = other102.__isset; +SchemaElement& SchemaElement::operator=(SchemaElement&& other132) noexcept { + type = other132.type; + type_length = other132.type_length; + repetition_type = other132.repetition_type; + name = std::move(other132.name); + num_children = other132.num_children; + converted_type = other132.converted_type; + scale = other132.scale; + precision = other132.precision; + field_id = other132.field_id; + logicalType = std::move(other132.logicalType); + __isset = other132.__isset; return *this; } void SchemaElement::printTo(std::ostream& out) const { @@ -1938,38 +2373,38 @@ void swap(DataPageHeader &a, DataPageHeader &b) { swap(a.__isset, b.__isset); } -DataPageHeader::DataPageHeader(const DataPageHeader& other106) { - num_values = other106.num_values; - encoding = other106.encoding; - definition_level_encoding = other106.definition_level_encoding; - repetition_level_encoding = other106.repetition_level_encoding; - statistics = other106.statistics; - __isset = other106.__isset; -} -DataPageHeader::DataPageHeader(DataPageHeader&& other107) noexcept { - num_values = other107.num_values; - encoding = other107.encoding; - definition_level_encoding = other107.definition_level_encoding; - repetition_level_encoding = other107.repetition_level_encoding; - statistics = std::move(other107.statistics); - __isset = other107.__isset; -} -DataPageHeader& DataPageHeader::operator=(const DataPageHeader& other108) { - num_values = other108.num_values; - encoding = other108.encoding; - definition_level_encoding = other108.definition_level_encoding; - repetition_level_encoding = other108.repetition_level_encoding; - statistics = other108.statistics; - __isset = other108.__isset; +DataPageHeader::DataPageHeader(const DataPageHeader& other136) { + num_values = other136.num_values; + encoding = other136.encoding; + definition_level_encoding = other136.definition_level_encoding; + repetition_level_encoding = other136.repetition_level_encoding; + statistics = other136.statistics; + __isset = other136.__isset; +} +DataPageHeader::DataPageHeader(DataPageHeader&& other137) noexcept { + num_values = other137.num_values; + encoding = other137.encoding; + definition_level_encoding = other137.definition_level_encoding; + repetition_level_encoding = other137.repetition_level_encoding; + statistics = std::move(other137.statistics); + __isset = other137.__isset; +} +DataPageHeader& DataPageHeader::operator=(const DataPageHeader& other138) { + num_values = other138.num_values; + encoding = other138.encoding; + definition_level_encoding = other138.definition_level_encoding; + repetition_level_encoding = other138.repetition_level_encoding; + statistics = other138.statistics; + __isset = other138.__isset; return *this; } -DataPageHeader& DataPageHeader::operator=(DataPageHeader&& other109) noexcept { - num_values = other109.num_values; - encoding = other109.encoding; - definition_level_encoding = other109.definition_level_encoding; - repetition_level_encoding = other109.repetition_level_encoding; - statistics = std::move(other109.statistics); - __isset = other109.__isset; +DataPageHeader& DataPageHeader::operator=(DataPageHeader&& other139) noexcept { + num_values = other139.num_values; + encoding = other139.encoding; + definition_level_encoding = other139.definition_level_encoding; + repetition_level_encoding = other139.repetition_level_encoding; + statistics = std::move(other139.statistics); + __isset = other139.__isset; return *this; } void DataPageHeader::printTo(std::ostream& out) const { @@ -2000,18 +2435,18 @@ void swap(IndexPageHeader &a, IndexPageHeader &b) { (void) b; } -IndexPageHeader::IndexPageHeader(const IndexPageHeader& other110) noexcept { - (void) other110; +IndexPageHeader::IndexPageHeader(const IndexPageHeader& other140) noexcept { + (void) other140; } -IndexPageHeader::IndexPageHeader(IndexPageHeader&& other111) noexcept { - (void) other111; +IndexPageHeader::IndexPageHeader(IndexPageHeader&& other141) noexcept { + (void) other141; } -IndexPageHeader& IndexPageHeader::operator=(const IndexPageHeader& other112) noexcept { - (void) other112; +IndexPageHeader& IndexPageHeader::operator=(const IndexPageHeader& other142) noexcept { + (void) other142; return *this; } -IndexPageHeader& IndexPageHeader::operator=(IndexPageHeader&& other113) noexcept { - (void) other113; +IndexPageHeader& IndexPageHeader::operator=(IndexPageHeader&& other143) noexcept { + (void) other143; return *this; } void IndexPageHeader::printTo(std::ostream& out) const { @@ -2052,30 +2487,30 @@ void swap(DictionaryPageHeader &a, DictionaryPageHeader &b) { swap(a.__isset, b.__isset); } -DictionaryPageHeader::DictionaryPageHeader(const DictionaryPageHeader& other115) noexcept { - num_values = other115.num_values; - encoding = other115.encoding; - is_sorted = other115.is_sorted; - __isset = other115.__isset; +DictionaryPageHeader::DictionaryPageHeader(const DictionaryPageHeader& other145) noexcept { + num_values = other145.num_values; + encoding = other145.encoding; + is_sorted = other145.is_sorted; + __isset = other145.__isset; } -DictionaryPageHeader::DictionaryPageHeader(DictionaryPageHeader&& other116) noexcept { - num_values = other116.num_values; - encoding = other116.encoding; - is_sorted = other116.is_sorted; - __isset = other116.__isset; +DictionaryPageHeader::DictionaryPageHeader(DictionaryPageHeader&& other146) noexcept { + num_values = other146.num_values; + encoding = other146.encoding; + is_sorted = other146.is_sorted; + __isset = other146.__isset; } -DictionaryPageHeader& DictionaryPageHeader::operator=(const DictionaryPageHeader& other117) noexcept { - num_values = other117.num_values; - encoding = other117.encoding; - is_sorted = other117.is_sorted; - __isset = other117.__isset; +DictionaryPageHeader& DictionaryPageHeader::operator=(const DictionaryPageHeader& other147) noexcept { + num_values = other147.num_values; + encoding = other147.encoding; + is_sorted = other147.is_sorted; + __isset = other147.__isset; return *this; } -DictionaryPageHeader& DictionaryPageHeader::operator=(DictionaryPageHeader&& other118) noexcept { - num_values = other118.num_values; - encoding = other118.encoding; - is_sorted = other118.is_sorted; - __isset = other118.__isset; +DictionaryPageHeader& DictionaryPageHeader::operator=(DictionaryPageHeader&& other148) noexcept { + num_values = other148.num_values; + encoding = other148.encoding; + is_sorted = other148.is_sorted; + __isset = other148.__isset; return *this; } void DictionaryPageHeader::printTo(std::ostream& out) const { @@ -2145,50 +2580,50 @@ void swap(DataPageHeaderV2 &a, DataPageHeaderV2 &b) { swap(a.__isset, b.__isset); } -DataPageHeaderV2::DataPageHeaderV2(const DataPageHeaderV2& other120) { - num_values = other120.num_values; - num_nulls = other120.num_nulls; - num_rows = other120.num_rows; - encoding = other120.encoding; - definition_levels_byte_length = other120.definition_levels_byte_length; - repetition_levels_byte_length = other120.repetition_levels_byte_length; - is_compressed = other120.is_compressed; - statistics = other120.statistics; - __isset = other120.__isset; -} -DataPageHeaderV2::DataPageHeaderV2(DataPageHeaderV2&& other121) noexcept { - num_values = other121.num_values; - num_nulls = other121.num_nulls; - num_rows = other121.num_rows; - encoding = other121.encoding; - definition_levels_byte_length = other121.definition_levels_byte_length; - repetition_levels_byte_length = other121.repetition_levels_byte_length; - is_compressed = other121.is_compressed; - statistics = std::move(other121.statistics); - __isset = other121.__isset; -} -DataPageHeaderV2& DataPageHeaderV2::operator=(const DataPageHeaderV2& other122) { - num_values = other122.num_values; - num_nulls = other122.num_nulls; - num_rows = other122.num_rows; - encoding = other122.encoding; - definition_levels_byte_length = other122.definition_levels_byte_length; - repetition_levels_byte_length = other122.repetition_levels_byte_length; - is_compressed = other122.is_compressed; - statistics = other122.statistics; - __isset = other122.__isset; +DataPageHeaderV2::DataPageHeaderV2(const DataPageHeaderV2& other150) { + num_values = other150.num_values; + num_nulls = other150.num_nulls; + num_rows = other150.num_rows; + encoding = other150.encoding; + definition_levels_byte_length = other150.definition_levels_byte_length; + repetition_levels_byte_length = other150.repetition_levels_byte_length; + is_compressed = other150.is_compressed; + statistics = other150.statistics; + __isset = other150.__isset; +} +DataPageHeaderV2::DataPageHeaderV2(DataPageHeaderV2&& other151) noexcept { + num_values = other151.num_values; + num_nulls = other151.num_nulls; + num_rows = other151.num_rows; + encoding = other151.encoding; + definition_levels_byte_length = other151.definition_levels_byte_length; + repetition_levels_byte_length = other151.repetition_levels_byte_length; + is_compressed = other151.is_compressed; + statistics = std::move(other151.statistics); + __isset = other151.__isset; +} +DataPageHeaderV2& DataPageHeaderV2::operator=(const DataPageHeaderV2& other152) { + num_values = other152.num_values; + num_nulls = other152.num_nulls; + num_rows = other152.num_rows; + encoding = other152.encoding; + definition_levels_byte_length = other152.definition_levels_byte_length; + repetition_levels_byte_length = other152.repetition_levels_byte_length; + is_compressed = other152.is_compressed; + statistics = other152.statistics; + __isset = other152.__isset; return *this; } -DataPageHeaderV2& DataPageHeaderV2::operator=(DataPageHeaderV2&& other123) noexcept { - num_values = other123.num_values; - num_nulls = other123.num_nulls; - num_rows = other123.num_rows; - encoding = other123.encoding; - definition_levels_byte_length = other123.definition_levels_byte_length; - repetition_levels_byte_length = other123.repetition_levels_byte_length; - is_compressed = other123.is_compressed; - statistics = std::move(other123.statistics); - __isset = other123.__isset; +DataPageHeaderV2& DataPageHeaderV2::operator=(DataPageHeaderV2&& other153) noexcept { + num_values = other153.num_values; + num_nulls = other153.num_nulls; + num_rows = other153.num_rows; + encoding = other153.encoding; + definition_levels_byte_length = other153.definition_levels_byte_length; + repetition_levels_byte_length = other153.repetition_levels_byte_length; + is_compressed = other153.is_compressed; + statistics = std::move(other153.statistics); + __isset = other153.__isset; return *this; } void DataPageHeaderV2::printTo(std::ostream& out) const { @@ -2222,18 +2657,18 @@ void swap(SplitBlockAlgorithm &a, SplitBlockAlgorithm &b) { (void) b; } -SplitBlockAlgorithm::SplitBlockAlgorithm(const SplitBlockAlgorithm& other124) noexcept { - (void) other124; +SplitBlockAlgorithm::SplitBlockAlgorithm(const SplitBlockAlgorithm& other154) noexcept { + (void) other154; } -SplitBlockAlgorithm::SplitBlockAlgorithm(SplitBlockAlgorithm&& other125) noexcept { - (void) other125; +SplitBlockAlgorithm::SplitBlockAlgorithm(SplitBlockAlgorithm&& other155) noexcept { + (void) other155; } -SplitBlockAlgorithm& SplitBlockAlgorithm::operator=(const SplitBlockAlgorithm& other126) noexcept { - (void) other126; +SplitBlockAlgorithm& SplitBlockAlgorithm::operator=(const SplitBlockAlgorithm& other156) noexcept { + (void) other156; return *this; } -SplitBlockAlgorithm& SplitBlockAlgorithm::operator=(SplitBlockAlgorithm&& other127) noexcept { - (void) other127; +SplitBlockAlgorithm& SplitBlockAlgorithm::operator=(SplitBlockAlgorithm&& other157) noexcept { + (void) other157; return *this; } void SplitBlockAlgorithm::printTo(std::ostream& out) const { @@ -2264,22 +2699,22 @@ void swap(BloomFilterAlgorithm &a, BloomFilterAlgorithm &b) { swap(a.__isset, b.__isset); } -BloomFilterAlgorithm::BloomFilterAlgorithm(const BloomFilterAlgorithm& other128) noexcept { - BLOCK = other128.BLOCK; - __isset = other128.__isset; +BloomFilterAlgorithm::BloomFilterAlgorithm(const BloomFilterAlgorithm& other158) noexcept { + BLOCK = other158.BLOCK; + __isset = other158.__isset; } -BloomFilterAlgorithm::BloomFilterAlgorithm(BloomFilterAlgorithm&& other129) noexcept { - BLOCK = std::move(other129.BLOCK); - __isset = other129.__isset; +BloomFilterAlgorithm::BloomFilterAlgorithm(BloomFilterAlgorithm&& other159) noexcept { + BLOCK = std::move(other159.BLOCK); + __isset = other159.__isset; } -BloomFilterAlgorithm& BloomFilterAlgorithm::operator=(const BloomFilterAlgorithm& other130) noexcept { - BLOCK = other130.BLOCK; - __isset = other130.__isset; +BloomFilterAlgorithm& BloomFilterAlgorithm::operator=(const BloomFilterAlgorithm& other160) noexcept { + BLOCK = other160.BLOCK; + __isset = other160.__isset; return *this; } -BloomFilterAlgorithm& BloomFilterAlgorithm::operator=(BloomFilterAlgorithm&& other131) noexcept { - BLOCK = std::move(other131.BLOCK); - __isset = other131.__isset; +BloomFilterAlgorithm& BloomFilterAlgorithm::operator=(BloomFilterAlgorithm&& other161) noexcept { + BLOCK = std::move(other161.BLOCK); + __isset = other161.__isset; return *this; } void BloomFilterAlgorithm::printTo(std::ostream& out) const { @@ -2306,18 +2741,18 @@ void swap(XxHash &a, XxHash &b) { (void) b; } -XxHash::XxHash(const XxHash& other132) noexcept { - (void) other132; +XxHash::XxHash(const XxHash& other162) noexcept { + (void) other162; } -XxHash::XxHash(XxHash&& other133) noexcept { - (void) other133; +XxHash::XxHash(XxHash&& other163) noexcept { + (void) other163; } -XxHash& XxHash::operator=(const XxHash& other134) noexcept { - (void) other134; +XxHash& XxHash::operator=(const XxHash& other164) noexcept { + (void) other164; return *this; } -XxHash& XxHash::operator=(XxHash&& other135) noexcept { - (void) other135; +XxHash& XxHash::operator=(XxHash&& other165) noexcept { + (void) other165; return *this; } void XxHash::printTo(std::ostream& out) const { @@ -2348,22 +2783,22 @@ void swap(BloomFilterHash &a, BloomFilterHash &b) { swap(a.__isset, b.__isset); } -BloomFilterHash::BloomFilterHash(const BloomFilterHash& other136) noexcept { - XXHASH = other136.XXHASH; - __isset = other136.__isset; +BloomFilterHash::BloomFilterHash(const BloomFilterHash& other166) noexcept { + XXHASH = other166.XXHASH; + __isset = other166.__isset; } -BloomFilterHash::BloomFilterHash(BloomFilterHash&& other137) noexcept { - XXHASH = std::move(other137.XXHASH); - __isset = other137.__isset; +BloomFilterHash::BloomFilterHash(BloomFilterHash&& other167) noexcept { + XXHASH = std::move(other167.XXHASH); + __isset = other167.__isset; } -BloomFilterHash& BloomFilterHash::operator=(const BloomFilterHash& other138) noexcept { - XXHASH = other138.XXHASH; - __isset = other138.__isset; +BloomFilterHash& BloomFilterHash::operator=(const BloomFilterHash& other168) noexcept { + XXHASH = other168.XXHASH; + __isset = other168.__isset; return *this; } -BloomFilterHash& BloomFilterHash::operator=(BloomFilterHash&& other139) noexcept { - XXHASH = std::move(other139.XXHASH); - __isset = other139.__isset; +BloomFilterHash& BloomFilterHash::operator=(BloomFilterHash&& other169) noexcept { + XXHASH = std::move(other169.XXHASH); + __isset = other169.__isset; return *this; } void BloomFilterHash::printTo(std::ostream& out) const { @@ -2390,18 +2825,18 @@ void swap(Uncompressed &a, Uncompressed &b) { (void) b; } -Uncompressed::Uncompressed(const Uncompressed& other140) noexcept { - (void) other140; +Uncompressed::Uncompressed(const Uncompressed& other170) noexcept { + (void) other170; } -Uncompressed::Uncompressed(Uncompressed&& other141) noexcept { - (void) other141; +Uncompressed::Uncompressed(Uncompressed&& other171) noexcept { + (void) other171; } -Uncompressed& Uncompressed::operator=(const Uncompressed& other142) noexcept { - (void) other142; +Uncompressed& Uncompressed::operator=(const Uncompressed& other172) noexcept { + (void) other172; return *this; } -Uncompressed& Uncompressed::operator=(Uncompressed&& other143) noexcept { - (void) other143; +Uncompressed& Uncompressed::operator=(Uncompressed&& other173) noexcept { + (void) other173; return *this; } void Uncompressed::printTo(std::ostream& out) const { @@ -2432,22 +2867,22 @@ void swap(BloomFilterCompression &a, BloomFilterCompression &b) { swap(a.__isset, b.__isset); } -BloomFilterCompression::BloomFilterCompression(const BloomFilterCompression& other144) noexcept { - UNCOMPRESSED = other144.UNCOMPRESSED; - __isset = other144.__isset; +BloomFilterCompression::BloomFilterCompression(const BloomFilterCompression& other174) noexcept { + UNCOMPRESSED = other174.UNCOMPRESSED; + __isset = other174.__isset; } -BloomFilterCompression::BloomFilterCompression(BloomFilterCompression&& other145) noexcept { - UNCOMPRESSED = std::move(other145.UNCOMPRESSED); - __isset = other145.__isset; +BloomFilterCompression::BloomFilterCompression(BloomFilterCompression&& other175) noexcept { + UNCOMPRESSED = std::move(other175.UNCOMPRESSED); + __isset = other175.__isset; } -BloomFilterCompression& BloomFilterCompression::operator=(const BloomFilterCompression& other146) noexcept { - UNCOMPRESSED = other146.UNCOMPRESSED; - __isset = other146.__isset; +BloomFilterCompression& BloomFilterCompression::operator=(const BloomFilterCompression& other176) noexcept { + UNCOMPRESSED = other176.UNCOMPRESSED; + __isset = other176.__isset; return *this; } -BloomFilterCompression& BloomFilterCompression::operator=(BloomFilterCompression&& other147) noexcept { - UNCOMPRESSED = std::move(other147.UNCOMPRESSED); - __isset = other147.__isset; +BloomFilterCompression& BloomFilterCompression::operator=(BloomFilterCompression&& other177) noexcept { + UNCOMPRESSED = std::move(other177.UNCOMPRESSED); + __isset = other177.__isset; return *this; } void BloomFilterCompression::printTo(std::ostream& out) const { @@ -2492,30 +2927,30 @@ void swap(BloomFilterHeader &a, BloomFilterHeader &b) { swap(a.compression, b.compression); } -BloomFilterHeader::BloomFilterHeader(const BloomFilterHeader& other148) noexcept { - numBytes = other148.numBytes; - algorithm = other148.algorithm; - hash = other148.hash; - compression = other148.compression; +BloomFilterHeader::BloomFilterHeader(const BloomFilterHeader& other178) noexcept { + numBytes = other178.numBytes; + algorithm = other178.algorithm; + hash = other178.hash; + compression = other178.compression; } -BloomFilterHeader::BloomFilterHeader(BloomFilterHeader&& other149) noexcept { - numBytes = other149.numBytes; - algorithm = std::move(other149.algorithm); - hash = std::move(other149.hash); - compression = std::move(other149.compression); +BloomFilterHeader::BloomFilterHeader(BloomFilterHeader&& other179) noexcept { + numBytes = other179.numBytes; + algorithm = std::move(other179.algorithm); + hash = std::move(other179.hash); + compression = std::move(other179.compression); } -BloomFilterHeader& BloomFilterHeader::operator=(const BloomFilterHeader& other150) noexcept { - numBytes = other150.numBytes; - algorithm = other150.algorithm; - hash = other150.hash; - compression = other150.compression; +BloomFilterHeader& BloomFilterHeader::operator=(const BloomFilterHeader& other180) noexcept { + numBytes = other180.numBytes; + algorithm = other180.algorithm; + hash = other180.hash; + compression = other180.compression; return *this; } -BloomFilterHeader& BloomFilterHeader::operator=(BloomFilterHeader&& other151) noexcept { - numBytes = other151.numBytes; - algorithm = std::move(other151.algorithm); - hash = std::move(other151.hash); - compression = std::move(other151.compression); +BloomFilterHeader& BloomFilterHeader::operator=(BloomFilterHeader&& other181) noexcept { + numBytes = other181.numBytes; + algorithm = std::move(other181.algorithm); + hash = std::move(other181.hash); + compression = std::move(other181.compression); return *this; } void BloomFilterHeader::printTo(std::ostream& out) const { @@ -2589,50 +3024,50 @@ void swap(PageHeader &a, PageHeader &b) { swap(a.__isset, b.__isset); } -PageHeader::PageHeader(const PageHeader& other153) { - type = other153.type; - uncompressed_page_size = other153.uncompressed_page_size; - compressed_page_size = other153.compressed_page_size; - crc = other153.crc; - data_page_header = other153.data_page_header; - index_page_header = other153.index_page_header; - dictionary_page_header = other153.dictionary_page_header; - data_page_header_v2 = other153.data_page_header_v2; - __isset = other153.__isset; -} -PageHeader::PageHeader(PageHeader&& other154) noexcept { - type = other154.type; - uncompressed_page_size = other154.uncompressed_page_size; - compressed_page_size = other154.compressed_page_size; - crc = other154.crc; - data_page_header = std::move(other154.data_page_header); - index_page_header = std::move(other154.index_page_header); - dictionary_page_header = std::move(other154.dictionary_page_header); - data_page_header_v2 = std::move(other154.data_page_header_v2); - __isset = other154.__isset; -} -PageHeader& PageHeader::operator=(const PageHeader& other155) { - type = other155.type; - uncompressed_page_size = other155.uncompressed_page_size; - compressed_page_size = other155.compressed_page_size; - crc = other155.crc; - data_page_header = other155.data_page_header; - index_page_header = other155.index_page_header; - dictionary_page_header = other155.dictionary_page_header; - data_page_header_v2 = other155.data_page_header_v2; - __isset = other155.__isset; +PageHeader::PageHeader(const PageHeader& other183) { + type = other183.type; + uncompressed_page_size = other183.uncompressed_page_size; + compressed_page_size = other183.compressed_page_size; + crc = other183.crc; + data_page_header = other183.data_page_header; + index_page_header = other183.index_page_header; + dictionary_page_header = other183.dictionary_page_header; + data_page_header_v2 = other183.data_page_header_v2; + __isset = other183.__isset; +} +PageHeader::PageHeader(PageHeader&& other184) noexcept { + type = other184.type; + uncompressed_page_size = other184.uncompressed_page_size; + compressed_page_size = other184.compressed_page_size; + crc = other184.crc; + data_page_header = std::move(other184.data_page_header); + index_page_header = std::move(other184.index_page_header); + dictionary_page_header = std::move(other184.dictionary_page_header); + data_page_header_v2 = std::move(other184.data_page_header_v2); + __isset = other184.__isset; +} +PageHeader& PageHeader::operator=(const PageHeader& other185) { + type = other185.type; + uncompressed_page_size = other185.uncompressed_page_size; + compressed_page_size = other185.compressed_page_size; + crc = other185.crc; + data_page_header = other185.data_page_header; + index_page_header = other185.index_page_header; + dictionary_page_header = other185.dictionary_page_header; + data_page_header_v2 = other185.data_page_header_v2; + __isset = other185.__isset; return *this; } -PageHeader& PageHeader::operator=(PageHeader&& other156) noexcept { - type = other156.type; - uncompressed_page_size = other156.uncompressed_page_size; - compressed_page_size = other156.compressed_page_size; - crc = other156.crc; - data_page_header = std::move(other156.data_page_header); - index_page_header = std::move(other156.index_page_header); - dictionary_page_header = std::move(other156.dictionary_page_header); - data_page_header_v2 = std::move(other156.data_page_header_v2); - __isset = other156.__isset; +PageHeader& PageHeader::operator=(PageHeader&& other186) noexcept { + type = other186.type; + uncompressed_page_size = other186.uncompressed_page_size; + compressed_page_size = other186.compressed_page_size; + crc = other186.crc; + data_page_header = std::move(other186.data_page_header); + index_page_header = std::move(other186.index_page_header); + dictionary_page_header = std::move(other186.dictionary_page_header); + data_page_header_v2 = std::move(other186.data_page_header_v2); + __isset = other186.__isset; return *this; } void PageHeader::printTo(std::ostream& out) const { @@ -2676,26 +3111,26 @@ void swap(KeyValue &a, KeyValue &b) { swap(a.__isset, b.__isset); } -KeyValue::KeyValue(const KeyValue& other157) { - key = other157.key; - value = other157.value; - __isset = other157.__isset; +KeyValue::KeyValue(const KeyValue& other187) { + key = other187.key; + value = other187.value; + __isset = other187.__isset; } -KeyValue::KeyValue(KeyValue&& other158) noexcept { - key = std::move(other158.key); - value = std::move(other158.value); - __isset = other158.__isset; +KeyValue::KeyValue(KeyValue&& other188) noexcept { + key = std::move(other188.key); + value = std::move(other188.value); + __isset = other188.__isset; } -KeyValue& KeyValue::operator=(const KeyValue& other159) { - key = other159.key; - value = other159.value; - __isset = other159.__isset; +KeyValue& KeyValue::operator=(const KeyValue& other189) { + key = other189.key; + value = other189.value; + __isset = other189.__isset; return *this; } -KeyValue& KeyValue::operator=(KeyValue&& other160) noexcept { - key = std::move(other160.key); - value = std::move(other160.value); - __isset = other160.__isset; +KeyValue& KeyValue::operator=(KeyValue&& other190) noexcept { + key = std::move(other190.key); + value = std::move(other190.value); + __isset = other190.__isset; return *this; } void KeyValue::printTo(std::ostream& out) const { @@ -2736,26 +3171,26 @@ void swap(SortingColumn &a, SortingColumn &b) { swap(a.nulls_first, b.nulls_first); } -SortingColumn::SortingColumn(const SortingColumn& other161) noexcept { - column_idx = other161.column_idx; - descending = other161.descending; - nulls_first = other161.nulls_first; +SortingColumn::SortingColumn(const SortingColumn& other191) noexcept { + column_idx = other191.column_idx; + descending = other191.descending; + nulls_first = other191.nulls_first; } -SortingColumn::SortingColumn(SortingColumn&& other162) noexcept { - column_idx = other162.column_idx; - descending = other162.descending; - nulls_first = other162.nulls_first; +SortingColumn::SortingColumn(SortingColumn&& other192) noexcept { + column_idx = other192.column_idx; + descending = other192.descending; + nulls_first = other192.nulls_first; } -SortingColumn& SortingColumn::operator=(const SortingColumn& other163) noexcept { - column_idx = other163.column_idx; - descending = other163.descending; - nulls_first = other163.nulls_first; +SortingColumn& SortingColumn::operator=(const SortingColumn& other193) noexcept { + column_idx = other193.column_idx; + descending = other193.descending; + nulls_first = other193.nulls_first; return *this; } -SortingColumn& SortingColumn::operator=(SortingColumn&& other164) noexcept { - column_idx = other164.column_idx; - descending = other164.descending; - nulls_first = other164.nulls_first; +SortingColumn& SortingColumn::operator=(SortingColumn&& other194) noexcept { + column_idx = other194.column_idx; + descending = other194.descending; + nulls_first = other194.nulls_first; return *this; } void SortingColumn::printTo(std::ostream& out) const { @@ -2797,26 +3232,26 @@ void swap(PageEncodingStats &a, PageEncodingStats &b) { swap(a.count, b.count); } -PageEncodingStats::PageEncodingStats(const PageEncodingStats& other167) noexcept { - page_type = other167.page_type; - encoding = other167.encoding; - count = other167.count; +PageEncodingStats::PageEncodingStats(const PageEncodingStats& other197) noexcept { + page_type = other197.page_type; + encoding = other197.encoding; + count = other197.count; } -PageEncodingStats::PageEncodingStats(PageEncodingStats&& other168) noexcept { - page_type = other168.page_type; - encoding = other168.encoding; - count = other168.count; +PageEncodingStats::PageEncodingStats(PageEncodingStats&& other198) noexcept { + page_type = other198.page_type; + encoding = other198.encoding; + count = other198.count; } -PageEncodingStats& PageEncodingStats::operator=(const PageEncodingStats& other169) noexcept { - page_type = other169.page_type; - encoding = other169.encoding; - count = other169.count; +PageEncodingStats& PageEncodingStats::operator=(const PageEncodingStats& other199) noexcept { + page_type = other199.page_type; + encoding = other199.encoding; + count = other199.count; return *this; } -PageEncodingStats& PageEncodingStats::operator=(PageEncodingStats&& other170) noexcept { - page_type = other170.page_type; - encoding = other170.encoding; - count = other170.count; +PageEncodingStats& PageEncodingStats::operator=(PageEncodingStats&& other200) noexcept { + page_type = other200.page_type; + encoding = other200.encoding; + count = other200.count; return *this; } void PageEncodingStats::printTo(std::ostream& out) const { @@ -2932,82 +3367,82 @@ void swap(ColumnMetaData &a, ColumnMetaData &b) { swap(a.__isset, b.__isset); } -ColumnMetaData::ColumnMetaData(const ColumnMetaData& other198) { - type = other198.type; - encodings = other198.encodings; - path_in_schema = other198.path_in_schema; - codec = other198.codec; - num_values = other198.num_values; - total_uncompressed_size = other198.total_uncompressed_size; - total_compressed_size = other198.total_compressed_size; - key_value_metadata = other198.key_value_metadata; - data_page_offset = other198.data_page_offset; - index_page_offset = other198.index_page_offset; - dictionary_page_offset = other198.dictionary_page_offset; - statistics = other198.statistics; - encoding_stats = other198.encoding_stats; - bloom_filter_offset = other198.bloom_filter_offset; - bloom_filter_length = other198.bloom_filter_length; - size_statistics = other198.size_statistics; - __isset = other198.__isset; -} -ColumnMetaData::ColumnMetaData(ColumnMetaData&& other199) noexcept { - type = other199.type; - encodings = std::move(other199.encodings); - path_in_schema = std::move(other199.path_in_schema); - codec = other199.codec; - num_values = other199.num_values; - total_uncompressed_size = other199.total_uncompressed_size; - total_compressed_size = other199.total_compressed_size; - key_value_metadata = std::move(other199.key_value_metadata); - data_page_offset = other199.data_page_offset; - index_page_offset = other199.index_page_offset; - dictionary_page_offset = other199.dictionary_page_offset; - statistics = std::move(other199.statistics); - encoding_stats = std::move(other199.encoding_stats); - bloom_filter_offset = other199.bloom_filter_offset; - bloom_filter_length = other199.bloom_filter_length; - size_statistics = std::move(other199.size_statistics); - __isset = other199.__isset; -} -ColumnMetaData& ColumnMetaData::operator=(const ColumnMetaData& other200) { - type = other200.type; - encodings = other200.encodings; - path_in_schema = other200.path_in_schema; - codec = other200.codec; - num_values = other200.num_values; - total_uncompressed_size = other200.total_uncompressed_size; - total_compressed_size = other200.total_compressed_size; - key_value_metadata = other200.key_value_metadata; - data_page_offset = other200.data_page_offset; - index_page_offset = other200.index_page_offset; - dictionary_page_offset = other200.dictionary_page_offset; - statistics = other200.statistics; - encoding_stats = other200.encoding_stats; - bloom_filter_offset = other200.bloom_filter_offset; - bloom_filter_length = other200.bloom_filter_length; - size_statistics = other200.size_statistics; - __isset = other200.__isset; +ColumnMetaData::ColumnMetaData(const ColumnMetaData& other228) { + type = other228.type; + encodings = other228.encodings; + path_in_schema = other228.path_in_schema; + codec = other228.codec; + num_values = other228.num_values; + total_uncompressed_size = other228.total_uncompressed_size; + total_compressed_size = other228.total_compressed_size; + key_value_metadata = other228.key_value_metadata; + data_page_offset = other228.data_page_offset; + index_page_offset = other228.index_page_offset; + dictionary_page_offset = other228.dictionary_page_offset; + statistics = other228.statistics; + encoding_stats = other228.encoding_stats; + bloom_filter_offset = other228.bloom_filter_offset; + bloom_filter_length = other228.bloom_filter_length; + size_statistics = other228.size_statistics; + __isset = other228.__isset; +} +ColumnMetaData::ColumnMetaData(ColumnMetaData&& other229) noexcept { + type = other229.type; + encodings = std::move(other229.encodings); + path_in_schema = std::move(other229.path_in_schema); + codec = other229.codec; + num_values = other229.num_values; + total_uncompressed_size = other229.total_uncompressed_size; + total_compressed_size = other229.total_compressed_size; + key_value_metadata = std::move(other229.key_value_metadata); + data_page_offset = other229.data_page_offset; + index_page_offset = other229.index_page_offset; + dictionary_page_offset = other229.dictionary_page_offset; + statistics = std::move(other229.statistics); + encoding_stats = std::move(other229.encoding_stats); + bloom_filter_offset = other229.bloom_filter_offset; + bloom_filter_length = other229.bloom_filter_length; + size_statistics = std::move(other229.size_statistics); + __isset = other229.__isset; +} +ColumnMetaData& ColumnMetaData::operator=(const ColumnMetaData& other230) { + type = other230.type; + encodings = other230.encodings; + path_in_schema = other230.path_in_schema; + codec = other230.codec; + num_values = other230.num_values; + total_uncompressed_size = other230.total_uncompressed_size; + total_compressed_size = other230.total_compressed_size; + key_value_metadata = other230.key_value_metadata; + data_page_offset = other230.data_page_offset; + index_page_offset = other230.index_page_offset; + dictionary_page_offset = other230.dictionary_page_offset; + statistics = other230.statistics; + encoding_stats = other230.encoding_stats; + bloom_filter_offset = other230.bloom_filter_offset; + bloom_filter_length = other230.bloom_filter_length; + size_statistics = other230.size_statistics; + __isset = other230.__isset; return *this; } -ColumnMetaData& ColumnMetaData::operator=(ColumnMetaData&& other201) noexcept { - type = other201.type; - encodings = std::move(other201.encodings); - path_in_schema = std::move(other201.path_in_schema); - codec = other201.codec; - num_values = other201.num_values; - total_uncompressed_size = other201.total_uncompressed_size; - total_compressed_size = other201.total_compressed_size; - key_value_metadata = std::move(other201.key_value_metadata); - data_page_offset = other201.data_page_offset; - index_page_offset = other201.index_page_offset; - dictionary_page_offset = other201.dictionary_page_offset; - statistics = std::move(other201.statistics); - encoding_stats = std::move(other201.encoding_stats); - bloom_filter_offset = other201.bloom_filter_offset; - bloom_filter_length = other201.bloom_filter_length; - size_statistics = std::move(other201.size_statistics); - __isset = other201.__isset; +ColumnMetaData& ColumnMetaData::operator=(ColumnMetaData&& other231) noexcept { + type = other231.type; + encodings = std::move(other231.encodings); + path_in_schema = std::move(other231.path_in_schema); + codec = other231.codec; + num_values = other231.num_values; + total_uncompressed_size = other231.total_uncompressed_size; + total_compressed_size = other231.total_compressed_size; + key_value_metadata = std::move(other231.key_value_metadata); + data_page_offset = other231.data_page_offset; + index_page_offset = other231.index_page_offset; + dictionary_page_offset = other231.dictionary_page_offset; + statistics = std::move(other231.statistics); + encoding_stats = std::move(other231.encoding_stats); + bloom_filter_offset = other231.bloom_filter_offset; + bloom_filter_length = other231.bloom_filter_length; + size_statistics = std::move(other231.size_statistics); + __isset = other231.__isset; return *this; } void ColumnMetaData::printTo(std::ostream& out) const { @@ -3049,18 +3484,18 @@ void swap(EncryptionWithFooterKey &a, EncryptionWithFooterKey &b) { (void) b; } -EncryptionWithFooterKey::EncryptionWithFooterKey(const EncryptionWithFooterKey& other202) noexcept { - (void) other202; +EncryptionWithFooterKey::EncryptionWithFooterKey(const EncryptionWithFooterKey& other232) noexcept { + (void) other232; } -EncryptionWithFooterKey::EncryptionWithFooterKey(EncryptionWithFooterKey&& other203) noexcept { - (void) other203; +EncryptionWithFooterKey::EncryptionWithFooterKey(EncryptionWithFooterKey&& other233) noexcept { + (void) other233; } -EncryptionWithFooterKey& EncryptionWithFooterKey::operator=(const EncryptionWithFooterKey& other204) noexcept { - (void) other204; +EncryptionWithFooterKey& EncryptionWithFooterKey::operator=(const EncryptionWithFooterKey& other234) noexcept { + (void) other234; return *this; } -EncryptionWithFooterKey& EncryptionWithFooterKey::operator=(EncryptionWithFooterKey&& other205) noexcept { - (void) other205; +EncryptionWithFooterKey& EncryptionWithFooterKey::operator=(EncryptionWithFooterKey&& other235) noexcept { + (void) other235; return *this; } void EncryptionWithFooterKey::printTo(std::ostream& out) const { @@ -3096,26 +3531,26 @@ void swap(EncryptionWithColumnKey &a, EncryptionWithColumnKey &b) { swap(a.__isset, b.__isset); } -EncryptionWithColumnKey::EncryptionWithColumnKey(const EncryptionWithColumnKey& other212) { - path_in_schema = other212.path_in_schema; - key_metadata = other212.key_metadata; - __isset = other212.__isset; +EncryptionWithColumnKey::EncryptionWithColumnKey(const EncryptionWithColumnKey& other242) { + path_in_schema = other242.path_in_schema; + key_metadata = other242.key_metadata; + __isset = other242.__isset; } -EncryptionWithColumnKey::EncryptionWithColumnKey(EncryptionWithColumnKey&& other213) noexcept { - path_in_schema = std::move(other213.path_in_schema); - key_metadata = std::move(other213.key_metadata); - __isset = other213.__isset; +EncryptionWithColumnKey::EncryptionWithColumnKey(EncryptionWithColumnKey&& other243) noexcept { + path_in_schema = std::move(other243.path_in_schema); + key_metadata = std::move(other243.key_metadata); + __isset = other243.__isset; } -EncryptionWithColumnKey& EncryptionWithColumnKey::operator=(const EncryptionWithColumnKey& other214) { - path_in_schema = other214.path_in_schema; - key_metadata = other214.key_metadata; - __isset = other214.__isset; +EncryptionWithColumnKey& EncryptionWithColumnKey::operator=(const EncryptionWithColumnKey& other244) { + path_in_schema = other244.path_in_schema; + key_metadata = other244.key_metadata; + __isset = other244.__isset; return *this; } -EncryptionWithColumnKey& EncryptionWithColumnKey::operator=(EncryptionWithColumnKey&& other215) noexcept { - path_in_schema = std::move(other215.path_in_schema); - key_metadata = std::move(other215.key_metadata); - __isset = other215.__isset; +EncryptionWithColumnKey& EncryptionWithColumnKey::operator=(EncryptionWithColumnKey&& other245) noexcept { + path_in_schema = std::move(other245.path_in_schema); + key_metadata = std::move(other245.key_metadata); + __isset = other245.__isset; return *this; } void EncryptionWithColumnKey::printTo(std::ostream& out) const { @@ -3154,26 +3589,26 @@ void swap(ColumnCryptoMetaData &a, ColumnCryptoMetaData &b) { swap(a.__isset, b.__isset); } -ColumnCryptoMetaData::ColumnCryptoMetaData(const ColumnCryptoMetaData& other216) { - ENCRYPTION_WITH_FOOTER_KEY = other216.ENCRYPTION_WITH_FOOTER_KEY; - ENCRYPTION_WITH_COLUMN_KEY = other216.ENCRYPTION_WITH_COLUMN_KEY; - __isset = other216.__isset; +ColumnCryptoMetaData::ColumnCryptoMetaData(const ColumnCryptoMetaData& other246) { + ENCRYPTION_WITH_FOOTER_KEY = other246.ENCRYPTION_WITH_FOOTER_KEY; + ENCRYPTION_WITH_COLUMN_KEY = other246.ENCRYPTION_WITH_COLUMN_KEY; + __isset = other246.__isset; } -ColumnCryptoMetaData::ColumnCryptoMetaData(ColumnCryptoMetaData&& other217) noexcept { - ENCRYPTION_WITH_FOOTER_KEY = std::move(other217.ENCRYPTION_WITH_FOOTER_KEY); - ENCRYPTION_WITH_COLUMN_KEY = std::move(other217.ENCRYPTION_WITH_COLUMN_KEY); - __isset = other217.__isset; +ColumnCryptoMetaData::ColumnCryptoMetaData(ColumnCryptoMetaData&& other247) noexcept { + ENCRYPTION_WITH_FOOTER_KEY = std::move(other247.ENCRYPTION_WITH_FOOTER_KEY); + ENCRYPTION_WITH_COLUMN_KEY = std::move(other247.ENCRYPTION_WITH_COLUMN_KEY); + __isset = other247.__isset; } -ColumnCryptoMetaData& ColumnCryptoMetaData::operator=(const ColumnCryptoMetaData& other218) { - ENCRYPTION_WITH_FOOTER_KEY = other218.ENCRYPTION_WITH_FOOTER_KEY; - ENCRYPTION_WITH_COLUMN_KEY = other218.ENCRYPTION_WITH_COLUMN_KEY; - __isset = other218.__isset; +ColumnCryptoMetaData& ColumnCryptoMetaData::operator=(const ColumnCryptoMetaData& other248) { + ENCRYPTION_WITH_FOOTER_KEY = other248.ENCRYPTION_WITH_FOOTER_KEY; + ENCRYPTION_WITH_COLUMN_KEY = other248.ENCRYPTION_WITH_COLUMN_KEY; + __isset = other248.__isset; return *this; } -ColumnCryptoMetaData& ColumnCryptoMetaData::operator=(ColumnCryptoMetaData&& other219) noexcept { - ENCRYPTION_WITH_FOOTER_KEY = std::move(other219.ENCRYPTION_WITH_FOOTER_KEY); - ENCRYPTION_WITH_COLUMN_KEY = std::move(other219.ENCRYPTION_WITH_COLUMN_KEY); - __isset = other219.__isset; +ColumnCryptoMetaData& ColumnCryptoMetaData::operator=(ColumnCryptoMetaData&& other249) noexcept { + ENCRYPTION_WITH_FOOTER_KEY = std::move(other249.ENCRYPTION_WITH_FOOTER_KEY); + ENCRYPTION_WITH_COLUMN_KEY = std::move(other249.ENCRYPTION_WITH_COLUMN_KEY); + __isset = other249.__isset; return *this; } void ColumnCryptoMetaData::printTo(std::ostream& out) const { @@ -3253,54 +3688,54 @@ void swap(ColumnChunk &a, ColumnChunk &b) { swap(a.__isset, b.__isset); } -ColumnChunk::ColumnChunk(const ColumnChunk& other220) { - file_path = other220.file_path; - file_offset = other220.file_offset; - meta_data = other220.meta_data; - offset_index_offset = other220.offset_index_offset; - offset_index_length = other220.offset_index_length; - column_index_offset = other220.column_index_offset; - column_index_length = other220.column_index_length; - crypto_metadata = other220.crypto_metadata; - encrypted_column_metadata = other220.encrypted_column_metadata; - __isset = other220.__isset; -} -ColumnChunk::ColumnChunk(ColumnChunk&& other221) noexcept { - file_path = std::move(other221.file_path); - file_offset = other221.file_offset; - meta_data = std::move(other221.meta_data); - offset_index_offset = other221.offset_index_offset; - offset_index_length = other221.offset_index_length; - column_index_offset = other221.column_index_offset; - column_index_length = other221.column_index_length; - crypto_metadata = std::move(other221.crypto_metadata); - encrypted_column_metadata = std::move(other221.encrypted_column_metadata); - __isset = other221.__isset; -} -ColumnChunk& ColumnChunk::operator=(const ColumnChunk& other222) { - file_path = other222.file_path; - file_offset = other222.file_offset; - meta_data = other222.meta_data; - offset_index_offset = other222.offset_index_offset; - offset_index_length = other222.offset_index_length; - column_index_offset = other222.column_index_offset; - column_index_length = other222.column_index_length; - crypto_metadata = other222.crypto_metadata; - encrypted_column_metadata = other222.encrypted_column_metadata; - __isset = other222.__isset; +ColumnChunk::ColumnChunk(const ColumnChunk& other250) { + file_path = other250.file_path; + file_offset = other250.file_offset; + meta_data = other250.meta_data; + offset_index_offset = other250.offset_index_offset; + offset_index_length = other250.offset_index_length; + column_index_offset = other250.column_index_offset; + column_index_length = other250.column_index_length; + crypto_metadata = other250.crypto_metadata; + encrypted_column_metadata = other250.encrypted_column_metadata; + __isset = other250.__isset; +} +ColumnChunk::ColumnChunk(ColumnChunk&& other251) noexcept { + file_path = std::move(other251.file_path); + file_offset = other251.file_offset; + meta_data = std::move(other251.meta_data); + offset_index_offset = other251.offset_index_offset; + offset_index_length = other251.offset_index_length; + column_index_offset = other251.column_index_offset; + column_index_length = other251.column_index_length; + crypto_metadata = std::move(other251.crypto_metadata); + encrypted_column_metadata = std::move(other251.encrypted_column_metadata); + __isset = other251.__isset; +} +ColumnChunk& ColumnChunk::operator=(const ColumnChunk& other252) { + file_path = other252.file_path; + file_offset = other252.file_offset; + meta_data = other252.meta_data; + offset_index_offset = other252.offset_index_offset; + offset_index_length = other252.offset_index_length; + column_index_offset = other252.column_index_offset; + column_index_length = other252.column_index_length; + crypto_metadata = other252.crypto_metadata; + encrypted_column_metadata = other252.encrypted_column_metadata; + __isset = other252.__isset; return *this; } -ColumnChunk& ColumnChunk::operator=(ColumnChunk&& other223) noexcept { - file_path = std::move(other223.file_path); - file_offset = other223.file_offset; - meta_data = std::move(other223.meta_data); - offset_index_offset = other223.offset_index_offset; - offset_index_length = other223.offset_index_length; - column_index_offset = other223.column_index_offset; - column_index_length = other223.column_index_length; - crypto_metadata = std::move(other223.crypto_metadata); - encrypted_column_metadata = std::move(other223.encrypted_column_metadata); - __isset = other223.__isset; +ColumnChunk& ColumnChunk::operator=(ColumnChunk&& other253) noexcept { + file_path = std::move(other253.file_path); + file_offset = other253.file_offset; + meta_data = std::move(other253.meta_data); + offset_index_offset = other253.offset_index_offset; + offset_index_length = other253.offset_index_length; + column_index_offset = other253.column_index_offset; + column_index_length = other253.column_index_length; + crypto_metadata = std::move(other253.crypto_metadata); + encrypted_column_metadata = std::move(other253.encrypted_column_metadata); + __isset = other253.__isset; return *this; } void ColumnChunk::printTo(std::ostream& out) const { @@ -3373,46 +3808,46 @@ void swap(RowGroup &a, RowGroup &b) { swap(a.__isset, b.__isset); } -RowGroup::RowGroup(const RowGroup& other236) { - columns = other236.columns; - total_byte_size = other236.total_byte_size; - num_rows = other236.num_rows; - sorting_columns = other236.sorting_columns; - file_offset = other236.file_offset; - total_compressed_size = other236.total_compressed_size; - ordinal = other236.ordinal; - __isset = other236.__isset; -} -RowGroup::RowGroup(RowGroup&& other237) noexcept { - columns = std::move(other237.columns); - total_byte_size = other237.total_byte_size; - num_rows = other237.num_rows; - sorting_columns = std::move(other237.sorting_columns); - file_offset = other237.file_offset; - total_compressed_size = other237.total_compressed_size; - ordinal = other237.ordinal; - __isset = other237.__isset; -} -RowGroup& RowGroup::operator=(const RowGroup& other238) { - columns = other238.columns; - total_byte_size = other238.total_byte_size; - num_rows = other238.num_rows; - sorting_columns = other238.sorting_columns; - file_offset = other238.file_offset; - total_compressed_size = other238.total_compressed_size; - ordinal = other238.ordinal; - __isset = other238.__isset; +RowGroup::RowGroup(const RowGroup& other266) { + columns = other266.columns; + total_byte_size = other266.total_byte_size; + num_rows = other266.num_rows; + sorting_columns = other266.sorting_columns; + file_offset = other266.file_offset; + total_compressed_size = other266.total_compressed_size; + ordinal = other266.ordinal; + __isset = other266.__isset; +} +RowGroup::RowGroup(RowGroup&& other267) noexcept { + columns = std::move(other267.columns); + total_byte_size = other267.total_byte_size; + num_rows = other267.num_rows; + sorting_columns = std::move(other267.sorting_columns); + file_offset = other267.file_offset; + total_compressed_size = other267.total_compressed_size; + ordinal = other267.ordinal; + __isset = other267.__isset; +} +RowGroup& RowGroup::operator=(const RowGroup& other268) { + columns = other268.columns; + total_byte_size = other268.total_byte_size; + num_rows = other268.num_rows; + sorting_columns = other268.sorting_columns; + file_offset = other268.file_offset; + total_compressed_size = other268.total_compressed_size; + ordinal = other268.ordinal; + __isset = other268.__isset; return *this; } -RowGroup& RowGroup::operator=(RowGroup&& other239) noexcept { - columns = std::move(other239.columns); - total_byte_size = other239.total_byte_size; - num_rows = other239.num_rows; - sorting_columns = std::move(other239.sorting_columns); - file_offset = other239.file_offset; - total_compressed_size = other239.total_compressed_size; - ordinal = other239.ordinal; - __isset = other239.__isset; +RowGroup& RowGroup::operator=(RowGroup&& other269) noexcept { + columns = std::move(other269.columns); + total_byte_size = other269.total_byte_size; + num_rows = other269.num_rows; + sorting_columns = std::move(other269.sorting_columns); + file_offset = other269.file_offset; + total_compressed_size = other269.total_compressed_size; + ordinal = other269.ordinal; + __isset = other269.__isset; return *this; } void RowGroup::printTo(std::ostream& out) const { @@ -3445,18 +3880,18 @@ void swap(TypeDefinedOrder &a, TypeDefinedOrder &b) { (void) b; } -TypeDefinedOrder::TypeDefinedOrder(const TypeDefinedOrder& other240) noexcept { - (void) other240; +TypeDefinedOrder::TypeDefinedOrder(const TypeDefinedOrder& other270) noexcept { + (void) other270; } -TypeDefinedOrder::TypeDefinedOrder(TypeDefinedOrder&& other241) noexcept { - (void) other241; +TypeDefinedOrder::TypeDefinedOrder(TypeDefinedOrder&& other271) noexcept { + (void) other271; } -TypeDefinedOrder& TypeDefinedOrder::operator=(const TypeDefinedOrder& other242) noexcept { - (void) other242; +TypeDefinedOrder& TypeDefinedOrder::operator=(const TypeDefinedOrder& other272) noexcept { + (void) other272; return *this; } -TypeDefinedOrder& TypeDefinedOrder::operator=(TypeDefinedOrder&& other243) noexcept { - (void) other243; +TypeDefinedOrder& TypeDefinedOrder::operator=(TypeDefinedOrder&& other273) noexcept { + (void) other273; return *this; } void TypeDefinedOrder::printTo(std::ostream& out) const { @@ -3487,22 +3922,22 @@ void swap(ColumnOrder &a, ColumnOrder &b) { swap(a.__isset, b.__isset); } -ColumnOrder::ColumnOrder(const ColumnOrder& other244) noexcept { - TYPE_ORDER = other244.TYPE_ORDER; - __isset = other244.__isset; +ColumnOrder::ColumnOrder(const ColumnOrder& other274) noexcept { + TYPE_ORDER = other274.TYPE_ORDER; + __isset = other274.__isset; } -ColumnOrder::ColumnOrder(ColumnOrder&& other245) noexcept { - TYPE_ORDER = std::move(other245.TYPE_ORDER); - __isset = other245.__isset; +ColumnOrder::ColumnOrder(ColumnOrder&& other275) noexcept { + TYPE_ORDER = std::move(other275.TYPE_ORDER); + __isset = other275.__isset; } -ColumnOrder& ColumnOrder::operator=(const ColumnOrder& other246) noexcept { - TYPE_ORDER = other246.TYPE_ORDER; - __isset = other246.__isset; +ColumnOrder& ColumnOrder::operator=(const ColumnOrder& other276) noexcept { + TYPE_ORDER = other276.TYPE_ORDER; + __isset = other276.__isset; return *this; } -ColumnOrder& ColumnOrder::operator=(ColumnOrder&& other247) noexcept { - TYPE_ORDER = std::move(other247.TYPE_ORDER); - __isset = other247.__isset; +ColumnOrder& ColumnOrder::operator=(ColumnOrder&& other277) noexcept { + TYPE_ORDER = std::move(other277.TYPE_ORDER); + __isset = other277.__isset; return *this; } void ColumnOrder::printTo(std::ostream& out) const { @@ -3542,26 +3977,26 @@ void swap(PageLocation &a, PageLocation &b) { swap(a.first_row_index, b.first_row_index); } -PageLocation::PageLocation(const PageLocation& other248) noexcept { - offset = other248.offset; - compressed_page_size = other248.compressed_page_size; - first_row_index = other248.first_row_index; +PageLocation::PageLocation(const PageLocation& other278) noexcept { + offset = other278.offset; + compressed_page_size = other278.compressed_page_size; + first_row_index = other278.first_row_index; } -PageLocation::PageLocation(PageLocation&& other249) noexcept { - offset = other249.offset; - compressed_page_size = other249.compressed_page_size; - first_row_index = other249.first_row_index; +PageLocation::PageLocation(PageLocation&& other279) noexcept { + offset = other279.offset; + compressed_page_size = other279.compressed_page_size; + first_row_index = other279.first_row_index; } -PageLocation& PageLocation::operator=(const PageLocation& other250) noexcept { - offset = other250.offset; - compressed_page_size = other250.compressed_page_size; - first_row_index = other250.first_row_index; +PageLocation& PageLocation::operator=(const PageLocation& other280) noexcept { + offset = other280.offset; + compressed_page_size = other280.compressed_page_size; + first_row_index = other280.first_row_index; return *this; } -PageLocation& PageLocation::operator=(PageLocation&& other251) noexcept { - offset = other251.offset; - compressed_page_size = other251.compressed_page_size; - first_row_index = other251.first_row_index; +PageLocation& PageLocation::operator=(PageLocation&& other281) noexcept { + offset = other281.offset; + compressed_page_size = other281.compressed_page_size; + first_row_index = other281.first_row_index; return *this; } void PageLocation::printTo(std::ostream& out) const { @@ -3600,26 +4035,26 @@ void swap(OffsetIndex &a, OffsetIndex &b) { swap(a.__isset, b.__isset); } -OffsetIndex::OffsetIndex(const OffsetIndex& other264) { - page_locations = other264.page_locations; - unencoded_byte_array_data_bytes = other264.unencoded_byte_array_data_bytes; - __isset = other264.__isset; +OffsetIndex::OffsetIndex(const OffsetIndex& other294) { + page_locations = other294.page_locations; + unencoded_byte_array_data_bytes = other294.unencoded_byte_array_data_bytes; + __isset = other294.__isset; } -OffsetIndex::OffsetIndex(OffsetIndex&& other265) noexcept { - page_locations = std::move(other265.page_locations); - unencoded_byte_array_data_bytes = std::move(other265.unencoded_byte_array_data_bytes); - __isset = other265.__isset; +OffsetIndex::OffsetIndex(OffsetIndex&& other295) noexcept { + page_locations = std::move(other295.page_locations); + unencoded_byte_array_data_bytes = std::move(other295.unencoded_byte_array_data_bytes); + __isset = other295.__isset; } -OffsetIndex& OffsetIndex::operator=(const OffsetIndex& other266) { - page_locations = other266.page_locations; - unencoded_byte_array_data_bytes = other266.unencoded_byte_array_data_bytes; - __isset = other266.__isset; +OffsetIndex& OffsetIndex::operator=(const OffsetIndex& other296) { + page_locations = other296.page_locations; + unencoded_byte_array_data_bytes = other296.unencoded_byte_array_data_bytes; + __isset = other296.__isset; return *this; } -OffsetIndex& OffsetIndex::operator=(OffsetIndex&& other267) noexcept { - page_locations = std::move(other267.page_locations); - unencoded_byte_array_data_bytes = std::move(other267.unencoded_byte_array_data_bytes); - __isset = other267.__isset; +OffsetIndex& OffsetIndex::operator=(OffsetIndex&& other297) noexcept { + page_locations = std::move(other297.page_locations); + unencoded_byte_array_data_bytes = std::move(other297.unencoded_byte_array_data_bytes); + __isset = other297.__isset; return *this; } void OffsetIndex::printTo(std::ostream& out) const { @@ -3665,6 +4100,11 @@ void ColumnIndex::__set_definition_level_histograms(const std::vector & this->definition_level_histograms = val; __isset.definition_level_histograms = true; } + +void ColumnIndex::__set_geometry_stats(const std::vector & val) { + this->geometry_stats = val; +__isset.geometry_stats = true; +} std::ostream& operator<<(std::ostream& out, const ColumnIndex& obj) { obj.printTo(out); @@ -3681,49 +4121,54 @@ void swap(ColumnIndex &a, ColumnIndex &b) { swap(a.null_counts, b.null_counts); swap(a.repetition_level_histograms, b.repetition_level_histograms); swap(a.definition_level_histograms, b.definition_level_histograms); + swap(a.geometry_stats, b.geometry_stats); swap(a.__isset, b.__isset); } -ColumnIndex::ColumnIndex(const ColumnIndex& other305) { - null_pages = other305.null_pages; - min_values = other305.min_values; - max_values = other305.max_values; - boundary_order = other305.boundary_order; - null_counts = other305.null_counts; - repetition_level_histograms = other305.repetition_level_histograms; - definition_level_histograms = other305.definition_level_histograms; - __isset = other305.__isset; -} -ColumnIndex::ColumnIndex(ColumnIndex&& other306) noexcept { - null_pages = std::move(other306.null_pages); - min_values = std::move(other306.min_values); - max_values = std::move(other306.max_values); - boundary_order = other306.boundary_order; - null_counts = std::move(other306.null_counts); - repetition_level_histograms = std::move(other306.repetition_level_histograms); - definition_level_histograms = std::move(other306.definition_level_histograms); - __isset = other306.__isset; -} -ColumnIndex& ColumnIndex::operator=(const ColumnIndex& other307) { - null_pages = other307.null_pages; - min_values = other307.min_values; - max_values = other307.max_values; - boundary_order = other307.boundary_order; - null_counts = other307.null_counts; - repetition_level_histograms = other307.repetition_level_histograms; - definition_level_histograms = other307.definition_level_histograms; - __isset = other307.__isset; +ColumnIndex::ColumnIndex(const ColumnIndex& other341) { + null_pages = other341.null_pages; + min_values = other341.min_values; + max_values = other341.max_values; + boundary_order = other341.boundary_order; + null_counts = other341.null_counts; + repetition_level_histograms = other341.repetition_level_histograms; + definition_level_histograms = other341.definition_level_histograms; + geometry_stats = other341.geometry_stats; + __isset = other341.__isset; +} +ColumnIndex::ColumnIndex(ColumnIndex&& other342) noexcept { + null_pages = std::move(other342.null_pages); + min_values = std::move(other342.min_values); + max_values = std::move(other342.max_values); + boundary_order = other342.boundary_order; + null_counts = std::move(other342.null_counts); + repetition_level_histograms = std::move(other342.repetition_level_histograms); + definition_level_histograms = std::move(other342.definition_level_histograms); + geometry_stats = std::move(other342.geometry_stats); + __isset = other342.__isset; +} +ColumnIndex& ColumnIndex::operator=(const ColumnIndex& other343) { + null_pages = other343.null_pages; + min_values = other343.min_values; + max_values = other343.max_values; + boundary_order = other343.boundary_order; + null_counts = other343.null_counts; + repetition_level_histograms = other343.repetition_level_histograms; + definition_level_histograms = other343.definition_level_histograms; + geometry_stats = other343.geometry_stats; + __isset = other343.__isset; return *this; } -ColumnIndex& ColumnIndex::operator=(ColumnIndex&& other308) noexcept { - null_pages = std::move(other308.null_pages); - min_values = std::move(other308.min_values); - max_values = std::move(other308.max_values); - boundary_order = other308.boundary_order; - null_counts = std::move(other308.null_counts); - repetition_level_histograms = std::move(other308.repetition_level_histograms); - definition_level_histograms = std::move(other308.definition_level_histograms); - __isset = other308.__isset; +ColumnIndex& ColumnIndex::operator=(ColumnIndex&& other344) noexcept { + null_pages = std::move(other344.null_pages); + min_values = std::move(other344.min_values); + max_values = std::move(other344.max_values); + boundary_order = other344.boundary_order; + null_counts = std::move(other344.null_counts); + repetition_level_histograms = std::move(other344.repetition_level_histograms); + definition_level_histograms = std::move(other344.definition_level_histograms); + geometry_stats = std::move(other344.geometry_stats); + __isset = other344.__isset; return *this; } void ColumnIndex::printTo(std::ostream& out) const { @@ -3736,6 +4181,7 @@ void ColumnIndex::printTo(std::ostream& out) const { out << ", " << "null_counts="; (__isset.null_counts ? (out << to_string(null_counts)) : (out << "")); out << ", " << "repetition_level_histograms="; (__isset.repetition_level_histograms ? (out << to_string(repetition_level_histograms)) : (out << "")); out << ", " << "definition_level_histograms="; (__isset.definition_level_histograms ? (out << to_string(definition_level_histograms)) : (out << "")); + out << ", " << "geometry_stats="; (__isset.geometry_stats ? (out << to_string(geometry_stats)) : (out << "")); out << ")"; } @@ -3773,30 +4219,30 @@ void swap(AesGcmV1 &a, AesGcmV1 &b) { swap(a.__isset, b.__isset); } -AesGcmV1::AesGcmV1(const AesGcmV1& other309) { - aad_prefix = other309.aad_prefix; - aad_file_unique = other309.aad_file_unique; - supply_aad_prefix = other309.supply_aad_prefix; - __isset = other309.__isset; +AesGcmV1::AesGcmV1(const AesGcmV1& other345) { + aad_prefix = other345.aad_prefix; + aad_file_unique = other345.aad_file_unique; + supply_aad_prefix = other345.supply_aad_prefix; + __isset = other345.__isset; } -AesGcmV1::AesGcmV1(AesGcmV1&& other310) noexcept { - aad_prefix = std::move(other310.aad_prefix); - aad_file_unique = std::move(other310.aad_file_unique); - supply_aad_prefix = other310.supply_aad_prefix; - __isset = other310.__isset; +AesGcmV1::AesGcmV1(AesGcmV1&& other346) noexcept { + aad_prefix = std::move(other346.aad_prefix); + aad_file_unique = std::move(other346.aad_file_unique); + supply_aad_prefix = other346.supply_aad_prefix; + __isset = other346.__isset; } -AesGcmV1& AesGcmV1::operator=(const AesGcmV1& other311) { - aad_prefix = other311.aad_prefix; - aad_file_unique = other311.aad_file_unique; - supply_aad_prefix = other311.supply_aad_prefix; - __isset = other311.__isset; +AesGcmV1& AesGcmV1::operator=(const AesGcmV1& other347) { + aad_prefix = other347.aad_prefix; + aad_file_unique = other347.aad_file_unique; + supply_aad_prefix = other347.supply_aad_prefix; + __isset = other347.__isset; return *this; } -AesGcmV1& AesGcmV1::operator=(AesGcmV1&& other312) noexcept { - aad_prefix = std::move(other312.aad_prefix); - aad_file_unique = std::move(other312.aad_file_unique); - supply_aad_prefix = other312.supply_aad_prefix; - __isset = other312.__isset; +AesGcmV1& AesGcmV1::operator=(AesGcmV1&& other348) noexcept { + aad_prefix = std::move(other348.aad_prefix); + aad_file_unique = std::move(other348.aad_file_unique); + supply_aad_prefix = other348.supply_aad_prefix; + __isset = other348.__isset; return *this; } void AesGcmV1::printTo(std::ostream& out) const { @@ -3842,30 +4288,30 @@ void swap(AesGcmCtrV1 &a, AesGcmCtrV1 &b) { swap(a.__isset, b.__isset); } -AesGcmCtrV1::AesGcmCtrV1(const AesGcmCtrV1& other313) { - aad_prefix = other313.aad_prefix; - aad_file_unique = other313.aad_file_unique; - supply_aad_prefix = other313.supply_aad_prefix; - __isset = other313.__isset; +AesGcmCtrV1::AesGcmCtrV1(const AesGcmCtrV1& other349) { + aad_prefix = other349.aad_prefix; + aad_file_unique = other349.aad_file_unique; + supply_aad_prefix = other349.supply_aad_prefix; + __isset = other349.__isset; } -AesGcmCtrV1::AesGcmCtrV1(AesGcmCtrV1&& other314) noexcept { - aad_prefix = std::move(other314.aad_prefix); - aad_file_unique = std::move(other314.aad_file_unique); - supply_aad_prefix = other314.supply_aad_prefix; - __isset = other314.__isset; +AesGcmCtrV1::AesGcmCtrV1(AesGcmCtrV1&& other350) noexcept { + aad_prefix = std::move(other350.aad_prefix); + aad_file_unique = std::move(other350.aad_file_unique); + supply_aad_prefix = other350.supply_aad_prefix; + __isset = other350.__isset; } -AesGcmCtrV1& AesGcmCtrV1::operator=(const AesGcmCtrV1& other315) { - aad_prefix = other315.aad_prefix; - aad_file_unique = other315.aad_file_unique; - supply_aad_prefix = other315.supply_aad_prefix; - __isset = other315.__isset; +AesGcmCtrV1& AesGcmCtrV1::operator=(const AesGcmCtrV1& other351) { + aad_prefix = other351.aad_prefix; + aad_file_unique = other351.aad_file_unique; + supply_aad_prefix = other351.supply_aad_prefix; + __isset = other351.__isset; return *this; } -AesGcmCtrV1& AesGcmCtrV1::operator=(AesGcmCtrV1&& other316) noexcept { - aad_prefix = std::move(other316.aad_prefix); - aad_file_unique = std::move(other316.aad_file_unique); - supply_aad_prefix = other316.supply_aad_prefix; - __isset = other316.__isset; +AesGcmCtrV1& AesGcmCtrV1::operator=(AesGcmCtrV1&& other352) noexcept { + aad_prefix = std::move(other352.aad_prefix); + aad_file_unique = std::move(other352.aad_file_unique); + supply_aad_prefix = other352.supply_aad_prefix; + __isset = other352.__isset; return *this; } void AesGcmCtrV1::printTo(std::ostream& out) const { @@ -3905,26 +4351,26 @@ void swap(EncryptionAlgorithm &a, EncryptionAlgorithm &b) { swap(a.__isset, b.__isset); } -EncryptionAlgorithm::EncryptionAlgorithm(const EncryptionAlgorithm& other317) { - AES_GCM_V1 = other317.AES_GCM_V1; - AES_GCM_CTR_V1 = other317.AES_GCM_CTR_V1; - __isset = other317.__isset; +EncryptionAlgorithm::EncryptionAlgorithm(const EncryptionAlgorithm& other353) { + AES_GCM_V1 = other353.AES_GCM_V1; + AES_GCM_CTR_V1 = other353.AES_GCM_CTR_V1; + __isset = other353.__isset; } -EncryptionAlgorithm::EncryptionAlgorithm(EncryptionAlgorithm&& other318) noexcept { - AES_GCM_V1 = std::move(other318.AES_GCM_V1); - AES_GCM_CTR_V1 = std::move(other318.AES_GCM_CTR_V1); - __isset = other318.__isset; +EncryptionAlgorithm::EncryptionAlgorithm(EncryptionAlgorithm&& other354) noexcept { + AES_GCM_V1 = std::move(other354.AES_GCM_V1); + AES_GCM_CTR_V1 = std::move(other354.AES_GCM_CTR_V1); + __isset = other354.__isset; } -EncryptionAlgorithm& EncryptionAlgorithm::operator=(const EncryptionAlgorithm& other319) { - AES_GCM_V1 = other319.AES_GCM_V1; - AES_GCM_CTR_V1 = other319.AES_GCM_CTR_V1; - __isset = other319.__isset; +EncryptionAlgorithm& EncryptionAlgorithm::operator=(const EncryptionAlgorithm& other355) { + AES_GCM_V1 = other355.AES_GCM_V1; + AES_GCM_CTR_V1 = other355.AES_GCM_CTR_V1; + __isset = other355.__isset; return *this; } -EncryptionAlgorithm& EncryptionAlgorithm::operator=(EncryptionAlgorithm&& other320) noexcept { - AES_GCM_V1 = std::move(other320.AES_GCM_V1); - AES_GCM_CTR_V1 = std::move(other320.AES_GCM_CTR_V1); - __isset = other320.__isset; +EncryptionAlgorithm& EncryptionAlgorithm::operator=(EncryptionAlgorithm&& other356) noexcept { + AES_GCM_V1 = std::move(other356.AES_GCM_V1); + AES_GCM_CTR_V1 = std::move(other356.AES_GCM_CTR_V1); + __isset = other356.__isset; return *this; } void EncryptionAlgorithm::printTo(std::ostream& out) const { @@ -4001,54 +4447,54 @@ void swap(FileMetaData &a, FileMetaData &b) { swap(a.__isset, b.__isset); } -FileMetaData::FileMetaData(const FileMetaData& other345) { - version = other345.version; - schema = other345.schema; - num_rows = other345.num_rows; - row_groups = other345.row_groups; - key_value_metadata = other345.key_value_metadata; - created_by = other345.created_by; - column_orders = other345.column_orders; - encryption_algorithm = other345.encryption_algorithm; - footer_signing_key_metadata = other345.footer_signing_key_metadata; - __isset = other345.__isset; -} -FileMetaData::FileMetaData(FileMetaData&& other346) noexcept { - version = other346.version; - schema = std::move(other346.schema); - num_rows = other346.num_rows; - row_groups = std::move(other346.row_groups); - key_value_metadata = std::move(other346.key_value_metadata); - created_by = std::move(other346.created_by); - column_orders = std::move(other346.column_orders); - encryption_algorithm = std::move(other346.encryption_algorithm); - footer_signing_key_metadata = std::move(other346.footer_signing_key_metadata); - __isset = other346.__isset; -} -FileMetaData& FileMetaData::operator=(const FileMetaData& other347) { - version = other347.version; - schema = other347.schema; - num_rows = other347.num_rows; - row_groups = other347.row_groups; - key_value_metadata = other347.key_value_metadata; - created_by = other347.created_by; - column_orders = other347.column_orders; - encryption_algorithm = other347.encryption_algorithm; - footer_signing_key_metadata = other347.footer_signing_key_metadata; - __isset = other347.__isset; +FileMetaData::FileMetaData(const FileMetaData& other381) { + version = other381.version; + schema = other381.schema; + num_rows = other381.num_rows; + row_groups = other381.row_groups; + key_value_metadata = other381.key_value_metadata; + created_by = other381.created_by; + column_orders = other381.column_orders; + encryption_algorithm = other381.encryption_algorithm; + footer_signing_key_metadata = other381.footer_signing_key_metadata; + __isset = other381.__isset; +} +FileMetaData::FileMetaData(FileMetaData&& other382) noexcept { + version = other382.version; + schema = std::move(other382.schema); + num_rows = other382.num_rows; + row_groups = std::move(other382.row_groups); + key_value_metadata = std::move(other382.key_value_metadata); + created_by = std::move(other382.created_by); + column_orders = std::move(other382.column_orders); + encryption_algorithm = std::move(other382.encryption_algorithm); + footer_signing_key_metadata = std::move(other382.footer_signing_key_metadata); + __isset = other382.__isset; +} +FileMetaData& FileMetaData::operator=(const FileMetaData& other383) { + version = other383.version; + schema = other383.schema; + num_rows = other383.num_rows; + row_groups = other383.row_groups; + key_value_metadata = other383.key_value_metadata; + created_by = other383.created_by; + column_orders = other383.column_orders; + encryption_algorithm = other383.encryption_algorithm; + footer_signing_key_metadata = other383.footer_signing_key_metadata; + __isset = other383.__isset; return *this; } -FileMetaData& FileMetaData::operator=(FileMetaData&& other348) noexcept { - version = other348.version; - schema = std::move(other348.schema); - num_rows = other348.num_rows; - row_groups = std::move(other348.row_groups); - key_value_metadata = std::move(other348.key_value_metadata); - created_by = std::move(other348.created_by); - column_orders = std::move(other348.column_orders); - encryption_algorithm = std::move(other348.encryption_algorithm); - footer_signing_key_metadata = std::move(other348.footer_signing_key_metadata); - __isset = other348.__isset; +FileMetaData& FileMetaData::operator=(FileMetaData&& other384) noexcept { + version = other384.version; + schema = std::move(other384.schema); + num_rows = other384.num_rows; + row_groups = std::move(other384.row_groups); + key_value_metadata = std::move(other384.key_value_metadata); + created_by = std::move(other384.created_by); + column_orders = std::move(other384.column_orders); + encryption_algorithm = std::move(other384.encryption_algorithm); + footer_signing_key_metadata = std::move(other384.footer_signing_key_metadata); + __isset = other384.__isset; return *this; } void FileMetaData::printTo(std::ostream& out) const { @@ -4093,26 +4539,26 @@ void swap(FileCryptoMetaData &a, FileCryptoMetaData &b) { swap(a.__isset, b.__isset); } -FileCryptoMetaData::FileCryptoMetaData(const FileCryptoMetaData& other349) { - encryption_algorithm = other349.encryption_algorithm; - key_metadata = other349.key_metadata; - __isset = other349.__isset; +FileCryptoMetaData::FileCryptoMetaData(const FileCryptoMetaData& other385) { + encryption_algorithm = other385.encryption_algorithm; + key_metadata = other385.key_metadata; + __isset = other385.__isset; } -FileCryptoMetaData::FileCryptoMetaData(FileCryptoMetaData&& other350) noexcept { - encryption_algorithm = std::move(other350.encryption_algorithm); - key_metadata = std::move(other350.key_metadata); - __isset = other350.__isset; +FileCryptoMetaData::FileCryptoMetaData(FileCryptoMetaData&& other386) noexcept { + encryption_algorithm = std::move(other386.encryption_algorithm); + key_metadata = std::move(other386.key_metadata); + __isset = other386.__isset; } -FileCryptoMetaData& FileCryptoMetaData::operator=(const FileCryptoMetaData& other351) { - encryption_algorithm = other351.encryption_algorithm; - key_metadata = other351.key_metadata; - __isset = other351.__isset; +FileCryptoMetaData& FileCryptoMetaData::operator=(const FileCryptoMetaData& other387) { + encryption_algorithm = other387.encryption_algorithm; + key_metadata = other387.key_metadata; + __isset = other387.__isset; return *this; } -FileCryptoMetaData& FileCryptoMetaData::operator=(FileCryptoMetaData&& other352) noexcept { - encryption_algorithm = std::move(other352.encryption_algorithm); - key_metadata = std::move(other352.key_metadata); - __isset = other352.__isset; +FileCryptoMetaData& FileCryptoMetaData::operator=(FileCryptoMetaData&& other388) noexcept { + encryption_algorithm = std::move(other388.encryption_algorithm); + key_metadata = std::move(other388.key_metadata); + __isset = other388.__isset; return *this; } void FileCryptoMetaData::printTo(std::ostream& out) const { @@ -4122,5 +4568,5 @@ void FileCryptoMetaData::printTo(std::ostream& out) const { out << ", " << "key_metadata="; (__isset.key_metadata ? (out << to_string(key_metadata)) : (out << "")); out << ")"; } - -}} // namespace +} +} // namespace diff --git a/cpp/src/generated/parquet_types.h b/cpp/src/generated/parquet_types.h index 6cf85fe5e73cc..0a857c4c6e8dd 100644 --- a/cpp/src/generated/parquet_types.h +++ b/cpp/src/generated/parquet_types.h @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.19.0) + * Autogenerated by Thrift Compiler (0.20.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -20,6 +20,7 @@ #include "parquet/windows_compatibility.h" + namespace parquet { namespace format { /** @@ -50,7 +51,7 @@ std::string to_string(const Type::type& val); /** * DEPRECATED: Common types used by frameworks(e.g. hive, pig) using parquet. * ConvertedType is superseded by LogicalType. This enum should not be extended. - * + * * See LogicalTypes.md for conversion between ConvertedType and LogicalType. */ struct ConvertedType { @@ -78,12 +79,12 @@ struct ConvertedType { ENUM = 4, /** * A decimal value. - * + * * This may be used to annotate binary or fixed primitive types. The * underlying byte array stores the unscaled value encoded as two's * complement using big-endian byte order (the most significant byte is the * zeroth element). The value of the decimal is the value * 10^{-scale}. - * + * * This must be accompanied by a (maximum) precision and a scale in the * SchemaElement. The precision specifies the number of digits in the decimal * and the scale stores the location of the decimal point. For example 1.23 @@ -93,47 +94,47 @@ struct ConvertedType { DECIMAL = 5, /** * A Date - * + * * Stored as days since Unix epoch, encoded as the INT32 physical type. - * + * */ DATE = 6, /** * A time - * + * * The total number of milliseconds since midnight. The value is stored * as an INT32 physical type. */ TIME_MILLIS = 7, /** * A time. - * + * * The total number of microseconds since midnight. The value is stored as * an INT64 physical type. */ TIME_MICROS = 8, /** * A date/time combination - * + * * Date and time recorded as milliseconds since the Unix epoch. Recorded as * a physical type of INT64. */ TIMESTAMP_MILLIS = 9, /** * A date/time combination - * + * * Date and time recorded as microseconds since the Unix epoch. The value is * stored as an INT64 physical type. */ TIMESTAMP_MICROS = 10, /** * An unsigned integer value. - * + * * The number describes the maximum number of meaningful data bits in * the stored value. 8, 16 and 32 bit values are stored using the * INT32 physical type. 64 bit values are stored using the INT64 * physical type. - * + * */ UINT_8 = 11, UINT_16 = 12, @@ -141,12 +142,12 @@ struct ConvertedType { UINT_64 = 14, /** * A signed integer value. - * + * * The number describes the maximum number of meaningful data bits in * the stored value. 8, 16 and 32 bit values are stored using the * INT32 physical type. 64 bit values are stored using the INT64 * physical type. - * + * */ INT_8 = 15, INT_16 = 16, @@ -154,19 +155,19 @@ struct ConvertedType { INT_64 = 18, /** * An embedded JSON document - * + * * A JSON document embedded within a single UTF8 column. */ JSON = 19, /** * An embedded BSON document - * + * * A BSON document embedded within a single BINARY column. */ BSON = 20, /** * An interval of time - * + * * This type annotates data stored as a FIXED_LEN_BYTE_ARRAY of length 12 * This data is composed of three separate little endian unsigned * integers. Each stores a component of a duration of time. The first @@ -212,6 +213,50 @@ std::ostream& operator<<(std::ostream& out, const FieldRepetitionType::type& val std::string to_string(const FieldRepetitionType::type& val); +/** + * Interpretation for edges of GEOMETRY logical type, i.e. whether the edge + * between points represent a straight cartesian line or the shortest line on + * the sphere. Please note that it only applies to polygons. + */ +struct Edges { + enum type { + PLANAR = 0, + SPHERICAL = 1 + }; +}; + +extern const std::map _Edges_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const Edges::type& val); + +std::string to_string(const Edges::type& val); + +/** + * Physical type and encoding for the geometry type. + */ +struct GeometryEncoding { + enum type { + /** + * Allowed for physical type: BYTE_ARRAY. + * + * Well-known binary (WKB) representations of geometries. It supports 2D or + * 3D geometries of the standard geometry types (Point, LineString, Polygon, + * MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). This + * is the preferred option for maximum portability. + * + * This encoding enables GeometryStatistics to be set in the column chunk + * and page index. + */ + WKB = 0 + }; +}; + +extern const std::map _GeometryEncoding_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const GeometryEncoding::type& val); + +std::string to_string(const GeometryEncoding::type& val); + /** * Encodings supported by Parquet. Not all encodings are valid for all types. These * enums are also used to specify the encoding of definition and repetition levels. @@ -267,12 +312,15 @@ struct Encoding { */ RLE_DICTIONARY = 8, /** - * Encoding for floating-point data. + * Encoding for fixed-width data (FLOAT, DOUBLE, INT32, INT64, FIXED_LEN_BYTE_ARRAY). * K byte-streams are created where K is the size in bytes of the data type. - * The individual bytes of an FP value are scattered to the corresponding stream and + * The individual bytes of a value are scattered to the corresponding stream and * the streams are concatenated. * This itself does not reduce the size of the data but can lead to better compression * afterwards. + * + * Added in 2.8 for FLOAT and DOUBLE. + * Support for INT32, INT64 and FIXED_LEN_BYTE_ARRAY added in 2.11. */ BYTE_STREAM_SPLIT = 9 }; @@ -286,11 +334,11 @@ std::string to_string(const Encoding::type& val); /** * Supported compression algorithms. - * + * * Codecs added in format version X.Y can be read by readers based on X.Y and later. * Codec support may vary between readers based on the format version and * libraries available at runtime. - * + * * See Compression.md for a detailed specification of these algorithms. */ struct CompressionCodec { @@ -347,6 +395,12 @@ std::string to_string(const BoundaryOrder::type& val); class SizeStatistics; +class Covering; + +class BoundingBox; + +class GeometryStatistics; + class Statistics; class StringType; @@ -385,6 +439,8 @@ class JsonType; class BsonType; +class GeometryType; + class LogicalType; class SchemaElement; @@ -487,11 +543,11 @@ class SizeStatistics { * schema information multiplied by the number of non-null and null values. * The number of null/non-null values can be inferred from the histograms * below. - * + * * For example, if a column chunk is dictionary-encoded with dictionary * ["a", "bc", "cde"], and a data page contains the indices [0, 0, 1, 2], * then this value for that data page should be 7 (1 + 1 + 2 + 3). - * + * * This field should only be set for types that use BYTE_ARRAY as their * physical type. */ @@ -501,18 +557,18 @@ class SizeStatistics { * repetition (i.e. size=max repetition_level+1) where each element * represents the number of times the repetition level was observed in the * data. - * + * * This field may be omitted if max_repetition_level is 0 without loss * of information. - * + * */ std::vector repetition_level_histogram; /** * Same as repetition_level_histogram except for definition levels. - * + * * This field may be omitted if max_definition_level is 0 or 1 without * loss of information. - * + * */ std::vector definition_level_histogram; @@ -558,8 +614,275 @@ void swap(SizeStatistics &a, SizeStatistics &b); std::ostream& operator<<(std::ostream& out, const SizeStatistics& obj); + +/** + * A custom WKB-encoded polygon or multi-polygon to represent a covering of + * geometries. For example, it may be a bounding box or an envelope of geometries + * when a bounding box cannot be built (e.g., a geometry has spherical edges, or if + * an edge of geographic coordinates crosses the antimeridian). In addition, it can + * also be used to provide vendor-agnostic coverings like S2 or H3 grids. + */ +class Covering { + public: + + Covering(const Covering&); + Covering(Covering&&) noexcept; + Covering& operator=(const Covering&); + Covering& operator=(Covering&&) noexcept; + Covering() noexcept + : kind(), + value() { + } + + virtual ~Covering() noexcept; + /** + * A type of covering. Currently accepted values: "WKB". + */ + std::string kind; + /** + * A payload specific to kind: + * - WKB: well-known binary of a POLYGON that completely covers the contents. + * This will be interpreted according to the same CRS and edges defined by + * the logical type. + */ + std::string value; + + void __set_kind(const std::string& val); + + void __set_value(const std::string& val); + + bool operator == (const Covering & rhs) const + { + if (!(kind == rhs.kind)) + return false; + if (!(value == rhs.value)) + return false; + return true; + } + bool operator != (const Covering &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Covering & ) const; + + template + uint32_t read(Protocol_* iprot); + template + uint32_t write(Protocol_* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(Covering &a, Covering &b); + +std::ostream& operator<<(std::ostream& out, const Covering& obj); + +typedef struct _BoundingBox__isset { + _BoundingBox__isset() : zmin(false), zmax(false), mmin(false), mmax(false) {} + bool zmin :1; + bool zmax :1; + bool mmin :1; + bool mmax :1; +} _BoundingBox__isset; + +/** + * Bounding box of geometries in the representation of min/max value pair of + * coordinates from each axis. Values of Z and M are omitted for 2D geometries. + */ +class BoundingBox { + public: + + BoundingBox(const BoundingBox&) noexcept; + BoundingBox(BoundingBox&&) noexcept; + BoundingBox& operator=(const BoundingBox&) noexcept; + BoundingBox& operator=(BoundingBox&&) noexcept; + BoundingBox() noexcept + : xmin(0), + xmax(0), + ymin(0), + ymax(0), + zmin(0), + zmax(0), + mmin(0), + mmax(0) { + } + + virtual ~BoundingBox() noexcept; + double xmin; + double xmax; + double ymin; + double ymax; + double zmin; + double zmax; + double mmin; + double mmax; + + _BoundingBox__isset __isset; + + void __set_xmin(const double val); + + void __set_xmax(const double val); + + void __set_ymin(const double val); + + void __set_ymax(const double val); + + void __set_zmin(const double val); + + void __set_zmax(const double val); + + void __set_mmin(const double val); + + void __set_mmax(const double val); + + bool operator == (const BoundingBox & rhs) const + { + if (!(xmin == rhs.xmin)) + return false; + if (!(xmax == rhs.xmax)) + return false; + if (!(ymin == rhs.ymin)) + return false; + if (!(ymax == rhs.ymax)) + return false; + if (__isset.zmin != rhs.__isset.zmin) + return false; + else if (__isset.zmin && !(zmin == rhs.zmin)) + return false; + if (__isset.zmax != rhs.__isset.zmax) + return false; + else if (__isset.zmax && !(zmax == rhs.zmax)) + return false; + if (__isset.mmin != rhs.__isset.mmin) + return false; + else if (__isset.mmin && !(mmin == rhs.mmin)) + return false; + if (__isset.mmax != rhs.__isset.mmax) + return false; + else if (__isset.mmax && !(mmax == rhs.mmax)) + return false; + return true; + } + bool operator != (const BoundingBox &rhs) const { + return !(*this == rhs); + } + + bool operator < (const BoundingBox & ) const; + + template + uint32_t read(Protocol_* iprot); + template + uint32_t write(Protocol_* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(BoundingBox &a, BoundingBox &b); + +std::ostream& operator<<(std::ostream& out, const BoundingBox& obj); + +typedef struct _GeometryStatistics__isset { + _GeometryStatistics__isset() : bbox(false), coverings(false), geometry_types(false) {} + bool bbox :1; + bool coverings :1; + bool geometry_types :1; +} _GeometryStatistics__isset; + +/** + * Statistics specific to GEOMETRY logical type + */ +class GeometryStatistics { + public: + + GeometryStatistics(const GeometryStatistics&); + GeometryStatistics(GeometryStatistics&&) noexcept; + GeometryStatistics& operator=(const GeometryStatistics&); + GeometryStatistics& operator=(GeometryStatistics&&) noexcept; + GeometryStatistics() noexcept { + } + + virtual ~GeometryStatistics() noexcept; + /** + * A bounding box of geometries + */ + BoundingBox bbox; + /** + * A list of coverings of geometries + */ + std::vector coverings; + /** + * The geometry types of all geometries, or an empty array if they are not + * known. This is borrowed from `geometry_types` column metadata of GeoParquet [1] + * except that values in the list are WKB (ISO variant) integer codes [2]. Table + * below shows the most common geometry types and their codes: + * + * | Type | XY | XYZ | XYM | XYZM | + * | :----------------- | :--- | :--- | :--- | :--: | + * | Point | 0001 | 1001 | 2001 | 3001 | + * | LineString | 0002 | 1002 | 2002 | 3002 | + * | Polygon | 0003 | 1003 | 2003 | 3003 | + * | MultiPoint | 0004 | 1004 | 2004 | 3004 | + * | MultiLineString | 0005 | 1005 | 2005 | 3005 | + * | MultiPolygon | 0006 | 1006 | 2006 | 3006 | + * | GeometryCollection | 0007 | 1007 | 2007 | 3007 | + * + * In addition, the following rules are used: + * - A list of multiple values indicates that multiple geometry types are + * present (e.g. `[0003, 0006]`). + * - An empty array explicitly signals that the geometry types are not known. + * - The geometry types in the list must be unique (e.g. `[0001, 0001]` + * is not valid). + * + * Please refer to links below for more detail: + * [1] https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary + * [2] https://github.com/opengeospatial/geoparquet/blob/v1.0.0/format-specs/geoparquet.md?plain=1#L91 + */ + std::vector geometry_types; + + _GeometryStatistics__isset __isset; + + void __set_bbox(const BoundingBox& val); + + void __set_coverings(const std::vector & val); + + void __set_geometry_types(const std::vector & val); + + bool operator == (const GeometryStatistics & rhs) const + { + if (__isset.bbox != rhs.__isset.bbox) + return false; + else if (__isset.bbox && !(bbox == rhs.bbox)) + return false; + if (__isset.coverings != rhs.__isset.coverings) + return false; + else if (__isset.coverings && !(coverings == rhs.coverings)) + return false; + if (__isset.geometry_types != rhs.__isset.geometry_types) + return false; + else if (__isset.geometry_types && !(geometry_types == rhs.geometry_types)) + return false; + return true; + } + bool operator != (const GeometryStatistics &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GeometryStatistics & ) const; + + template + uint32_t read(Protocol_* iprot); + template + uint32_t write(Protocol_* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GeometryStatistics &a, GeometryStatistics &b); + +std::ostream& operator<<(std::ostream& out, const GeometryStatistics& obj); + typedef struct _Statistics__isset { - _Statistics__isset() : max(false), min(false), null_count(false), distinct_count(false), max_value(false), min_value(false), is_max_value_exact(false), is_min_value_exact(false) {} + _Statistics__isset() : max(false), min(false), null_count(false), distinct_count(false), max_value(false), min_value(false), is_max_value_exact(false), is_min_value_exact(false), geometry_stats(false) {} bool max :1; bool min :1; bool null_count :1; @@ -568,6 +891,7 @@ typedef struct _Statistics__isset { bool min_value :1; bool is_max_value_exact :1; bool is_min_value_exact :1; + bool geometry_stats :1; } _Statistics__isset; /** @@ -595,14 +919,14 @@ class Statistics { virtual ~Statistics() noexcept; /** * DEPRECATED: min and max value of the column. Use min_value and max_value. - * + * * Values are encoded using PLAIN encoding, except that variable-length byte * arrays do not include a length prefix. - * + * * These fields encode min and max values determined by signed comparison * only. New files should use the correct order for a column's logical type * and store the values in the min_value and max_value fields. - * + * * To support older readers, these may be set when the column order is * signed. */ @@ -618,13 +942,13 @@ class Statistics { int64_t distinct_count; /** * Lower and upper bound values for the column, determined by its ColumnOrder. - * + * * These may be the actual minimum and maximum values found on a page or column * chunk, but can also be (more compact) values that do not exist on a page or * column chunk. For example, instead of storing "Blart Versenwald III", a writer * may set min_value="B", max_value="C". Such more compact values must still be * valid values within the column's logical type. - * + * * Values are encoded using PLAIN encoding, except that variable-length byte * arrays do not include a length prefix. */ @@ -638,6 +962,10 @@ class Statistics { * If true, min_value is the actual minimum value for a column */ bool is_min_value_exact; + /** + * statistics specific to geometry logical type + */ + GeometryStatistics geometry_stats; _Statistics__isset __isset; @@ -657,6 +985,8 @@ class Statistics { void __set_is_min_value_exact(const bool val); + void __set_geometry_stats(const GeometryStatistics& val); + bool operator == (const Statistics & rhs) const { if (__isset.max != rhs.__isset.max) @@ -691,6 +1021,10 @@ class Statistics { return false; else if (__isset.is_min_value_exact && !(is_min_value_exact == rhs.is_min_value_exact)) return false; + if (__isset.geometry_stats != rhs.__isset.geometry_stats) + return false; + else if (__isset.geometry_stats && !(geometry_stats == rhs.geometry_stats)) + return false; return true; } bool operator != (const Statistics &rhs) const { @@ -962,7 +1296,7 @@ std::ostream& operator<<(std::ostream& out, const Float16Type& obj); /** * Logical type to annotate a column that is always null. - * + * * Sometimes when discovering the schema of existing data, values are always * null and the physical type can't be determined. This annotation signals * the case where the physical type was guessed from all null values. @@ -1004,13 +1338,13 @@ std::ostream& operator<<(std::ostream& out, const NullType& obj); /** * Decimal logical type annotation - * + * * Scale must be zero or a positive integer less than or equal to the precision. * Precision must be a non-zero positive integer. - * + * * To maintain forward-compatibility in v1, implementations using this logical * type must also set scale and precision on the annotated SchemaElement. - * + * * Allowed for physical types: INT32, INT64, FIXED, and BINARY */ class DecimalType { @@ -1234,7 +1568,7 @@ std::ostream& operator<<(std::ostream& out, const TimeUnit& obj); /** * Timestamp logical type annotation - * + * * Allowed for physical types: INT64 */ class TimestampType { @@ -1285,7 +1619,7 @@ std::ostream& operator<<(std::ostream& out, const TimestampType& obj); /** * Time logical type annotation - * + * * Allowed for physical types: INT32 (millis), INT64 (micros, nanos) */ class TimeType { @@ -1336,9 +1670,9 @@ std::ostream& operator<<(std::ostream& out, const TimeType& obj); /** * Integer logical type annotation - * + * * bitWidth must be 8, 16, 32, or 64. - * + * * Allowed for physical types: INT32, INT64 */ class IntType { @@ -1390,7 +1724,7 @@ std::ostream& operator<<(std::ostream& out, const IntType& obj); /** * Embedded JSON logical type annotation - * + * * Allowed for physical types: BINARY */ class JsonType { @@ -1430,7 +1764,7 @@ std::ostream& operator<<(std::ostream& out, const JsonType& obj); /** * Embedded BSON logical type annotation - * + * * Allowed for physical types: BINARY */ class BsonType { @@ -1467,8 +1801,113 @@ void swap(BsonType &a, BsonType &b); std::ostream& operator<<(std::ostream& out, const BsonType& obj); +typedef struct _GeometryType__isset { + _GeometryType__isset() : crs(false), crs_encoding(false), metadata(false) {} + bool crs :1; + bool crs_encoding :1; + bool metadata :1; +} _GeometryType__isset; + +/** + * Geometry logical type annotation (added in 2.11.0) + */ +class GeometryType { + public: + + GeometryType(const GeometryType&); + GeometryType(GeometryType&&) noexcept; + GeometryType& operator=(const GeometryType&); + GeometryType& operator=(GeometryType&&) noexcept; + GeometryType() noexcept + : encoding(static_cast(0)), + edges(static_cast(0)), + crs(), + crs_encoding(), + metadata() { + } + + virtual ~GeometryType() noexcept; + /** + * Physical type and encoding for the geometry type. Please refer to the + * definition of GeometryEncoding for more detail. + * + * @see GeometryEncoding + */ + GeometryEncoding::type encoding; + /** + * Edges of polygon. + * + * @see Edges + */ + Edges::type edges; + /** + * Coordinate Reference System, i.e. mapping of how coordinates refer to + * precise locations on earth. + */ + std::string crs; + /** + * Encoding used in the above crs field. + * Currently the only allowed value is "PROJJSON". + */ + std::string crs_encoding; + /** + * Additional informative metadata. + * It can be used by GeoParquet to offload some of the column metadata. + */ + std::string metadata; + + _GeometryType__isset __isset; + + void __set_encoding(const GeometryEncoding::type val); + + void __set_edges(const Edges::type val); + + void __set_crs(const std::string& val); + + void __set_crs_encoding(const std::string& val); + + void __set_metadata(const std::string& val); + + bool operator == (const GeometryType & rhs) const + { + if (!(encoding == rhs.encoding)) + return false; + if (!(edges == rhs.edges)) + return false; + if (__isset.crs != rhs.__isset.crs) + return false; + else if (__isset.crs && !(crs == rhs.crs)) + return false; + if (__isset.crs_encoding != rhs.__isset.crs_encoding) + return false; + else if (__isset.crs_encoding && !(crs_encoding == rhs.crs_encoding)) + return false; + if (__isset.metadata != rhs.__isset.metadata) + return false; + else if (__isset.metadata && !(metadata == rhs.metadata)) + return false; + return true; + } + bool operator != (const GeometryType &rhs) const { + return !(*this == rhs); + } + + bool operator < (const GeometryType & ) const; + + template + uint32_t read(Protocol_* iprot); + template + uint32_t write(Protocol_* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(GeometryType &a, GeometryType &b); + +std::ostream& operator<<(std::ostream& out, const GeometryType& obj); + typedef struct _LogicalType__isset { - _LogicalType__isset() : STRING(false), MAP(false), LIST(false), ENUM(false), DECIMAL(false), DATE(false), TIME(false), TIMESTAMP(false), INTEGER(false), UNKNOWN(false), JSON(false), BSON(false), UUID(false), FLOAT16(false) {} + _LogicalType__isset() : STRING(false), MAP(false), LIST(false), ENUM(false), DECIMAL(false), DATE(false), TIME(false), TIMESTAMP(false), INTEGER(false), UNKNOWN(false), JSON(false), BSON(false), UUID(false), FLOAT16(false), GEOMETRY(false) {} bool STRING :1; bool MAP :1; bool LIST :1; @@ -1483,11 +1922,12 @@ typedef struct _LogicalType__isset { bool BSON :1; bool UUID :1; bool FLOAT16 :1; + bool GEOMETRY :1; } _LogicalType__isset; /** * LogicalType annotations to replace ConvertedType. - * + * * To maintain compatibility, implementations using LogicalType for a * SchemaElement must also set the corresponding ConvertedType (if any) * from the following table. @@ -1495,9 +1935,9 @@ typedef struct _LogicalType__isset { class LogicalType { public: - LogicalType(const LogicalType&) noexcept; + LogicalType(const LogicalType&); LogicalType(LogicalType&&) noexcept; - LogicalType& operator=(const LogicalType&) noexcept; + LogicalType& operator=(const LogicalType&); LogicalType& operator=(LogicalType&&) noexcept; LogicalType() noexcept { } @@ -1517,6 +1957,7 @@ class LogicalType { BsonType BSON; UUIDType UUID; Float16Type FLOAT16; + GeometryType GEOMETRY; _LogicalType__isset __isset; @@ -1548,6 +1989,8 @@ class LogicalType { void __set_FLOAT16(const Float16Type& val); + void __set_GEOMETRY(const GeometryType& val); + bool operator == (const LogicalType & rhs) const { if (__isset.STRING != rhs.__isset.STRING) @@ -1606,6 +2049,10 @@ class LogicalType { return false; else if (__isset.FLOAT16 && !(FLOAT16 == rhs.FLOAT16)) return false; + if (__isset.GEOMETRY != rhs.__isset.GEOMETRY) + return false; + else if (__isset.GEOMETRY && !(GEOMETRY == rhs.GEOMETRY)) + return false; return true; } bool operator != (const LogicalType &rhs) const { @@ -1667,7 +2114,7 @@ class SchemaElement { virtual ~SchemaElement() noexcept; /** * Data type for this field. Not set if the current element is a non-leaf node - * + * * @see Type */ Type::type type; @@ -1681,7 +2128,7 @@ class SchemaElement { /** * repetition of the field. The root of the schema does not have a repetition_type. * All other nodes must have one - * + * * @see FieldRepetitionType */ FieldRepetitionType::type repetition_type; @@ -1699,16 +2146,16 @@ class SchemaElement { /** * DEPRECATED: When the schema is the result of a conversion from another model. * Used to record the original type to help with cross conversion. - * + * * This is superseded by logicalType. - * + * * @see ConvertedType */ ConvertedType::type converted_type; /** * DEPRECATED: Used when this column contains decimal data. * See the DECIMAL converted type for more details. - * + * * This is superseded by using the DecimalType annotation in logicalType. */ int32_t scale; @@ -1720,7 +2167,7 @@ class SchemaElement { int32_t field_id; /** * The logical type of this SchemaElement - * + * * LogicalType replaces ConvertedType, but ConvertedType is still required * for some logical types to ensure forward-compatibility in format v1. */ @@ -1837,19 +2284,19 @@ class DataPageHeader { int32_t num_values; /** * Encoding used for this data page * - * + * * @see Encoding */ Encoding::type encoding; /** * Encoding used for definition levels * - * + * * @see Encoding */ Encoding::type definition_level_encoding; /** * Encoding used for repetition levels * - * + * * @see Encoding */ Encoding::type repetition_level_encoding; @@ -1948,7 +2395,7 @@ typedef struct _DictionaryPageHeader__isset { * The dictionary page must be placed at the first position of the column chunk * if it is partly or completely dictionary encoded. At most one dictionary page * can be placed in a column chunk. - * + * */ class DictionaryPageHeader { public: @@ -1970,7 +2417,7 @@ class DictionaryPageHeader { int32_t num_values; /** * Encoding using this dictionary page * - * + * * @see Encoding */ Encoding::type encoding; @@ -2027,7 +2474,7 @@ typedef struct _DataPageHeaderV2__isset { * New page format allowing reading levels without decompressing the data * Repetition and definition levels are uncompressed * The remaining section containing the data is compressed if is_compressed is true - * + * */ class DataPageHeaderV2 { public: @@ -2062,7 +2509,7 @@ class DataPageHeaderV2 { int32_t num_rows; /** * Encoding used for data in this page * - * + * * @see Encoding */ Encoding::type encoding; @@ -2243,7 +2690,7 @@ std::ostream& operator<<(std::ostream& out, const BloomFilterAlgorithm& obj); /** * Hash strategy type annotation. xxHash is an extremely fast non-cryptographic hash * algorithm. It uses 64 bits version of xxHash. - * + * */ class XxHash { public: @@ -2287,7 +2734,7 @@ typedef struct _BloomFilterHash__isset { /** * The hash function used in Bloom filter. This function takes the hash of a column value * using plain encoding. - * + * */ class BloomFilterHash { public: @@ -2338,7 +2785,7 @@ std::ostream& operator<<(std::ostream& out, const BloomFilterHash& obj); /** * The compression used in the Bloom filter. - * + * */ class Uncompressed { public: @@ -2426,7 +2873,7 @@ std::ostream& operator<<(std::ostream& out, const BloomFilterCompression& obj); /** * Bloom filter header is stored at beginning of Bloom filter data of each column * and followed by its bitset. - * + * */ class BloomFilterHeader { public: @@ -2521,7 +2968,7 @@ class PageHeader { virtual ~PageHeader() noexcept; /** * the type of the page: indicates which of the *_header fields is set * - * + * * @see PageType */ PageType::type type; @@ -2535,7 +2982,7 @@ class PageHeader { int32_t compressed_page_size; /** * The 32-bit CRC checksum for the page, to be be calculated as follows: - * + * * - The standard CRC32 algorithm is used (with polynomial 0x04C11DB7, * the same as in e.g. GZip). * - All page types can have a CRC (v1 and v2 data pages, dictionary pages, @@ -2547,7 +2994,7 @@ class PageHeader { * encrypted). * - The CRC computation therefore takes place after any compression * and encryption steps, if any. - * + * * If enabled, this allows for disabling checksumming in HDFS if only a few * pages need to be read. */ @@ -2683,7 +3130,7 @@ std::ostream& operator<<(std::ostream& out, const KeyValue& obj); /** - * Wrapper struct to specify sort order + * Sort order within a RowGroup of a leaf column */ class SortingColumn { public: @@ -2700,7 +3147,7 @@ class SortingColumn { virtual ~SortingColumn() noexcept; /** - * The column index (in this row group) * + * The ordinal position of the column (in this row group) * */ int32_t column_idx; /** @@ -2767,13 +3214,13 @@ class PageEncodingStats { virtual ~PageEncodingStats() noexcept; /** * the page type (data/dic/...) * - * + * * @see PageType */ PageType::type page_type; /** * encoding of the page * - * + * * @see Encoding */ Encoding::type encoding; @@ -2854,7 +3301,7 @@ class ColumnMetaData { virtual ~ColumnMetaData() noexcept; /** * Type of this column * - * + * * @see Type */ Type::type type; @@ -2869,7 +3316,7 @@ class ColumnMetaData { std::vector path_in_schema; /** * Compression codec * - * + * * @see CompressionCodec */ CompressionCodec::type codec; @@ -3220,7 +3667,7 @@ class ColumnChunk { /** * File where column data is stored. If not set, assumed to be same file as * metadata. This path is relative to the current file. - * + * */ std::string file_path; /** @@ -3231,7 +3678,7 @@ class ColumnChunk { * Column metadata for this chunk. This is the same content as what is at * file_path/file_offset. Having it here has it replicated in the file * metadata. - * + * */ ColumnMetaData meta_data; /** @@ -3362,7 +3809,7 @@ class RowGroup { /** * Metadata for each column chunk in this row group. * This list must have the same order as the SchemaElement list in FileMetaData. - * + * */ std::vector columns; /** @@ -3500,11 +3947,11 @@ typedef struct _ColumnOrder__isset { * Union to specify the order used for the min_value and max_value fields for a * column. This union takes the role of an enhanced enum that allows rich * elements (which will be needed for a collation-based ordering in the future). - * + * * Possible values are: * * TypeDefinedOrder - the column uses the order defined by its logical or * physical type (if there is no logical type). - * + * * If the reader does not support the value of this union, min and max stats * for this column should be ignored. */ @@ -3536,13 +3983,14 @@ class ColumnOrder { * TIME_MICROS - signed comparison * TIMESTAMP_MILLIS - signed comparison * TIMESTAMP_MICROS - signed comparison - * INTERVAL - unsigned comparison + * INTERVAL - undefined * JSON - unsigned byte-wise comparison * BSON - unsigned byte-wise comparison * ENUM - unsigned byte-wise comparison * LIST - undefined * MAP - undefined - * + * GEOMETRY - undefined, use GeometryStatistics instead. + * * In the absence of logical types, the sort order is determined by the physical type: * BOOLEAN - false, true * INT32 - signed comparison @@ -3552,7 +4000,7 @@ class ColumnOrder { * DOUBLE - signed comparison of the represented value (*) * BYTE_ARRAY - unsigned byte-wise comparison * FIXED_LEN_BYTE_ARRAY - unsigned byte-wise comparison - * + * * (*) Because the sorting order is not specified properly for floating * point values (relations vs. total ordering) the following * compatibility rules should be applied when reading statistics: @@ -3561,7 +4009,7 @@ class ColumnOrder { * - If the min is +0, the row group may contain -0 values as well. * - If the max is -0, the row group may contain +0 values as well. * - When looking for NaN values, min and max should be ignored. - * + * * When writing statistics the following rules should be followed: * - NaNs should not be written to min or max statistics fields. * - If the computed max value is zero (whether negative or positive), @@ -3670,6 +4118,13 @@ typedef struct _OffsetIndex__isset { bool unencoded_byte_array_data_bytes :1; } _OffsetIndex__isset; +/** + * Optional offsets for each data page in a ColumnChunk. + * + * Forms part of the page index, along with ColumnIndex. + * + * OffsetIndex may be present even if ColumnIndex is not. + */ class OffsetIndex { public: @@ -3688,7 +4143,7 @@ class OffsetIndex { std::vector page_locations; /** * Unencoded/uncompressed size for BYTE_ARRAY types. - * + * * See documention for unencoded_byte_array_data_bytes in SizeStatistics for * more details on this field. */ @@ -3729,15 +4184,22 @@ void swap(OffsetIndex &a, OffsetIndex &b); std::ostream& operator<<(std::ostream& out, const OffsetIndex& obj); typedef struct _ColumnIndex__isset { - _ColumnIndex__isset() : null_counts(false), repetition_level_histograms(false), definition_level_histograms(false) {} + _ColumnIndex__isset() : null_counts(false), repetition_level_histograms(false), definition_level_histograms(false), geometry_stats(false) {} bool null_counts :1; bool repetition_level_histograms :1; bool definition_level_histograms :1; + bool geometry_stats :1; } _ColumnIndex__isset; /** - * Description for ColumnIndex. - * Each [i] refers to the page at OffsetIndex.page_locations[i] + * Optional statistics for each data page in a ColumnChunk. + * + * Forms part the page index, along with OffsetIndex. + * + * If this structure is present, OffsetIndex must also be present. + * + * For each field in this structure, [i] refers to the page at + * OffsetIndex.page_locations[i] */ class ColumnIndex { public: @@ -3776,7 +4238,7 @@ class ColumnIndex { * which direction. This allows readers to perform binary searches in both * lists. Readers cannot assume that max_values[i] <= min_values[i+1], even * if the lists are ordered. - * + * * @see BoundaryOrder */ BoundaryOrder::type boundary_order; @@ -3788,21 +4250,25 @@ class ColumnIndex { * Contains repetition level histograms for each page * concatenated together. The repetition_level_histogram field on * SizeStatistics contains more details. - * + * * When present the length should always be (number of pages * * (max_repetition_level + 1)) elements. - * + * * Element 0 is the first element of the histogram for the first page. * Element (max_repetition_level + 1) is the first element of the histogram * for the second page. - * + * */ std::vector repetition_level_histograms; /** * Same as repetition_level_histograms except for definitions levels. - * + * */ std::vector definition_level_histograms; + /** + * A list containing statistics of GEOMETRY logical type for each page + */ + std::vector geometry_stats; _ColumnIndex__isset __isset; @@ -3820,6 +4286,8 @@ class ColumnIndex { void __set_definition_level_histograms(const std::vector & val); + void __set_geometry_stats(const std::vector & val); + bool operator == (const ColumnIndex & rhs) const { if (!(null_pages == rhs.null_pages)) @@ -3842,6 +4310,10 @@ class ColumnIndex { return false; else if (__isset.definition_level_histograms && !(definition_level_histograms == rhs.definition_level_histograms)) return false; + if (__isset.geometry_stats != rhs.__isset.geometry_stats) + return false; + else if (__isset.geometry_stats && !(geometry_stats == rhs.geometry_stats)) + return false; return true; } bool operator != (const ColumnIndex &rhs) const { @@ -4128,7 +4600,7 @@ class FileMetaData { * String for application that wrote this file. This should be in the format * version (build ). * e.g. impala version 1.0 (build 6cf94d29b2b7115df4de2c06e2ab4326d721eb55) - * + * */ std::string created_by; /** @@ -4138,12 +4610,12 @@ class FileMetaData { * matching the columns in the schema. The indexes are not necessary the same * though, because only leaf nodes of the schema are represented in the list * of sort orders. - * + * * Without column_orders, the meaning of the min_value and max_value fields * in the Statistics object and the ColumnIndex object is undefined. To ensure * well-defined behaviour, if these fields are written to a Parquet file, * column_orders must be written as well. - * + * * The obsolete min and max fields in the Statistics object are always sorted * by signed comparison regardless of column_orders. */ @@ -4296,7 +4768,9 @@ void swap(FileCryptoMetaData &a, FileCryptoMetaData &b); std::ostream& operator<<(std::ostream& out, const FileCryptoMetaData& obj); -}} // namespace +} +} // namespace + #include "parquet_types.tcc" diff --git a/cpp/src/generated/parquet_types.tcc b/cpp/src/generated/parquet_types.tcc index ee02d7f0139fc..f0e5b5ea37c6c 100644 --- a/cpp/src/generated/parquet_types.tcc +++ b/cpp/src/generated/parquet_types.tcc @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.19.0) + * Autogenerated by Thrift Compiler (0.20.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -135,6 +135,362 @@ uint32_t SizeStatistics::write(Protocol_* oprot) const { return xfer; } +template +uint32_t Covering::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; + + bool isset_kind = false; + bool isset_value = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->kind); + isset_kind = 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->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_kind) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_value) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +template +uint32_t Covering::write(Protocol_* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("Covering"); + + xfer += oprot->writeFieldBegin("kind", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->kind); + 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; +} + +template +uint32_t BoundingBox::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; + + bool isset_xmin = false; + bool isset_xmax = false; + bool isset_ymin = false; + bool isset_ymax = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->xmin); + isset_xmin = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->xmax); + isset_xmax = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->ymin); + isset_ymin = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->ymax); + isset_ymax = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->zmin); + this->__isset.zmin = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->zmax); + this->__isset.zmax = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->mmin); + this->__isset.mmin = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->mmax); + this->__isset.mmax = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_xmin) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_xmax) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_ymin) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_ymax) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +template +uint32_t BoundingBox::write(Protocol_* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("BoundingBox"); + + xfer += oprot->writeFieldBegin("xmin", ::apache::thrift::protocol::T_DOUBLE, 1); + xfer += oprot->writeDouble(this->xmin); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("xmax", ::apache::thrift::protocol::T_DOUBLE, 2); + xfer += oprot->writeDouble(this->xmax); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ymin", ::apache::thrift::protocol::T_DOUBLE, 3); + xfer += oprot->writeDouble(this->ymin); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("ymax", ::apache::thrift::protocol::T_DOUBLE, 4); + xfer += oprot->writeDouble(this->ymax); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.zmin) { + xfer += oprot->writeFieldBegin("zmin", ::apache::thrift::protocol::T_DOUBLE, 5); + xfer += oprot->writeDouble(this->zmin); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.zmax) { + xfer += oprot->writeFieldBegin("zmax", ::apache::thrift::protocol::T_DOUBLE, 6); + xfer += oprot->writeDouble(this->zmax); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.mmin) { + xfer += oprot->writeFieldBegin("mmin", ::apache::thrift::protocol::T_DOUBLE, 7); + xfer += oprot->writeDouble(this->mmin); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.mmax) { + xfer += oprot->writeFieldBegin("mmax", ::apache::thrift::protocol::T_DOUBLE, 8); + xfer += oprot->writeDouble(this->mmax); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +template +uint32_t GeometryStatistics::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; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->bbox.read(iprot); + this->__isset.bbox = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->coverings.clear(); + uint32_t _size24; + ::apache::thrift::protocol::TType _etype27; + xfer += iprot->readListBegin(_etype27, _size24); + this->coverings.resize(_size24); + uint32_t _i28; + for (_i28 = 0; _i28 < _size24; ++_i28) + { + xfer += this->coverings[_i28].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.coverings = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->geometry_types.clear(); + uint32_t _size29; + ::apache::thrift::protocol::TType _etype32; + xfer += iprot->readListBegin(_etype32, _size29); + this->geometry_types.resize(_size29); + uint32_t _i33; + for (_i33 = 0; _i33 < _size29; ++_i33) + { + xfer += iprot->readI32(this->geometry_types[_i33]); + } + xfer += iprot->readListEnd(); + } + this->__isset.geometry_types = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +template +uint32_t GeometryStatistics::write(Protocol_* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GeometryStatistics"); + + if (this->__isset.bbox) { + xfer += oprot->writeFieldBegin("bbox", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->bbox.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.coverings) { + xfer += oprot->writeFieldBegin("coverings", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->coverings.size())); + std::vector ::const_iterator _iter34; + for (_iter34 = this->coverings.begin(); _iter34 != this->coverings.end(); ++_iter34) + { + xfer += (*_iter34).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.geometry_types) { + xfer += oprot->writeFieldBegin("geometry_types", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->geometry_types.size())); + std::vector ::const_iterator _iter35; + for (_iter35 = this->geometry_types.begin(); _iter35 != this->geometry_types.end(); ++_iter35) + { + xfer += oprot->writeI32((*_iter35)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + template uint32_t Statistics::read(Protocol_* iprot) { @@ -221,6 +577,14 @@ uint32_t Statistics::read(Protocol_* iprot) { xfer += iprot->skip(ftype); } break; + case 9: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->geometry_stats.read(iprot); + this->__isset.geometry_stats = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -279,6 +643,11 @@ uint32_t Statistics::write(Protocol_* oprot) const { xfer += oprot->writeBool(this->is_min_value_exact); xfer += oprot->writeFieldEnd(); } + if (this->__isset.geometry_stats) { + xfer += oprot->writeFieldBegin("geometry_stats", ::apache::thrift::protocol::T_STRUCT, 9); + xfer += this->geometry_stats.write(oprot); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1188,6 +1557,124 @@ uint32_t BsonType::write(Protocol_* oprot) const { return xfer; } +template +uint32_t GeometryType::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; + + bool isset_encoding = false; + bool isset_edges = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast116; + xfer += iprot->readI32(ecast116); + this->encoding = static_cast(ecast116); + isset_encoding = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast117; + xfer += iprot->readI32(ecast117); + this->edges = static_cast(ecast117); + isset_edges = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->crs); + this->__isset.crs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->crs_encoding); + this->__isset.crs_encoding = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->metadata); + this->__isset.metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_encoding) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_edges) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +template +uint32_t GeometryType::write(Protocol_* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("GeometryType"); + + xfer += oprot->writeFieldBegin("encoding", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(static_cast(this->encoding)); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("edges", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(static_cast(this->edges)); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.crs) { + xfer += oprot->writeFieldBegin("crs", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->crs); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.crs_encoding) { + xfer += oprot->writeFieldBegin("crs_encoding", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->crs_encoding); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.metadata) { + xfer += oprot->writeFieldBegin("metadata", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->metadata); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + template uint32_t LogicalType::read(Protocol_* iprot) { @@ -1322,6 +1809,14 @@ uint32_t LogicalType::read(Protocol_* iprot) { xfer += iprot->skip(ftype); } break; + case 16: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->GEOMETRY.read(iprot); + this->__isset.GEOMETRY = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -1410,6 +1905,11 @@ uint32_t LogicalType::write(Protocol_* oprot) const { xfer += this->FLOAT16.write(oprot); xfer += oprot->writeFieldEnd(); } + if (this->__isset.GEOMETRY) { + xfer += oprot->writeFieldBegin("GEOMETRY", ::apache::thrift::protocol::T_STRUCT, 16); + xfer += this->GEOMETRY.write(oprot); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1440,9 +1940,9 @@ uint32_t SchemaElement::read(Protocol_* iprot) { { case 1: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast96; - xfer += iprot->readI32(ecast96); - this->type = static_cast(ecast96); + int32_t ecast126; + xfer += iprot->readI32(ecast126); + this->type = static_cast(ecast126); this->__isset.type = true; } else { xfer += iprot->skip(ftype); @@ -1458,9 +1958,9 @@ uint32_t SchemaElement::read(Protocol_* iprot) { break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast97; - xfer += iprot->readI32(ecast97); - this->repetition_type = static_cast(ecast97); + int32_t ecast127; + xfer += iprot->readI32(ecast127); + this->repetition_type = static_cast(ecast127); this->__isset.repetition_type = true; } else { xfer += iprot->skip(ftype); @@ -1484,9 +1984,9 @@ uint32_t SchemaElement::read(Protocol_* iprot) { break; case 6: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast98; - xfer += iprot->readI32(ecast98); - this->converted_type = static_cast(ecast98); + int32_t ecast128; + xfer += iprot->readI32(ecast128); + this->converted_type = static_cast(ecast128); this->__isset.converted_type = true; } else { xfer += iprot->skip(ftype); @@ -1634,9 +2134,9 @@ uint32_t DataPageHeader::read(Protocol_* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast103; - xfer += iprot->readI32(ecast103); - this->encoding = static_cast(ecast103); + int32_t ecast133; + xfer += iprot->readI32(ecast133); + this->encoding = static_cast(ecast133); isset_encoding = true; } else { xfer += iprot->skip(ftype); @@ -1644,9 +2144,9 @@ uint32_t DataPageHeader::read(Protocol_* iprot) { break; case 3: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast104; - xfer += iprot->readI32(ecast104); - this->definition_level_encoding = static_cast(ecast104); + int32_t ecast134; + xfer += iprot->readI32(ecast134); + this->definition_level_encoding = static_cast(ecast134); isset_definition_level_encoding = true; } else { xfer += iprot->skip(ftype); @@ -1654,9 +2154,9 @@ uint32_t DataPageHeader::read(Protocol_* iprot) { break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast105; - xfer += iprot->readI32(ecast105); - this->repetition_level_encoding = static_cast(ecast105); + int32_t ecast135; + xfer += iprot->readI32(ecast135); + this->repetition_level_encoding = static_cast(ecast135); isset_repetition_level_encoding = true; } else { xfer += iprot->skip(ftype); @@ -1796,9 +2296,9 @@ uint32_t DictionaryPageHeader::read(Protocol_* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast114; - xfer += iprot->readI32(ecast114); - this->encoding = static_cast(ecast114); + int32_t ecast144; + xfer += iprot->readI32(ecast144); + this->encoding = static_cast(ecast144); isset_encoding = true; } else { xfer += iprot->skip(ftype); @@ -1906,9 +2406,9 @@ uint32_t DataPageHeaderV2::read(Protocol_* iprot) { break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast119; - xfer += iprot->readI32(ecast119); - this->encoding = static_cast(ecast119); + int32_t ecast149; + xfer += iprot->readI32(ecast149); + this->encoding = static_cast(ecast149); isset_encoding = true; } else { xfer += iprot->skip(ftype); @@ -2441,9 +2941,9 @@ uint32_t PageHeader::read(Protocol_* iprot) { { case 1: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast152; - xfer += iprot->readI32(ecast152); - this->type = static_cast(ecast152); + int32_t ecast182; + xfer += iprot->readI32(ecast182); + this->type = static_cast(ecast182); isset_type = true; } else { xfer += iprot->skip(ftype); @@ -2761,9 +3261,9 @@ uint32_t PageEncodingStats::read(Protocol_* iprot) { { case 1: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast165; - xfer += iprot->readI32(ecast165); - this->page_type = static_cast(ecast165); + int32_t ecast195; + xfer += iprot->readI32(ecast195); + this->page_type = static_cast(ecast195); isset_page_type = true; } else { xfer += iprot->skip(ftype); @@ -2771,9 +3271,9 @@ uint32_t PageEncodingStats::read(Protocol_* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast166; - xfer += iprot->readI32(ecast166); - this->encoding = static_cast(ecast166); + int32_t ecast196; + xfer += iprot->readI32(ecast196); + this->encoding = static_cast(ecast196); isset_encoding = true; } else { xfer += iprot->skip(ftype); @@ -2860,9 +3360,9 @@ uint32_t ColumnMetaData::read(Protocol_* iprot) { { case 1: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast171; - xfer += iprot->readI32(ecast171); - this->type = static_cast(ecast171); + int32_t ecast201; + xfer += iprot->readI32(ecast201); + this->type = static_cast(ecast201); isset_type = true; } else { xfer += iprot->skip(ftype); @@ -2872,16 +3372,16 @@ uint32_t ColumnMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->encodings.clear(); - uint32_t _size172; - ::apache::thrift::protocol::TType _etype175; - xfer += iprot->readListBegin(_etype175, _size172); - this->encodings.resize(_size172); - uint32_t _i176; - for (_i176 = 0; _i176 < _size172; ++_i176) + uint32_t _size202; + ::apache::thrift::protocol::TType _etype205; + xfer += iprot->readListBegin(_etype205, _size202); + this->encodings.resize(_size202); + uint32_t _i206; + for (_i206 = 0; _i206 < _size202; ++_i206) { - int32_t ecast177; - xfer += iprot->readI32(ecast177); - this->encodings[_i176] = static_cast(ecast177); + int32_t ecast207; + xfer += iprot->readI32(ecast207); + this->encodings[_i206] = static_cast(ecast207); } xfer += iprot->readListEnd(); } @@ -2894,14 +3394,14 @@ uint32_t ColumnMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->path_in_schema.clear(); - uint32_t _size178; - ::apache::thrift::protocol::TType _etype181; - xfer += iprot->readListBegin(_etype181, _size178); - this->path_in_schema.resize(_size178); - uint32_t _i182; - for (_i182 = 0; _i182 < _size178; ++_i182) + uint32_t _size208; + ::apache::thrift::protocol::TType _etype211; + xfer += iprot->readListBegin(_etype211, _size208); + this->path_in_schema.resize(_size208); + uint32_t _i212; + for (_i212 = 0; _i212 < _size208; ++_i212) { - xfer += iprot->readString(this->path_in_schema[_i182]); + xfer += iprot->readString(this->path_in_schema[_i212]); } xfer += iprot->readListEnd(); } @@ -2912,9 +3412,9 @@ uint32_t ColumnMetaData::read(Protocol_* iprot) { break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast183; - xfer += iprot->readI32(ecast183); - this->codec = static_cast(ecast183); + int32_t ecast213; + xfer += iprot->readI32(ecast213); + this->codec = static_cast(ecast213); isset_codec = true; } else { xfer += iprot->skip(ftype); @@ -2948,14 +3448,14 @@ uint32_t ColumnMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->key_value_metadata.clear(); - uint32_t _size184; - ::apache::thrift::protocol::TType _etype187; - xfer += iprot->readListBegin(_etype187, _size184); - this->key_value_metadata.resize(_size184); - uint32_t _i188; - for (_i188 = 0; _i188 < _size184; ++_i188) + uint32_t _size214; + ::apache::thrift::protocol::TType _etype217; + xfer += iprot->readListBegin(_etype217, _size214); + this->key_value_metadata.resize(_size214); + uint32_t _i218; + for (_i218 = 0; _i218 < _size214; ++_i218) { - xfer += this->key_value_metadata[_i188].read(iprot); + xfer += this->key_value_metadata[_i218].read(iprot); } xfer += iprot->readListEnd(); } @@ -3000,14 +3500,14 @@ uint32_t ColumnMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->encoding_stats.clear(); - uint32_t _size189; - ::apache::thrift::protocol::TType _etype192; - xfer += iprot->readListBegin(_etype192, _size189); - this->encoding_stats.resize(_size189); - uint32_t _i193; - for (_i193 = 0; _i193 < _size189; ++_i193) + uint32_t _size219; + ::apache::thrift::protocol::TType _etype222; + xfer += iprot->readListBegin(_etype222, _size219); + this->encoding_stats.resize(_size219); + uint32_t _i223; + for (_i223 = 0; _i223 < _size219; ++_i223) { - xfer += this->encoding_stats[_i193].read(iprot); + xfer += this->encoding_stats[_i223].read(iprot); } xfer += iprot->readListEnd(); } @@ -3081,10 +3581,10 @@ uint32_t ColumnMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("encodings", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->encodings.size())); - std::vector ::const_iterator _iter194; - for (_iter194 = this->encodings.begin(); _iter194 != this->encodings.end(); ++_iter194) + std::vector ::const_iterator _iter224; + for (_iter224 = this->encodings.begin(); _iter224 != this->encodings.end(); ++_iter224) { - xfer += oprot->writeI32(static_cast((*_iter194))); + xfer += oprot->writeI32(static_cast((*_iter224))); } xfer += oprot->writeListEnd(); } @@ -3093,10 +3593,10 @@ uint32_t ColumnMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("path_in_schema", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->path_in_schema.size())); - std::vector ::const_iterator _iter195; - for (_iter195 = this->path_in_schema.begin(); _iter195 != this->path_in_schema.end(); ++_iter195) + std::vector ::const_iterator _iter225; + for (_iter225 = this->path_in_schema.begin(); _iter225 != this->path_in_schema.end(); ++_iter225) { - xfer += oprot->writeString((*_iter195)); + xfer += oprot->writeString((*_iter225)); } xfer += oprot->writeListEnd(); } @@ -3122,10 +3622,10 @@ uint32_t ColumnMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("key_value_metadata", ::apache::thrift::protocol::T_LIST, 8); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->key_value_metadata.size())); - std::vector ::const_iterator _iter196; - for (_iter196 = this->key_value_metadata.begin(); _iter196 != this->key_value_metadata.end(); ++_iter196) + std::vector ::const_iterator _iter226; + for (_iter226 = this->key_value_metadata.begin(); _iter226 != this->key_value_metadata.end(); ++_iter226) { - xfer += (*_iter196).write(oprot); + xfer += (*_iter226).write(oprot); } xfer += oprot->writeListEnd(); } @@ -3154,10 +3654,10 @@ uint32_t ColumnMetaData::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("encoding_stats", ::apache::thrift::protocol::T_LIST, 13); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->encoding_stats.size())); - std::vector ::const_iterator _iter197; - for (_iter197 = this->encoding_stats.begin(); _iter197 != this->encoding_stats.end(); ++_iter197) + std::vector ::const_iterator _iter227; + for (_iter227 = this->encoding_stats.begin(); _iter227 != this->encoding_stats.end(); ++_iter227) { - xfer += (*_iter197).write(oprot); + xfer += (*_iter227).write(oprot); } xfer += oprot->writeListEnd(); } @@ -3250,14 +3750,14 @@ uint32_t EncryptionWithColumnKey::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->path_in_schema.clear(); - uint32_t _size206; - ::apache::thrift::protocol::TType _etype209; - xfer += iprot->readListBegin(_etype209, _size206); - this->path_in_schema.resize(_size206); - uint32_t _i210; - for (_i210 = 0; _i210 < _size206; ++_i210) + uint32_t _size236; + ::apache::thrift::protocol::TType _etype239; + xfer += iprot->readListBegin(_etype239, _size236); + this->path_in_schema.resize(_size236); + uint32_t _i240; + for (_i240 = 0; _i240 < _size236; ++_i240) { - xfer += iprot->readString(this->path_in_schema[_i210]); + xfer += iprot->readString(this->path_in_schema[_i240]); } xfer += iprot->readListEnd(); } @@ -3297,10 +3797,10 @@ uint32_t EncryptionWithColumnKey::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("path_in_schema", ::apache::thrift::protocol::T_LIST, 1); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->path_in_schema.size())); - std::vector ::const_iterator _iter211; - for (_iter211 = this->path_in_schema.begin(); _iter211 != this->path_in_schema.end(); ++_iter211) + std::vector ::const_iterator _iter241; + for (_iter241 = this->path_in_schema.begin(); _iter241 != this->path_in_schema.end(); ++_iter241) { - xfer += oprot->writeString((*_iter211)); + xfer += oprot->writeString((*_iter241)); } xfer += oprot->writeListEnd(); } @@ -3580,14 +4080,14 @@ uint32_t RowGroup::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->columns.clear(); - uint32_t _size224; - ::apache::thrift::protocol::TType _etype227; - xfer += iprot->readListBegin(_etype227, _size224); - this->columns.resize(_size224); - uint32_t _i228; - for (_i228 = 0; _i228 < _size224; ++_i228) + uint32_t _size254; + ::apache::thrift::protocol::TType _etype257; + xfer += iprot->readListBegin(_etype257, _size254); + this->columns.resize(_size254); + uint32_t _i258; + for (_i258 = 0; _i258 < _size254; ++_i258) { - xfer += this->columns[_i228].read(iprot); + xfer += this->columns[_i258].read(iprot); } xfer += iprot->readListEnd(); } @@ -3616,14 +4116,14 @@ uint32_t RowGroup::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->sorting_columns.clear(); - uint32_t _size229; - ::apache::thrift::protocol::TType _etype232; - xfer += iprot->readListBegin(_etype232, _size229); - this->sorting_columns.resize(_size229); - uint32_t _i233; - for (_i233 = 0; _i233 < _size229; ++_i233) + uint32_t _size259; + ::apache::thrift::protocol::TType _etype262; + xfer += iprot->readListBegin(_etype262, _size259); + this->sorting_columns.resize(_size259); + uint32_t _i263; + for (_i263 = 0; _i263 < _size259; ++_i263) { - xfer += this->sorting_columns[_i233].read(iprot); + xfer += this->sorting_columns[_i263].read(iprot); } xfer += iprot->readListEnd(); } @@ -3683,10 +4183,10 @@ uint32_t RowGroup::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 1); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->columns.size())); - std::vector ::const_iterator _iter234; - for (_iter234 = this->columns.begin(); _iter234 != this->columns.end(); ++_iter234) + std::vector ::const_iterator _iter264; + for (_iter264 = this->columns.begin(); _iter264 != this->columns.end(); ++_iter264) { - xfer += (*_iter234).write(oprot); + xfer += (*_iter264).write(oprot); } xfer += oprot->writeListEnd(); } @@ -3704,10 +4204,10 @@ uint32_t RowGroup::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("sorting_columns", ::apache::thrift::protocol::T_LIST, 4); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->sorting_columns.size())); - std::vector ::const_iterator _iter235; - for (_iter235 = this->sorting_columns.begin(); _iter235 != this->sorting_columns.end(); ++_iter235) + std::vector ::const_iterator _iter265; + for (_iter265 = this->sorting_columns.begin(); _iter265 != this->sorting_columns.end(); ++_iter265) { - xfer += (*_iter235).write(oprot); + xfer += (*_iter265).write(oprot); } xfer += oprot->writeListEnd(); } @@ -3948,14 +4448,14 @@ uint32_t OffsetIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->page_locations.clear(); - uint32_t _size252; - ::apache::thrift::protocol::TType _etype255; - xfer += iprot->readListBegin(_etype255, _size252); - this->page_locations.resize(_size252); - uint32_t _i256; - for (_i256 = 0; _i256 < _size252; ++_i256) + uint32_t _size282; + ::apache::thrift::protocol::TType _etype285; + xfer += iprot->readListBegin(_etype285, _size282); + this->page_locations.resize(_size282); + uint32_t _i286; + for (_i286 = 0; _i286 < _size282; ++_i286) { - xfer += this->page_locations[_i256].read(iprot); + xfer += this->page_locations[_i286].read(iprot); } xfer += iprot->readListEnd(); } @@ -3968,14 +4468,14 @@ uint32_t OffsetIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->unencoded_byte_array_data_bytes.clear(); - uint32_t _size257; - ::apache::thrift::protocol::TType _etype260; - xfer += iprot->readListBegin(_etype260, _size257); - this->unencoded_byte_array_data_bytes.resize(_size257); - uint32_t _i261; - for (_i261 = 0; _i261 < _size257; ++_i261) + uint32_t _size287; + ::apache::thrift::protocol::TType _etype290; + xfer += iprot->readListBegin(_etype290, _size287); + this->unencoded_byte_array_data_bytes.resize(_size287); + uint32_t _i291; + for (_i291 = 0; _i291 < _size287; ++_i291) { - xfer += iprot->readI64(this->unencoded_byte_array_data_bytes[_i261]); + xfer += iprot->readI64(this->unencoded_byte_array_data_bytes[_i291]); } xfer += iprot->readListEnd(); } @@ -4007,10 +4507,10 @@ uint32_t OffsetIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("page_locations", ::apache::thrift::protocol::T_LIST, 1); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->page_locations.size())); - std::vector ::const_iterator _iter262; - for (_iter262 = this->page_locations.begin(); _iter262 != this->page_locations.end(); ++_iter262) + std::vector ::const_iterator _iter292; + for (_iter292 = this->page_locations.begin(); _iter292 != this->page_locations.end(); ++_iter292) { - xfer += (*_iter262).write(oprot); + xfer += (*_iter292).write(oprot); } xfer += oprot->writeListEnd(); } @@ -4020,10 +4520,10 @@ uint32_t OffsetIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("unencoded_byte_array_data_bytes", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->unencoded_byte_array_data_bytes.size())); - std::vector ::const_iterator _iter263; - for (_iter263 = this->unencoded_byte_array_data_bytes.begin(); _iter263 != this->unencoded_byte_array_data_bytes.end(); ++_iter263) + std::vector ::const_iterator _iter293; + for (_iter293 = this->unencoded_byte_array_data_bytes.begin(); _iter293 != this->unencoded_byte_array_data_bytes.end(); ++_iter293) { - xfer += oprot->writeI64((*_iter263)); + xfer += oprot->writeI64((*_iter293)); } xfer += oprot->writeListEnd(); } @@ -4064,14 +4564,14 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->null_pages.clear(); - uint32_t _size268; - ::apache::thrift::protocol::TType _etype271; - xfer += iprot->readListBegin(_etype271, _size268); - this->null_pages.resize(_size268); - uint32_t _i272; - for (_i272 = 0; _i272 < _size268; ++_i272) + uint32_t _size298; + ::apache::thrift::protocol::TType _etype301; + xfer += iprot->readListBegin(_etype301, _size298); + this->null_pages.resize(_size298); + uint32_t _i302; + for (_i302 = 0; _i302 < _size298; ++_i302) { - xfer += iprot->readBool(this->null_pages[_i272]); + xfer += iprot->readBool(this->null_pages[_i302]); } xfer += iprot->readListEnd(); } @@ -4084,14 +4584,14 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->min_values.clear(); - uint32_t _size273; - ::apache::thrift::protocol::TType _etype276; - xfer += iprot->readListBegin(_etype276, _size273); - this->min_values.resize(_size273); - uint32_t _i277; - for (_i277 = 0; _i277 < _size273; ++_i277) + uint32_t _size303; + ::apache::thrift::protocol::TType _etype306; + xfer += iprot->readListBegin(_etype306, _size303); + this->min_values.resize(_size303); + uint32_t _i307; + for (_i307 = 0; _i307 < _size303; ++_i307) { - xfer += iprot->readBinary(this->min_values[_i277]); + xfer += iprot->readBinary(this->min_values[_i307]); } xfer += iprot->readListEnd(); } @@ -4104,14 +4604,14 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->max_values.clear(); - uint32_t _size278; - ::apache::thrift::protocol::TType _etype281; - xfer += iprot->readListBegin(_etype281, _size278); - this->max_values.resize(_size278); - uint32_t _i282; - for (_i282 = 0; _i282 < _size278; ++_i282) + uint32_t _size308; + ::apache::thrift::protocol::TType _etype311; + xfer += iprot->readListBegin(_etype311, _size308); + this->max_values.resize(_size308); + uint32_t _i312; + for (_i312 = 0; _i312 < _size308; ++_i312) { - xfer += iprot->readBinary(this->max_values[_i282]); + xfer += iprot->readBinary(this->max_values[_i312]); } xfer += iprot->readListEnd(); } @@ -4122,9 +4622,9 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { break; case 4: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast283; - xfer += iprot->readI32(ecast283); - this->boundary_order = static_cast(ecast283); + int32_t ecast313; + xfer += iprot->readI32(ecast313); + this->boundary_order = static_cast(ecast313); isset_boundary_order = true; } else { xfer += iprot->skip(ftype); @@ -4134,14 +4634,14 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->null_counts.clear(); - uint32_t _size284; - ::apache::thrift::protocol::TType _etype287; - xfer += iprot->readListBegin(_etype287, _size284); - this->null_counts.resize(_size284); - uint32_t _i288; - for (_i288 = 0; _i288 < _size284; ++_i288) + uint32_t _size314; + ::apache::thrift::protocol::TType _etype317; + xfer += iprot->readListBegin(_etype317, _size314); + this->null_counts.resize(_size314); + uint32_t _i318; + for (_i318 = 0; _i318 < _size314; ++_i318) { - xfer += iprot->readI64(this->null_counts[_i288]); + xfer += iprot->readI64(this->null_counts[_i318]); } xfer += iprot->readListEnd(); } @@ -4154,14 +4654,14 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->repetition_level_histograms.clear(); - uint32_t _size289; - ::apache::thrift::protocol::TType _etype292; - xfer += iprot->readListBegin(_etype292, _size289); - this->repetition_level_histograms.resize(_size289); - uint32_t _i293; - for (_i293 = 0; _i293 < _size289; ++_i293) + uint32_t _size319; + ::apache::thrift::protocol::TType _etype322; + xfer += iprot->readListBegin(_etype322, _size319); + this->repetition_level_histograms.resize(_size319); + uint32_t _i323; + for (_i323 = 0; _i323 < _size319; ++_i323) { - xfer += iprot->readI64(this->repetition_level_histograms[_i293]); + xfer += iprot->readI64(this->repetition_level_histograms[_i323]); } xfer += iprot->readListEnd(); } @@ -4174,14 +4674,14 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->definition_level_histograms.clear(); - uint32_t _size294; - ::apache::thrift::protocol::TType _etype297; - xfer += iprot->readListBegin(_etype297, _size294); - this->definition_level_histograms.resize(_size294); - uint32_t _i298; - for (_i298 = 0; _i298 < _size294; ++_i298) + uint32_t _size324; + ::apache::thrift::protocol::TType _etype327; + xfer += iprot->readListBegin(_etype327, _size324); + this->definition_level_histograms.resize(_size324); + uint32_t _i328; + for (_i328 = 0; _i328 < _size324; ++_i328) { - xfer += iprot->readI64(this->definition_level_histograms[_i298]); + xfer += iprot->readI64(this->definition_level_histograms[_i328]); } xfer += iprot->readListEnd(); } @@ -4190,6 +4690,26 @@ uint32_t ColumnIndex::read(Protocol_* iprot) { xfer += iprot->skip(ftype); } break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->geometry_stats.clear(); + uint32_t _size329; + ::apache::thrift::protocol::TType _etype332; + xfer += iprot->readListBegin(_etype332, _size329); + this->geometry_stats.resize(_size329); + uint32_t _i333; + for (_i333 = 0; _i333 < _size329; ++_i333) + { + xfer += this->geometry_stats[_i333].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.geometry_stats = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -4219,10 +4739,10 @@ uint32_t ColumnIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("null_pages", ::apache::thrift::protocol::T_LIST, 1); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_BOOL, static_cast(this->null_pages.size())); - std::vector ::const_iterator _iter299; - for (_iter299 = this->null_pages.begin(); _iter299 != this->null_pages.end(); ++_iter299) + std::vector ::const_iterator _iter334; + for (_iter334 = this->null_pages.begin(); _iter334 != this->null_pages.end(); ++_iter334) { - xfer += oprot->writeBool((*_iter299)); + xfer += oprot->writeBool((*_iter334)); } xfer += oprot->writeListEnd(); } @@ -4231,10 +4751,10 @@ uint32_t ColumnIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("min_values", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->min_values.size())); - std::vector ::const_iterator _iter300; - for (_iter300 = this->min_values.begin(); _iter300 != this->min_values.end(); ++_iter300) + std::vector ::const_iterator _iter335; + for (_iter335 = this->min_values.begin(); _iter335 != this->min_values.end(); ++_iter335) { - xfer += oprot->writeBinary((*_iter300)); + xfer += oprot->writeBinary((*_iter335)); } xfer += oprot->writeListEnd(); } @@ -4243,10 +4763,10 @@ uint32_t ColumnIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("max_values", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->max_values.size())); - std::vector ::const_iterator _iter301; - for (_iter301 = this->max_values.begin(); _iter301 != this->max_values.end(); ++_iter301) + std::vector ::const_iterator _iter336; + for (_iter336 = this->max_values.begin(); _iter336 != this->max_values.end(); ++_iter336) { - xfer += oprot->writeBinary((*_iter301)); + xfer += oprot->writeBinary((*_iter336)); } xfer += oprot->writeListEnd(); } @@ -4260,10 +4780,10 @@ uint32_t ColumnIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("null_counts", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->null_counts.size())); - std::vector ::const_iterator _iter302; - for (_iter302 = this->null_counts.begin(); _iter302 != this->null_counts.end(); ++_iter302) + std::vector ::const_iterator _iter337; + for (_iter337 = this->null_counts.begin(); _iter337 != this->null_counts.end(); ++_iter337) { - xfer += oprot->writeI64((*_iter302)); + xfer += oprot->writeI64((*_iter337)); } xfer += oprot->writeListEnd(); } @@ -4273,10 +4793,10 @@ uint32_t ColumnIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("repetition_level_histograms", ::apache::thrift::protocol::T_LIST, 6); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->repetition_level_histograms.size())); - std::vector ::const_iterator _iter303; - for (_iter303 = this->repetition_level_histograms.begin(); _iter303 != this->repetition_level_histograms.end(); ++_iter303) + std::vector ::const_iterator _iter338; + for (_iter338 = this->repetition_level_histograms.begin(); _iter338 != this->repetition_level_histograms.end(); ++_iter338) { - xfer += oprot->writeI64((*_iter303)); + xfer += oprot->writeI64((*_iter338)); } xfer += oprot->writeListEnd(); } @@ -4286,10 +4806,23 @@ uint32_t ColumnIndex::write(Protocol_* oprot) const { xfer += oprot->writeFieldBegin("definition_level_histograms", ::apache::thrift::protocol::T_LIST, 7); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->definition_level_histograms.size())); - std::vector ::const_iterator _iter304; - for (_iter304 = this->definition_level_histograms.begin(); _iter304 != this->definition_level_histograms.end(); ++_iter304) + std::vector ::const_iterator _iter339; + for (_iter339 = this->definition_level_histograms.begin(); _iter339 != this->definition_level_histograms.end(); ++_iter339) { - xfer += oprot->writeI64((*_iter304)); + xfer += oprot->writeI64((*_iter339)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.geometry_stats) { + xfer += oprot->writeFieldBegin("geometry_stats", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->geometry_stats.size())); + std::vector ::const_iterator _iter340; + for (_iter340 = this->geometry_stats.begin(); _iter340 != this->geometry_stats.end(); ++_iter340) + { + xfer += (*_iter340).write(oprot); } xfer += oprot->writeListEnd(); } @@ -4577,14 +5110,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->schema.clear(); - uint32_t _size321; - ::apache::thrift::protocol::TType _etype324; - xfer += iprot->readListBegin(_etype324, _size321); - this->schema.resize(_size321); - uint32_t _i325; - for (_i325 = 0; _i325 < _size321; ++_i325) + uint32_t _size357; + ::apache::thrift::protocol::TType _etype360; + xfer += iprot->readListBegin(_etype360, _size357); + this->schema.resize(_size357); + uint32_t _i361; + for (_i361 = 0; _i361 < _size357; ++_i361) { - xfer += this->schema[_i325].read(iprot); + xfer += this->schema[_i361].read(iprot); } xfer += iprot->readListEnd(); } @@ -4605,14 +5138,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->row_groups.clear(); - uint32_t _size326; - ::apache::thrift::protocol::TType _etype329; - xfer += iprot->readListBegin(_etype329, _size326); - this->row_groups.resize(_size326); - uint32_t _i330; - for (_i330 = 0; _i330 < _size326; ++_i330) + uint32_t _size362; + ::apache::thrift::protocol::TType _etype365; + xfer += iprot->readListBegin(_etype365, _size362); + this->row_groups.resize(_size362); + uint32_t _i366; + for (_i366 = 0; _i366 < _size362; ++_i366) { - xfer += this->row_groups[_i330].read(iprot); + xfer += this->row_groups[_i366].read(iprot); } xfer += iprot->readListEnd(); } @@ -4625,14 +5158,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->key_value_metadata.clear(); - uint32_t _size331; - ::apache::thrift::protocol::TType _etype334; - xfer += iprot->readListBegin(_etype334, _size331); - this->key_value_metadata.resize(_size331); - uint32_t _i335; - for (_i335 = 0; _i335 < _size331; ++_i335) + uint32_t _size367; + ::apache::thrift::protocol::TType _etype370; + xfer += iprot->readListBegin(_etype370, _size367); + this->key_value_metadata.resize(_size367); + uint32_t _i371; + for (_i371 = 0; _i371 < _size367; ++_i371) { - xfer += this->key_value_metadata[_i335].read(iprot); + xfer += this->key_value_metadata[_i371].read(iprot); } xfer += iprot->readListEnd(); } @@ -4653,14 +5186,14 @@ uint32_t FileMetaData::read(Protocol_* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->column_orders.clear(); - uint32_t _size336; - ::apache::thrift::protocol::TType _etype339; - xfer += iprot->readListBegin(_etype339, _size336); - this->column_orders.resize(_size336); - uint32_t _i340; - for (_i340 = 0; _i340 < _size336; ++_i340) + uint32_t _size372; + ::apache::thrift::protocol::TType _etype375; + xfer += iprot->readListBegin(_etype375, _size372); + this->column_orders.resize(_size372); + uint32_t _i376; + for (_i376 = 0; _i376 < _size372; ++_i376) { - xfer += this->column_orders[_i340].read(iprot); + xfer += this->column_orders[_i376].read(iprot); } xfer += iprot->readListEnd(); } @@ -4718,10 +5251,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 _iter341; - for (_iter341 = this->schema.begin(); _iter341 != this->schema.end(); ++_iter341) + std::vector ::const_iterator _iter377; + for (_iter377 = this->schema.begin(); _iter377 != this->schema.end(); ++_iter377) { - xfer += (*_iter341).write(oprot); + xfer += (*_iter377).write(oprot); } xfer += oprot->writeListEnd(); } @@ -4734,10 +5267,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 _iter342; - for (_iter342 = this->row_groups.begin(); _iter342 != this->row_groups.end(); ++_iter342) + std::vector ::const_iterator _iter378; + for (_iter378 = this->row_groups.begin(); _iter378 != this->row_groups.end(); ++_iter378) { - xfer += (*_iter342).write(oprot); + xfer += (*_iter378).write(oprot); } xfer += oprot->writeListEnd(); } @@ -4747,10 +5280,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 _iter343; - for (_iter343 = this->key_value_metadata.begin(); _iter343 != this->key_value_metadata.end(); ++_iter343) + std::vector ::const_iterator _iter379; + for (_iter379 = this->key_value_metadata.begin(); _iter379 != this->key_value_metadata.end(); ++_iter379) { - xfer += (*_iter343).write(oprot); + xfer += (*_iter379).write(oprot); } xfer += oprot->writeListEnd(); } @@ -4765,10 +5298,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 _iter344; - for (_iter344 = this->column_orders.begin(); _iter344 != this->column_orders.end(); ++_iter344) + std::vector ::const_iterator _iter380; + for (_iter380 = this->column_orders.begin(); _iter380 != this->column_orders.end(); ++_iter380) { - xfer += (*_iter344).write(oprot); + xfer += (*_iter380).write(oprot); } xfer += oprot->writeListEnd(); } @@ -4862,6 +5395,7 @@ uint32_t FileCryptoMetaData::write(Protocol_* oprot) const { return xfer; } -}} // namespace +} +} // namespace #endif diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt index 17574261d891d..8110e43f83352 100644 --- a/cpp/src/parquet/CMakeLists.txt +++ b/cpp/src/parquet/CMakeLists.txt @@ -378,6 +378,8 @@ add_parquet_test(internals-test public_api_test.cc types_test.cc) +add_parquet_test(geometry-test SOURCES geometry_util_test.cc) + set_source_files_properties(public_api_test.cc PROPERTIES SKIP_PRECOMPILE_HEADERS ON SKIP_UNITY_BUILD_INCLUSION ON) diff --git a/cpp/src/parquet/geometry_util.h b/cpp/src/parquet/geometry_util.h new file mode 100644 index 0000000000000..4dccc0cf3bf3f --- /dev/null +++ b/cpp/src/parquet/geometry_util.h @@ -0,0 +1,614 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include +#include +#include +#include + +#include "arrow/util/endian.h" +#include "arrow/util/logging.h" +#include "arrow/util/ubsan.h" +#include "parquet/exception.h" + +namespace parquet::geometry { + +constexpr double kInf = std::numeric_limits::infinity(); + +struct Dimensions { + enum dimensions { XY = 0, XYZ = 1, XYM = 2, XYZM = 3 }; + + static dimensions FromWKB(uint32_t wkb_geometry_type) { + switch (wkb_geometry_type / 1000) { + case 0: + return XY; + case 1: + return XYZ; + case 2: + return XYM; + case 3: + return XYZM; + default: + throw ParquetException("Invalid wkb_geometry_type: ", wkb_geometry_type); + } + } + + template + constexpr static uint32_t size(); + + template <> + constexpr uint32_t size() { + return 2; + } + + template <> + constexpr uint32_t size() { + return 3; + } + + template <> + constexpr uint32_t size() { + return 3; + } + + template <> + constexpr uint32_t size() { + return 4; + } + + static uint32_t size(dimensions dims) { + switch (dims) { + case XY: + return size(); + case XYZ: + return size(); + case XYM: + return size(); + case XYZM: + return size(); + default: + return 0; + } + } + + // Where to look in a coordinate with this dimension + // for the X, Y, Z, and M dimensions, respectively. + static std::array ToXYZM(dimensions dims) { + switch (dims) { + case XY: + return {0, 1, -1, -1}; + case XYZ: + return {0, 1, 2, -1}; + case XYM: + return {0, 1, -1, 2}; + case XYZM: + return {0, 1, 2, 3}; + default: + return {-1, -1, -1, -1}; + } + } + + static std::string ToString(dimensions dims) { + switch (dims) { + case XY: + return "XY"; + case XYZ: + return "XYZ"; + case XYM: + return "XYM"; + case XYZM: + return "XYZM"; + default: + return ""; + } + } +}; + +struct GeometryType { + enum geometry_type { + POINT = 1, + LINESTRING = 2, + POLYGON = 3, + MULTIPOINT = 4, + MULTILINESTRING = 5, + MULTIPOLYGON = 6, + GEOMETRYCOLLECTION = 7 + }; + + static geometry_type FromWKB(uint32_t wkb_geometry_type) { + switch (wkb_geometry_type % 1000) { + case 1: + return POINT; + case 2: + return LINESTRING; + case 3: + return POLYGON; + case 4: + return MULTIPOINT; + case 5: + return MULTILINESTRING; + case 6: + return MULTIPOLYGON; + case 7: + return GEOMETRYCOLLECTION; + default: + throw ParquetException("Invalid wkb_geometry_type: ", wkb_geometry_type); + } + } + + static std::string ToString(geometry_type geometry_type) { + switch (geometry_type) { + case POINT: + return "POINT"; + case LINESTRING: + return "LINESTRING"; + case POLYGON: + return "POLYGON"; + case MULTIPOINT: + return "MULTIPOINT"; + case MULTILINESTRING: + return "MULTILINESTRING"; + case MULTIPOLYGON: + return "MULTIPOLYGON"; + case GEOMETRYCOLLECTION: + return "GEOMETRYCOLLECTION"; + default: + return ""; + } + } +}; + +class WKBBuffer { + public: + WKBBuffer() : data_(nullptr), size_(0) {} + WKBBuffer(const uint8_t* data, int64_t size) : data_(data), size_(size) {} + + void Init(const uint8_t* data, int64_t size) { + data_ = data; + size_ = size; + } + + uint8_t ReadUInt8() { + if (size_ < 1) { + throw ParquetException("Can't read 1 byte from empty WKBBuffer"); + } + + size_ -= 1; + return *data_++; + } + + uint32_t ReadUInt32(bool swap) { + if (ARROW_PREDICT_FALSE(swap)) { + return ReadUInt32(); + } else { + return ReadUInt32(); + } + } + + template + uint32_t ReadUInt32() { + if (size_ < sizeof(uint32_t)) { + throw ParquetException("Can't read 4 bytes from WKBBuffer with ", size_, + "remaining"); + } + + uint32_t value; + memcpy(&value, data_, sizeof(uint32_t)); + data_ += sizeof(uint32_t); + size_ -= sizeof(uint32_t); + + if constexpr (swap) { + value = ::arrow::bit_util::ByteSwap(value); + } + + return value; + } + + template + void ReadDoubles(uint32_t n, double* out) { + if (n == 0) { + return; + } + + size_t total_bytes = n * sizeof(double); + if (size_ < total_bytes) { + throw ParquetException("Can't read ", total_bytes, " bytes from WKBBuffer with ", + size_, "remaining"); + } + + memcpy(out, data_, total_bytes); + data_ += total_bytes; + size_ -= total_bytes; + + if constexpr (swap) { + for (uint32_t i = 0; i < n; i++) { + out[i] = ::arrow::bit_util::ByteSwap(out[i]); + } + } + } + + size_t size() { return size_; } + + private: + const uint8_t* data_; + size_t size_; +}; + +struct BoundingBox { + BoundingBox(Dimensions::dimensions dimensions, const std::array& mins, + const std::array& maxes) + : dimensions(dimensions) { + std::memcpy(min, mins.data(), sizeof(min)); + std::memcpy(max, maxes.data(), sizeof(max)); + } + explicit BoundingBox(Dimensions::dimensions dimensions = Dimensions::XYZM) + : dimensions(dimensions), + min{kInf, kInf, kInf, kInf}, + max{-kInf, -kInf, -kInf, -kInf} {} + + BoundingBox(const BoundingBox& other) = default; + BoundingBox& operator=(const BoundingBox&) = default; + + void Reset() { + for (int i = 0; i < 4; i++) { + min[i] = kInf; + max[i] = -kInf; + } + } + + void Merge(const BoundingBox& other) { + if (ARROW_PREDICT_TRUE(dimensions == other.dimensions)) { + for (int i = 0; i < 4; i++) { + min[i] = std::min(min[i], other.min[i]); + max[i] = std::max(max[i], other.max[i]); + } + + return; + } else if (dimensions == Dimensions::XYZM) { + Merge(other.ToXYZM()); + } else { + ParquetException::NYI(); + } + } + + BoundingBox ToXYZM() const { + BoundingBox xyzm(Dimensions::XYZM); + auto to_xyzm = Dimensions::ToXYZM(dimensions); + for (int i = 0; i < 4; i++) { + int dim_to_xyzm = to_xyzm[i]; + if (dim_to_xyzm == -1) { + xyzm.min[i] = kInf; + xyzm.max[i] = -kInf; + } else { + xyzm.min[i] = min[dim_to_xyzm]; + xyzm.max[i] = max[dim_to_xyzm]; + } + } + + return xyzm; + } + + std::string ToString() const { + std::stringstream ss; + ss << "BoundingBox " << Dimensions::ToString(dimensions) << " [" << min[0] << " => " + << max[0]; + for (int i = 1; i < 4; i++) { + ss << ", " << min[i] << " => " << max[i]; + } + + ss << "]"; + + return ss.str(); + } + + Dimensions::dimensions dimensions; + double min[4]; + double max[4]; +}; + +inline bool operator==(const BoundingBox& lhs, const BoundingBox& rhs) { + return lhs.dimensions == rhs.dimensions && + std::memcmp(lhs.min, rhs.min, sizeof(lhs.min)) == 0 && + std::memcmp(lhs.max, rhs.max, sizeof(lhs.max)) == 0; +} + +template +class WKBSequenceBounder { + public: + explicit WKBSequenceBounder(double* chunk) : box_(dims), chunk_(chunk) {} + + void ReadPoint(WKBBuffer* src) { + constexpr uint32_t coord_size = Dimensions::size(); + src->ReadDoubles(coord_size, chunk_); + for (uint32_t dim = 0; dim < coord_size; dim++) { + if (ARROW_PREDICT_TRUE(!std::isnan(chunk_[dim]))) { + box_.min[dim] = std::min(box_.min[dim], chunk_[dim]); + box_.max[dim] = std::max(box_.max[dim], chunk_[dim]); + } + } + } + + void ReadSequence(WKBBuffer* src) { + constexpr uint32_t coord_size = Dimensions::size(); + constexpr uint32_t coords_per_chunk = chunk_size / coord_size; + + uint32_t n_coords = src->ReadUInt32(); + uint32_t n_chunks = n_coords / coords_per_chunk; + for (uint32_t i = 0; i < n_chunks; i++) { + src->ReadDoubles(coords_per_chunk, chunk_); + ReadChunk(coords_per_chunk); + } + + uint32_t remaining_coords = n_coords - (n_chunks * coords_per_chunk); + src->ReadDoubles(remaining_coords * coord_size, chunk_); + ReadChunk(remaining_coords); + } + + void ReadRings(WKBBuffer* src) { + uint32_t n_rings = src->ReadUInt32(); + for (uint32_t i = 0; i < n_rings; i++) { + ReadSequence(src); + } + } + + void Reset() { box_.Reset(); } + + void Finish(BoundingBox* out) { out->Merge(box_); } + + private: + BoundingBox box_; + double* chunk_; + + void ReadChunk(uint32_t n_coords) { + constexpr uint32_t coord_size = Dimensions::size(); + for (uint32_t dim = 0; dim < coord_size; dim++) { + for (uint32_t i = 0; i < n_coords; i++) { + box_.min[dim] = std::min(box_.min[dim], chunk_[i * coord_size + dim]); + box_.max[dim] = std::max(box_.max[dim], chunk_[i * coord_size + dim]); + } + } + } +}; + +// We could (should?) avoid this madness by not templating the WKBSequenceBounder +class WKBGenericSequenceBounder { + public: + WKBGenericSequenceBounder() + : xy_(chunk_), + xyz_(chunk_), + xym_(chunk_), + xyzm_(chunk_), + xy_swap_(chunk_), + xyz_swap_(chunk_), + xym_swap_(chunk_), + xyzm_swap_(chunk_) {} + + void ReadPoint(WKBBuffer* src, Dimensions::dimensions dimensions, bool swap) { + if (ARROW_PREDICT_TRUE(!swap)) { + switch (dimensions) { + case Dimensions::XY: + xy_.ReadPoint(src); + break; + case Dimensions::XYZ: + xyz_.ReadPoint(src); + break; + case Dimensions::XYM: + xym_.ReadPoint(src); + break; + case Dimensions::XYZM: + xyzm_.ReadPoint(src); + break; + } + } else { + switch (dimensions) { + case Dimensions::XY: + xy_swap_.ReadPoint(src); + break; + case Dimensions::XYZ: + xyz_swap_.ReadPoint(src); + break; + case Dimensions::XYM: + xym_swap_.ReadPoint(src); + break; + case Dimensions::XYZM: + xyzm_swap_.ReadPoint(src); + break; + } + } + } + + void ReadSequence(WKBBuffer* src, Dimensions::dimensions dimensions, bool swap) { + if (ARROW_PREDICT_TRUE(!swap)) { + switch (dimensions) { + case Dimensions::XY: + xy_.ReadSequence(src); + break; + case Dimensions::XYZ: + xyz_.ReadSequence(src); + break; + case Dimensions::XYM: + xym_.ReadSequence(src); + break; + case Dimensions::XYZM: + xyzm_.ReadSequence(src); + break; + } + } else { + switch (dimensions) { + case Dimensions::XY: + xy_swap_.ReadSequence(src); + break; + case Dimensions::XYZ: + xyz_swap_.ReadSequence(src); + break; + case Dimensions::XYM: + xym_swap_.ReadSequence(src); + break; + case Dimensions::XYZM: + xyzm_swap_.ReadSequence(src); + break; + } + } + } + + void ReadRings(WKBBuffer* src, Dimensions::dimensions dimensions, bool swap) { + if (ARROW_PREDICT_TRUE(!swap)) { + switch (dimensions) { + case Dimensions::XY: + xy_.ReadRings(src); + break; + case Dimensions::XYZ: + xyz_.ReadRings(src); + break; + case Dimensions::XYM: + xym_.ReadRings(src); + break; + case Dimensions::XYZM: + xyzm_.ReadRings(src); + break; + } + } else { + switch (dimensions) { + case Dimensions::XY: + xy_swap_.ReadRings(src); + break; + case Dimensions::XYZ: + xyz_swap_.ReadRings(src); + break; + case Dimensions::XYM: + xym_swap_.ReadRings(src); + break; + case Dimensions::XYZM: + xyzm_swap_.ReadRings(src); + break; + } + } + } + + void Finish(BoundingBox* out) { + xy_.Finish(out); + xyz_.Finish(out); + xym_.Finish(out); + xyzm_.Finish(out); + xy_swap_.Finish(out); + xyz_swap_.Finish(out); + xym_swap_.Finish(out); + xyzm_swap_.Finish(out); + } + + void Reset() { + xy_.Reset(); + xyz_.Reset(); + xym_.Reset(); + xyzm_.Reset(); + xy_swap_.Reset(); + xyz_swap_.Reset(); + xym_swap_.Reset(); + xyzm_swap_.Reset(); + } + + private: + double chunk_[64]; + WKBSequenceBounder xy_; + WKBSequenceBounder xyz_; + WKBSequenceBounder xym_; + WKBSequenceBounder xyzm_; + WKBSequenceBounder xy_swap_; + WKBSequenceBounder xyz_swap_; + WKBSequenceBounder xym_swap_; + WKBSequenceBounder xyzm_swap_; +}; + +class WKBGeometryBounder { + public: + WKBGeometryBounder() : box_(Dimensions::XYZM) {} + + void ReadGeometry(WKBBuffer* src, bool record_wkb_type = true) { + uint8_t endian = src->ReadUInt8(); +#if defined(ARROW_LITTLE_ENDIAN) + bool swap = endian != 0x01; +#else + bool swap = endian != 0x00; +#endif + + uint32_t wkb_geometry_type = src->ReadUInt32(swap); + auto geometry_type = GeometryType::FromWKB(wkb_geometry_type); + auto dimensions = Dimensions::FromWKB(wkb_geometry_type); + + // Keep track of geometry types encountered if at the top level + if (record_wkb_type) { + wkb_types_.insert(wkb_geometry_type); + } + + switch (geometry_type) { + case GeometryType::POINT: + bounder_.ReadPoint(src, dimensions, swap); + break; + case GeometryType::LINESTRING: + bounder_.ReadSequence(src, dimensions, swap); + break; + case GeometryType::POLYGON: + bounder_.ReadRings(src, dimensions, swap); + break; + + // These are all encoded the same in WKB, even though this encoding would + // allow for parts to be of a different geometry type or different dimensions. + // For the purposes of bounding, this does not cause us problems. + case GeometryType::MULTIPOINT: + case GeometryType::MULTILINESTRING: + case GeometryType::MULTIPOLYGON: + case GeometryType::GEOMETRYCOLLECTION: { + uint32_t n_parts = src->ReadUInt32(swap); + for (uint32_t i = 0; i < n_parts; i++) { + ReadGeometry(src, /*record_wkb_type*/ false); + } + break; + } + } + } + + void ReadBox(const BoundingBox& box) { box_.Merge(box); } + + void ReadGeometryTypes(const std::vector& geometry_types) { + wkb_types_.insert(geometry_types.begin(), geometry_types.end()); + } + + const BoundingBox& Bounds() const { return box_; } + + std::vector WkbTypes() const { + std::vector out(wkb_types_.begin(), wkb_types_.end()); + std::sort(out.begin(), out.end()); + return out; + } + + void Flush() { bounder_.Finish(&box_); } + + void Reset() { + box_.Reset(); + bounder_.Reset(); + wkb_types_.clear(); + } + + private: + BoundingBox box_; + WKBGenericSequenceBounder bounder_; + std::unordered_set wkb_types_; +}; + +} // namespace parquet::geometry diff --git a/cpp/src/parquet/geometry_util_test.cc b/cpp/src/parquet/geometry_util_test.cc new file mode 100644 index 0000000000000..b92c9b6a8d5af --- /dev/null +++ b/cpp/src/parquet/geometry_util_test.cc @@ -0,0 +1,449 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include +#include + +#include "arrow/testing/gtest_compat.h" + +#include "parquet/geometry_util.h" + +namespace parquet::geometry { + +TEST(TestGeometryUtil, TestDimensions) { + EXPECT_EQ(Dimensions::size(Dimensions::XY), 2); + EXPECT_EQ(Dimensions::size(Dimensions::XYZ), 3); + EXPECT_EQ(Dimensions::size(Dimensions::XYM), 3); + EXPECT_EQ(Dimensions::size(Dimensions::XYZM), 4); + + EXPECT_EQ(Dimensions::ToString(Dimensions::XY), "XY"); + EXPECT_EQ(Dimensions::ToString(Dimensions::XYZ), "XYZ"); + EXPECT_EQ(Dimensions::ToString(Dimensions::XYM), "XYM"); + EXPECT_EQ(Dimensions::ToString(Dimensions::XYZM), "XYZM"); + + EXPECT_EQ(Dimensions::FromWKB(1), Dimensions::XY); + EXPECT_EQ(Dimensions::FromWKB(1001), Dimensions::XYZ); + EXPECT_EQ(Dimensions::FromWKB(2001), Dimensions::XYM); + EXPECT_EQ(Dimensions::FromWKB(3001), Dimensions::XYZM); + EXPECT_THROW(Dimensions::FromWKB(4001), ParquetException); +} + +TEST(TestGeometryUtil, TestGeometryType) { + EXPECT_EQ(GeometryType::ToString(GeometryType::POINT), "POINT"); + EXPECT_EQ(GeometryType::ToString(GeometryType::LINESTRING), "LINESTRING"); + EXPECT_EQ(GeometryType::ToString(GeometryType::POLYGON), "POLYGON"); + EXPECT_EQ(GeometryType::ToString(GeometryType::MULTIPOINT), "MULTIPOINT"); + EXPECT_EQ(GeometryType::ToString(GeometryType::MULTILINESTRING), "MULTILINESTRING"); + EXPECT_EQ(GeometryType::ToString(GeometryType::MULTIPOLYGON), "MULTIPOLYGON"); + EXPECT_EQ(GeometryType::ToString(GeometryType::GEOMETRYCOLLECTION), + "GEOMETRYCOLLECTION"); + + EXPECT_EQ(GeometryType::FromWKB(1), GeometryType::POINT); + EXPECT_EQ(GeometryType::FromWKB(1001), GeometryType::POINT); + EXPECT_EQ(GeometryType::FromWKB(1002), GeometryType::LINESTRING); + EXPECT_EQ(GeometryType::FromWKB(1003), GeometryType::POLYGON); + EXPECT_EQ(GeometryType::FromWKB(1004), GeometryType::MULTIPOINT); + EXPECT_EQ(GeometryType::FromWKB(1005), GeometryType::MULTILINESTRING); + EXPECT_EQ(GeometryType::FromWKB(1006), GeometryType::MULTIPOLYGON); + EXPECT_EQ(GeometryType::FromWKB(1007), GeometryType::GEOMETRYCOLLECTION); + EXPECT_THROW(GeometryType::FromWKB(1100), ParquetException); +} + +TEST(TestGeometryUtil, TestBoundingBox) { + BoundingBox box; + EXPECT_EQ(box, BoundingBox(Dimensions::XYZM, {kInf, kInf, kInf, kInf}, + {-kInf, -kInf, -kInf, -kInf})); + EXPECT_EQ(box.ToString(), + "BoundingBox XYZM [inf => -inf, inf => -inf, inf => -inf, inf => -inf]"); + + BoundingBox box_xyzm(Dimensions::XYZM, {-1, -2, -3, -4}, {1, 2, 3, 4}); + + BoundingBox box_xy(Dimensions::XY, {-10, -20, kInf, kInf}, {10, 20, -kInf, -kInf}); + BoundingBox box_xyz(Dimensions::XYZ, {kInf, kInf, -30, kInf}, + {-kInf, -kInf, 30, -kInf}); + BoundingBox box_xym(Dimensions::XYM, {kInf, kInf, -40, kInf}, + {-kInf, -kInf, 40, -kInf}); + + box_xyzm.Merge(box_xy); + EXPECT_EQ(box_xyzm, BoundingBox(Dimensions::XYZM, {-10, -20, -3, -4}, {10, 20, 3, 4})); + + box_xyzm.Merge(box_xyz); + EXPECT_EQ(box_xyzm, + BoundingBox(Dimensions::XYZM, {-10, -20, -30, -4}, {10, 20, 30, 4})); + + box_xyzm.Merge(box_xym); + EXPECT_EQ(box_xyzm, + BoundingBox(Dimensions::XYZM, {-10, -20, -30, -40}, {10, 20, 30, 40})); + + box_xyzm.Reset(); + EXPECT_EQ(box_xyzm, BoundingBox()); +} + +struct WKBTestCase { + WKBTestCase() = default; + WKBTestCase(GeometryType::geometry_type x, Dimensions::dimensions y, + const std::vector& z, const std::vector& box_values = {}) + : geometry_type(x), dimensions(y), wkb(z) { + std::array mins = {kInf, kInf, kInf, kInf}; + std::array maxes{-kInf, -kInf, -kInf, -kInf}; + for (uint32_t i = 0; i < Dimensions::size(y); i++) { + mins[i] = box_values[i]; + maxes[i] = box_values[Dimensions::size(y) + i]; + } + box = BoundingBox(y, mins, maxes).ToXYZM(); + } + WKBTestCase(const WKBTestCase& other) = default; + + GeometryType::geometry_type geometry_type; + Dimensions::dimensions dimensions; + std::vector wkb; + BoundingBox box; +}; + +std::ostream& operator<<(std::ostream& os, const WKBTestCase& obj) { + os << GeometryType::ToString(obj.geometry_type) << " " + << Dimensions::ToString(obj.dimensions); + return os; +} + +std::ostream& operator<<(std::ostream& os, const BoundingBox& obj) { + os << obj.ToString(); + return os; +} + +class WKBTestFixture : public ::testing::TestWithParam { + protected: + WKBTestCase test_case; +}; + +TEST_P(WKBTestFixture, TestWKBBounderNonEmpty) { + auto item = GetParam(); + + WKBGeometryBounder bounder; + EXPECT_EQ(bounder.Bounds(), BoundingBox()); + + WKBBuffer buf(item.wkb.data(), item.wkb.size()); + bounder.ReadGeometry(&buf); + EXPECT_EQ(buf.size(), 0); + + bounder.Flush(); + EXPECT_EQ(bounder.Bounds(), item.box); + uint32_t wkb_type = item.dimensions * 1000 + item.geometry_type; + EXPECT_THAT(bounder.WkbTypes(), ::testing::ElementsAre(::testing::Eq(wkb_type))); + + bounder.Reset(); + EXPECT_EQ(bounder.Bounds(), BoundingBox()); + EXPECT_TRUE(bounder.WkbTypes().empty()); +} + +INSTANTIATE_TEST_SUITE_P( + TestGeometryUtil, WKBTestFixture, + ::testing::Values( + // POINT (30 10) + WKBTestCase(GeometryType::POINT, Dimensions::XY, + {0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40}, + {30, 10, 30, 10}), + // POINT Z (30 10 40) + WKBTestCase(GeometryType::POINT, Dimensions::XYZ, + {0x01, 0xe9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40}, + {30, 10, 40, 30, 10, 40}), + // POINT M (30 10 300) + WKBTestCase(GeometryType::POINT, Dimensions::XYM, + {0x01, 0xd1, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {30, 10, 300, 30, 10, 300}), + // POINT ZM (30 10 40 300) + WKBTestCase(GeometryType::POINT, Dimensions::XYZM, + {0x01, 0xb9, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {30, 10, 40, 300, 30, 10, 40, 300}), + // LINESTRING (30 10, 10 30, 40 40) + WKBTestCase(GeometryType::LINESTRING, Dimensions::XY, + {0x01, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40}, + {10, 10, 40, 40}), + // LINESTRING Z (30 10 40, 10 30 40, 40 40 80) + WKBTestCase(GeometryType::LINESTRING, Dimensions::XYZ, + {0x01, 0xea, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x54, 0x40}, + {10, 10, 40, 40, 40, 80}), + // LINESTRING M (30 10 300, 10 30 300, 40 40 1600) + WKBTestCase(GeometryType::LINESTRING, Dimensions::XYM, + {0x01, 0xd2, 0x07, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, + 0x72, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x99, 0x40}, + {10, 10, 300, 40, 40, 1600}), + // LINESTRING ZM (30 10 40 300, 10 30 40 300, 40 40 80 1600) + WKBTestCase(GeometryType::LINESTRING, Dimensions::XYZM, + {0x01, 0xba, 0x0b, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x99, 0x40}, + {10, 10, 40, 300, 40, 40, 80, 1600}), + // POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10)) + WKBTestCase(GeometryType::POLYGON, Dimensions::XY, + {0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x24, 0x40}, + {10, 10, 40, 40}), + // POLYGON Z ((30 10 40, 40 40 80, 20 40 60, 10 20 30, 30 10 40)) + WKBTestCase( + GeometryType::POLYGON, Dimensions::XYZ, + {0x01, 0xeb, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x40}, + {10, 10, 30, 40, 40, 80}), + // POLYGON M ((30 10 300, 40 40 1600, 20 40 800, 10 20 200, 30 10 300)) + WKBTestCase( + GeometryType::POLYGON, Dimensions::XYM, + {0x01, 0xd3, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x69, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0x72, 0x40}, + {10, 10, 200, 40, 40, 1600}), + // POLYGON ZM ((30 10 40 300, 40 40 80 1600, 20 40 60 800, 10 20 30 200, 30 10 40 + // 300)) + WKBTestCase( + GeometryType::POLYGON, Dimensions::XYZM, + {0x01, 0xbb, 0x0b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x54, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc0, 0x72, 0x40}, + {10, 10, 30, 200, 40, 40, 80, 1600}), + // MULTIPOINT ((30 10)) + WKBTestCase(GeometryType::MULTIPOINT, Dimensions::XY, + {0x01, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40}, + {30, 10, 30, 10}), + // MULTIPOINT Z ((30 10 40)) + WKBTestCase(GeometryType::MULTIPOINT, Dimensions::XYZ, + {0x01, 0xec, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0xe9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40}, + {30, 10, 40, 30, 10, 40}), + // MULTIPOINT M ((30 10 300)) + WKBTestCase(GeometryType::MULTIPOINT, Dimensions::XYM, + {0x01, 0xd4, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0xd1, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {30, 10, 300, 30, 10, 300}), + // MULTIPOINT ZM ((30 10 40 300)) + WKBTestCase(GeometryType::MULTIPOINT, Dimensions::XYZM, + {0x01, 0xbc, 0x0b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0xb9, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {30, 10, 40, 300, 30, 10, 40, 300}), + // MULTILINESTRING ((30 10, 10 30, 40 40)) + WKBTestCase(GeometryType::MULTILINESTRING, Dimensions::XY, + {0x01, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40}, + {10, 10, 40, 40}), + // MULTILINESTRING Z ((30 10 40, 10 30 40, 40 40 80)) + WKBTestCase( + GeometryType::MULTILINESTRING, Dimensions::XYZ, + {0x01, 0xed, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0xea, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x40}, + {10, 10, 40, 40, 40, 80}), + // MULTILINESTRING M ((30 10 300, 10 30 300, 40 40 1600)) + WKBTestCase( + GeometryType::MULTILINESTRING, Dimensions::XYM, + {0x01, 0xd5, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0xd2, 0x07, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0x72, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x40}, + {10, 10, 300, 40, 40, 1600}), + // MULTILINESTRING ZM ((30 10 40 300, 10 30 40 300, 40 40 80 1600)) + WKBTestCase( + GeometryType::MULTILINESTRING, Dimensions::XYZM, + {0x01, 0xbd, 0x0b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0xba, 0x0b, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc0, 0x72, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x54, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x40}, + {10, 10, 40, 300, 40, 40, 80, 1600}), + // MULTIPOLYGON (((30 10, 40 40, 20 40, 10 20, 30 10))) + WKBTestCase( + GeometryType::MULTIPOLYGON, Dimensions::XY, + {0x01, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40}, + {10, 10, 40, 40}), + // MULTIPOLYGON Z (((30 10 40, 40 40 80, 20 40 60, 10 20 30, 30 10 40))) + WKBTestCase( + GeometryType::MULTIPOLYGON, Dimensions::XYZ, + {0x01, 0xee, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0xeb, 0x03, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x54, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x4e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40}, + {10, 10, 30, 40, 40, 80}), + // MULTIPOLYGON M (((30 10 300, 40 40 1600, 20 40 800, 10 20 200, 30 10 300))) + WKBTestCase( + GeometryType::MULTIPOLYGON, Dimensions::XYM, + {0x01, 0xd6, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0xd3, 0x07, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x99, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {10, 10, 200, 40, 40, 1600}), + // MULTIPOLYGON ZM (((30 10 40 300, 40 40 80 1600, 20 40 60 800, 10 20 30 200, 30 + // 10 40 300))) + WKBTestCase(GeometryType::MULTIPOLYGON, Dimensions::XYZM, + {0x01, 0xbe, 0x0b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0xbb, + 0x0b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x34, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {10, 10, 30, 200, 40, 40, 80, 1600}), + // GEOMETRYCOLLECTION (POINT (30 10)) + WKBTestCase(GeometryType::GEOMETRYCOLLECTION, Dimensions::XY, + {0x01, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40}, + {30, 10, 30, 10}), + // GEOMETRYCOLLECTION Z (POINT Z (30 10 40)) + WKBTestCase(GeometryType::GEOMETRYCOLLECTION, Dimensions::XYZ, + {0x01, 0xef, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0xe9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40}, + {30, 10, 40, 30, 10, 40}), + // GEOMETRYCOLLECTION M (POINT M (30 10 300)) + WKBTestCase(GeometryType::GEOMETRYCOLLECTION, Dimensions::XYM, + {0x01, 0xd7, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0xd1, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {30, 10, 300, 30, 10, 300}), + // GEOMETRYCOLLECTION ZM (POINT ZM (30 10 40 300)) + WKBTestCase(GeometryType::GEOMETRYCOLLECTION, Dimensions::XYZM, + {0x01, 0xbf, 0x0b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0xb9, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40}, + {30, 10, 40, 300, 30, 10, 40, 300}))); + +} // namespace parquet::geometry diff --git a/cpp/src/parquet/metadata.cc b/cpp/src/parquet/metadata.cc index 10c8afaf37507..5c7e28aca11ba 100644 --- a/cpp/src/parquet/metadata.cc +++ b/cpp/src/parquet/metadata.cc @@ -88,6 +88,38 @@ std::string ParquetVersionToString(ParquetVersion::type ver) { return "UNKNOWN"; } +static EncodedGeometryStatistics MakeEncodedGeometryStatistics( + const format::Statistics& stats) { + EncodedGeometryStatistics out; + + if (stats.__isset.geometry_stats) { + const format::GeometryStatistics& geom_stats = stats.geometry_stats; + out.geometry_types = std::vector(geom_stats.geometry_types.begin(), + geom_stats.geometry_types.end()); + + out.xmin = geom_stats.bbox.xmin; + out.xmax = geom_stats.bbox.xmax; + out.ymin = geom_stats.bbox.ymin; + out.ymax = geom_stats.bbox.ymax; + + if (geom_stats.bbox.__isset.zmin && geom_stats.bbox.__isset.zmax) { + out.zmin = geom_stats.bbox.zmin; + out.zmax = geom_stats.bbox.zmax; + } + + if (geom_stats.bbox.__isset.mmin && geom_stats.bbox.__isset.mmax) { + out.mmin = geom_stats.bbox.mmin; + out.mmax = geom_stats.bbox.mmax; + } + + for (const auto& covering : geom_stats.coverings) { + out.coverings.emplace_back(covering.kind, covering.value); + } + } + + return out; +} + template static std::shared_ptr MakeTypedColumnStats( const format::ColumnMetaData& metadata, const ColumnDescriptor* descr) { @@ -97,17 +129,21 @@ static std::shared_ptr MakeTypedColumnStats( descr, metadata.statistics.min_value, metadata.statistics.max_value, metadata.num_values - metadata.statistics.null_count, metadata.statistics.null_count, metadata.statistics.distinct_count, + MakeEncodedGeometryStatistics(metadata.statistics), metadata.statistics.__isset.max_value && metadata.statistics.__isset.min_value, metadata.statistics.__isset.null_count, - metadata.statistics.__isset.distinct_count); + metadata.statistics.__isset.distinct_count, + metadata.statistics.__isset.geometry_stats); } // Default behavior return MakeStatistics( descr, metadata.statistics.min, metadata.statistics.max, metadata.num_values - metadata.statistics.null_count, metadata.statistics.null_count, metadata.statistics.distinct_count, + MakeEncodedGeometryStatistics(metadata.statistics), metadata.statistics.__isset.max && metadata.statistics.__isset.min, - metadata.statistics.__isset.null_count, metadata.statistics.__isset.distinct_count); + metadata.statistics.__isset.null_count, metadata.statistics.__isset.distinct_count, + metadata.statistics.__isset.geometry_stats); } std::shared_ptr MakeColumnStats(const format::ColumnMetaData& meta_data, diff --git a/cpp/src/parquet/parquet.thrift b/cpp/src/parquet/parquet.thrift index a1883d335aa23..61a40882a6155 100644 --- a/cpp/src/parquet/parquet.thrift +++ b/cpp/src/parquet/parquet.thrift @@ -20,8 +20,7 @@ /** * File format description for the parquet file format */ -cpp_include "parquet/windows_compatibility.h" -namespace cpp parquet.format +namespace cpp parquet namespace java org.apache.parquet.format /** @@ -238,6 +237,89 @@ struct SizeStatistics { 3: optional list definition_level_histogram; } +/** + * Interpretation for edges of GEOMETRY logical type, i.e. whether the edge + * between points represent a straight cartesian line or the shortest line on + * the sphere. Please note that it only applies to polygons. + */ +enum Edges { + PLANAR = 0; + SPHERICAL = 1; +} + +/** + * A custom WKB-encoded polygon or multi-polygon to represent a covering of + * geometries. For example, it may be a bounding box or an envelope of geometries + * when a bounding box cannot be built (e.g., a geometry has spherical edges, or if + * an edge of geographic coordinates crosses the antimeridian). In addition, it can + * also be used to provide vendor-agnostic coverings like S2 or H3 grids. + */ +struct Covering { + /** + * A type of covering. Currently accepted values: "WKB". + */ + 1: required string kind; + /** A payload specific to kind: + * - WKB: well-known binary of a POLYGON that completely covers the contents. + * This will be interpreted according to the same CRS and edges defined by + * the logical type. + */ + 2: required binary value; +} + +/** + * Bounding box of geometries in the representation of min/max value pair of + * coordinates from each axis. Values of Z and M are omitted for 2D geometries. + */ +struct BoundingBox { + 1: required double xmin; + 2: required double xmax; + 3: required double ymin; + 4: required double ymax; + 5: optional double zmin; + 6: optional double zmax; + 7: optional double mmin; + 8: optional double mmax; +} + +/** Statistics specific to GEOMETRY logical type */ +struct GeometryStatistics { + /** A bounding box of geometries */ + 1: optional BoundingBox bbox; + + /** A list of coverings of geometries */ + 2: optional list coverings; + + /** + * The geometry types of all geometries, or an empty array if they are not + * known. This is borrowed from `geometry_types` column metadata of GeoParquet [1] + * except that values in the list are WKB (ISO variant) integer codes [2]. Table + * below shows the most common geometry types and their codes: + * + * | Type | XY | XYZ | XYM | XYZM | + * | :----------------- | :--- | :--- | :--- | :--: | + * | Point | 0001 | 1001 | 2001 | 3001 | + * | LineString | 0002 | 1002 | 2002 | 3002 | + * | Polygon | 0003 | 1003 | 2003 | 3003 | + * | MultiPoint | 0004 | 1004 | 2004 | 3004 | + * | MultiLineString | 0005 | 1005 | 2005 | 3005 | + * | MultiPolygon | 0006 | 1006 | 2006 | 3006 | + * | GeometryCollection | 0007 | 1007 | 2007 | 3007 | + * + * In addition, the following rules are used: + * - A list of multiple values indicates that multiple geometry types are + * present (e.g. `[0003, 0006]`). + * - An empty array explicitly signals that the geometry types are not known. + * - The geometry types in the list must be unique (e.g. `[0001, 0001]` + * is not valid). + * + * Please refer to links below for more detail: + * [1] https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary + * [2] https://github.com/opengeospatial/geoparquet/blob/v1.0.0/format-specs/geoparquet.md?plain=1#L91 + */ + 3: optional list geometry_types; +} + /** * Statistics per row group and per page * All fields are optional. @@ -280,6 +362,9 @@ struct Statistics { 7: optional bool is_max_value_exact; /** If true, min_value is the actual minimum value for a column */ 8: optional bool is_min_value_exact; + + /** statistics specific to geometry logical type */ + 9: optional GeometryStatistics geometry_stats; } /** Empty structs to use as logical type annotations */ @@ -374,6 +459,56 @@ struct JsonType { struct BsonType { } +/** + * Physical type and encoding for the geometry type. + */ +enum GeometryEncoding { + /** + * Allowed for physical type: BYTE_ARRAY. + * + * Well-known binary (WKB) representations of geometries. It supports 2D or + * 3D geometries of the standard geometry types (Point, LineString, Polygon, + * MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection). This + * is the preferred option for maximum portability. + * + * This encoding enables GeometryStatistics to be set in the column chunk + * and page index. + */ + WKB = 0; + + // TODO: add native encoding from GeoParquet/GeoArrow +} + +/** + * Geometry logical type annotation (added in 2.11.0) + */ +struct GeometryType { + /** + * Physical type and encoding for the geometry type. Please refer to the + * definition of GeometryEncoding for more detail. + */ + 1: required GeometryEncoding encoding; + /** + * Edges of polygon. + */ + 2: required Edges edges; + /** + * Coordinate Reference System, i.e. mapping of how coordinates refer to + * precise locations on earth. + */ + 3: optional string crs; + /** + * Encoding used in the above crs field. + * Currently the only allowed value is "PROJJSON". + */ + 4: optional string crs_encoding; + /** + * Additional informative metadata. + * It can be used by GeoParquet to offload some of the column metadata. + */ + 5: optional binary metadata; +} + /** * LogicalType annotations to replace ConvertedType. * @@ -404,6 +539,7 @@ union LogicalType { 13: BsonType BSON // use ConvertedType BSON 14: UUIDType UUID // no compatible ConvertedType 15: Float16Type FLOAT16 // no compatible ConvertedType + 16: GeometryType GEOMETRY // no compatible ConvertedType } /** @@ -527,12 +663,15 @@ enum Encoding { */ RLE_DICTIONARY = 8; - /** Encoding for floating-point data. + /** Encoding for fixed-width data (FLOAT, DOUBLE, INT32, INT64, FIXED_LEN_BYTE_ARRAY). K byte-streams are created where K is the size in bytes of the data type. - The individual bytes of an FP value are scattered to the corresponding stream and + The individual bytes of a value are scattered to the corresponding stream and the streams are concatenated. This itself does not reduce the size of the data but can lead to better compression afterwards. + + Added in 2.8 for FLOAT and DOUBLE. + Support for INT32, INT64 and FIXED_LEN_BYTE_ARRAY added in 2.11. */ BYTE_STREAM_SPLIT = 9; } @@ -736,10 +875,10 @@ struct PageHeader { } /** - * Wrapper struct to specify sort order + * Sort order within a RowGroup of a leaf column */ struct SortingColumn { - /** The column index (in this row group) **/ + /** The ordinal position of the column (in this row group) **/ 1: required i32 column_idx /** If true, indicates this column is sorted in descending order. **/ @@ -789,7 +928,7 @@ struct ColumnMetaData { /** total byte size of all uncompressed pages in this column chunk (including the headers) **/ 6: required i64 total_uncompressed_size - /** total byte size of all compressed, and potentially encrypted, pages + /** total byte size of all compressed, and potentially encrypted, pages * in this column chunk (including the headers) **/ 7: required i64 total_compressed_size @@ -904,10 +1043,10 @@ struct RowGroup { * in this row group **/ 5: optional i64 file_offset - /** Total byte size of all compressed (and potentially encrypted) column data + /** Total byte size of all compressed (and potentially encrypted) column data * in this row group **/ 6: optional i64 total_compressed_size - + /** Row group ordinal in the file **/ 7: optional i16 ordinal } @@ -946,12 +1085,13 @@ union ColumnOrder { * TIME_MICROS - signed comparison * TIMESTAMP_MILLIS - signed comparison * TIMESTAMP_MICROS - signed comparison - * INTERVAL - unsigned comparison + * INTERVAL - undefined * JSON - unsigned byte-wise comparison * BSON - unsigned byte-wise comparison * ENUM - unsigned byte-wise comparison * LIST - undefined * MAP - undefined + * GEOMETRY - undefined, use GeometryStatistics instead. * * In the absence of logical types, the sort order is determined by the physical type: * BOOLEAN - false, true @@ -971,7 +1111,7 @@ union ColumnOrder { * - If the min is +0, the row group may contain -0 values as well. * - If the max is -0, the row group may contain +0 values as well. * - When looking for NaN values, min and max should be ignored. - * + * * When writing statistics the following rules should be followed: * - NaNs should not be written to min or max statistics fields. * - If the computed max value is zero (whether negative or positive), @@ -999,6 +1139,13 @@ struct PageLocation { 3: required i64 first_row_index } +/** + * Optional offsets for each data page in a ColumnChunk. + * + * Forms part of the page index, along with ColumnIndex. + * + * OffsetIndex may be present even if ColumnIndex is not. + */ struct OffsetIndex { /** * PageLocations, ordered by increasing PageLocation.offset. It is required @@ -1015,8 +1162,14 @@ struct OffsetIndex { } /** - * Description for ColumnIndex. - * Each [i] refers to the page at OffsetIndex.page_locations[i] + * Optional statistics for each data page in a ColumnChunk. + * + * Forms part the page index, along with OffsetIndex. + * + * If this structure is present, OffsetIndex must also be present. + * + * For each field in this structure, [i] refers to the page at + * OffsetIndex.page_locations[i] */ struct ColumnIndex { /** @@ -1070,6 +1223,8 @@ struct ColumnIndex { **/ 7: optional list definition_level_histograms; + /** A list containing statistics of GEOMETRY logical type for each page */ + 8: optional list geometry_stats; } struct AesGcmV1 { @@ -1149,30 +1304,30 @@ struct FileMetaData { */ 7: optional list column_orders; - /** + /** * Encryption algorithm. This field is set only in encrypted files * with plaintext footer. Files with encrypted footer store algorithm id * in FileCryptoMetaData structure. */ 8: optional EncryptionAlgorithm encryption_algorithm - /** - * Retrieval metadata of key used for signing the footer. - * Used only in encrypted files with plaintext footer. - */ + /** + * Retrieval metadata of key used for signing the footer. + * Used only in encrypted files with plaintext footer. + */ 9: optional binary footer_signing_key_metadata } /** Crypto metadata for files with encrypted footer **/ struct FileCryptoMetaData { - /** + /** * Encryption algorithm. This field is only used for files * with encrypted footer. Files with plaintext footer store algorithm id * inside footer (FileMetaData structure). */ 1: required EncryptionAlgorithm encryption_algorithm - - /** Retrieval metadata of key used for encryption of footer, + + /** Retrieval metadata of key used for encryption of footer, * and (possibly) columns **/ 2: optional binary key_metadata } diff --git a/cpp/src/parquet/schema_test.cc b/cpp/src/parquet/schema_test.cc index 2532a8656e69f..fb498c543cdbb 100644 --- a/cpp/src/parquet/schema_test.cc +++ b/cpp/src/parquet/schema_test.cc @@ -1544,6 +1544,11 @@ TEST(TestLogicalTypeOperation, LogicalTypeRepresentation) { {LogicalType::BSON(), "BSON", R"({"Type": "BSON"})"}, {LogicalType::UUID(), "UUID", R"({"Type": "UUID"})"}, {LogicalType::Float16(), "Float16", R"({"Type": "Float16"})"}, + {LogicalType::Geometry(), "Geometry(crs=, edges=planar, encoding=wkb, metadata=)", + R"({"Type": "Geometry", "edges": "planar", "encoding": "wkb"})"}, + {LogicalType::Geometry("{}", LogicalType::GeometryEdges::SPHERICAL), + "Geometry(crs={}, edges=spherical, encoding=wkb, metadata=)", + R"({"Type": "Geometry", "crs": {}, "edges": "spherical", "encoding": "wkb"})"}, {LogicalType::None(), "None", R"({"Type": "None"})"}, }; @@ -1594,6 +1599,7 @@ TEST(TestLogicalTypeOperation, LogicalTypeSortOrder) { {LogicalType::BSON(), SortOrder::UNSIGNED}, {LogicalType::UUID(), SortOrder::UNSIGNED}, {LogicalType::Float16(), SortOrder::SIGNED}, + {LogicalType::Geometry(), SortOrder::UNKNOWN}, {LogicalType::None(), SortOrder::UNKNOWN}}; for (const ExpectedSortOrder& c : cases) { @@ -2265,6 +2271,10 @@ TEST(TestLogicalTypeSerialization, Roundtrips) { {LogicalType::BSON(), Type::BYTE_ARRAY, -1}, {LogicalType::UUID(), Type::FIXED_LEN_BYTE_ARRAY, 16}, {LogicalType::Float16(), Type::FIXED_LEN_BYTE_ARRAY, 2}, + {LogicalType::Geometry(), Type::BYTE_ARRAY, -1}, + {LogicalType::Geometry("non-empty crs", LogicalType::GeometryEdges::SPHERICAL, + LogicalType::GeometryEncoding::WKB, "non-empty metadata"), + Type::BYTE_ARRAY, -1}, {LogicalType::None(), Type::BOOLEAN, -1}}; for (const AnnotatedPrimitiveNodeFactoryArguments& c : cases) { diff --git a/cpp/src/parquet/statistics.cc b/cpp/src/parquet/statistics.cc index e54b94f1a861a..eeed161d9e093 100644 --- a/cpp/src/parquet/statistics.cc +++ b/cpp/src/parquet/statistics.cc @@ -36,6 +36,7 @@ #include "arrow/visit_data_inline.h" #include "parquet/encoding.h" #include "parquet/exception.h" +#include "parquet/geometry_util.h" #include "parquet/platform.h" #include "parquet/schema.h" @@ -47,6 +48,155 @@ using arrow::util::SafeCopy; using arrow::util::SafeLoad; namespace parquet { + +class GeometryStatisticsImpl { + public: + bool Equals(const GeometryStatisticsImpl& other) const { + if (is_valid_ != other.is_valid_) { + return false; + } + + if (!is_valid_ && !other.is_valid_) { + return true; + } + + auto wkb_types = bounder_.WkbTypes(); + auto other_wkb_types = other.bounder_.WkbTypes(); + if (wkb_types.size() != other_wkb_types.size()) { + return false; + } + + for (size_t i = 0; i < wkb_types.size(); i++) { + if (wkb_types[i] != other_wkb_types[i]) { + return false; + } + } + + return bounder_.Bounds() == other.bounder_.Bounds(); + } + + void Merge(const GeometryStatisticsImpl& other) { + if (!is_valid_ || !other.is_valid_) { + is_valid_ = false; + return; + } + + bounder_.ReadBox(other.bounder_.Bounds()); + bounder_.ReadGeometryTypes(other.bounder_.WkbTypes()); + } + + void Update(const ByteArray* values, int64_t num_values, int64_t null_count) { + if (!is_valid_) { + return; + } + + geometry::WKBBuffer buf; + try { + for (int64_t i = 0; i < num_values; i++) { + const ByteArray& item = values[i]; + buf.Init(item.ptr, item.len); + bounder_.ReadGeometry(&buf); + } + + bounder_.Flush(); + } catch (ParquetException& e) { + is_valid_ = false; + } + } + + EncodedGeometryStatistics Encode() const { + const double* mins = bounder_.Bounds().min; + const double* maxes = bounder_.Bounds().max; + + EncodedGeometryStatistics out; + out.geometry_types = bounder_.WkbTypes(); + + out.xmin = mins[0]; + out.xmax = maxes[0]; + out.ymin = mins[1]; + out.ymax = maxes[1]; + out.zmin = mins[2]; + out.zmax = maxes[2]; + out.mmin = mins[3]; + out.mmax = maxes[3]; + + return out; + } + + void Update(const EncodedGeometryStatistics& encoded) { + if (!is_valid_) { + return; + } + + geometry::BoundingBox box; + box.min[0] = encoded.xmin; + box.max[0] = encoded.xmax; + box.min[1] = encoded.ymin; + box.max[1] = encoded.ymax; + + if (encoded.has_z()) { + box.min[2] = encoded.zmin; + box.max[2] = encoded.zmax; + } + + if (encoded.has_m()) { + box.min[3] = encoded.mmin; + box.max[3] = encoded.mmax; + } + + bounder_.ReadBox(box); + bounder_.ReadGeometryTypes(encoded.geometry_types); + + try { + for (const auto& covering : encoded.coverings) { + if (covering.first == "WKB") { + geometry::WKBBuffer buf( + reinterpret_cast(covering.second.data()), + covering.second.size()); + bounder_.ReadGeometry(&buf, false); + } + } + } catch (ParquetException& e) { + is_valid_ = false; + return; + } + } + + bool is_valid() const { return is_valid_; } + + private: + geometry::WKBGeometryBounder bounder_; + bool is_valid_{}; +}; + +GeometryStatistics::GeometryStatistics() { + impl_ = std::make_unique(); +} + +bool GeometryStatistics::Equals(const GeometryStatistics& other) const { + return impl_->Equals(*other.impl_); +} + +void GeometryStatistics::Merge(const GeometryStatistics& other) { + impl_->Merge(*other.impl_); +} + +void GeometryStatistics::Update(const ByteArray* values, int64_t num_values, + int64_t null_count) { + impl_->Update(values, num_values, null_count); +} + +bool GeometryStatistics::is_valid() const { return impl_->is_valid(); } + +EncodedGeometryStatistics GeometryStatistics::Encode() { return impl_->Encode(); } + +std::unique_ptr GeometryStatistics::Decode( + const EncodedGeometryStatistics& encoded) { + auto out = std::make_unique(); + out->impl_->Update(encoded); + return out; +} + namespace { // ---------------------------------------------------------------------- @@ -553,6 +703,7 @@ LogicalType::Type::type LogicalTypeId(const ColumnDescriptor* descr) { } return LogicalType::Type::NONE; } + LogicalType::Type::type LogicalTypeId(const Statistics& stats) { return LogicalTypeId(stats.descr()); } @@ -618,6 +769,7 @@ class TypedStatisticsImpl : public TypedStatistics { bool HasDistinctCount() const override { return has_distinct_count_; }; bool HasMinMax() const override { return has_min_max_; } bool HasNullCount() const override { return has_null_count_; }; + bool HasGeometryStatistics() const override { return geometry_statistics_ != nullptr; } void IncrementNullCount(int64_t n) override { statistics_.null_count += n; @@ -630,6 +782,8 @@ class TypedStatisticsImpl : public TypedStatistics { switch (type) { case LogicalType::Type::FLOAT16: return true; + case LogicalType::Type::GEOMETRY: + return true; default: return false; } @@ -654,6 +808,15 @@ class TypedStatisticsImpl : public TypedStatistics { if (!MinMaxEqual(other)) return false; } + if (HasGeometryStatistics() != other.HasGeometryStatistics()) { + return false; + } + + if (HasGeometryStatistics() && + !geometry_statistics_->Equals(*other.GeometryStatistics())) { + return false; + } + return null_count() == other.null_count() && distinct_count() == other.distinct_count() && num_values() == other.num_values(); @@ -748,6 +911,9 @@ class TypedStatisticsImpl : public TypedStatistics { if (HasDistinctCount()) { s.set_distinct_count(this->distinct_count()); } + if (HasGeometryStatistics() && geometry_statistics_->is_valid()) { + s.set_geometry(geometry_statistics_->Encode()); + } return s; } @@ -773,6 +939,7 @@ class TypedStatisticsImpl : public TypedStatistics { std::shared_ptr> comparator_; std::shared_ptr min_buffer_, max_buffer_; LogicalType::Type::type logical_type_ = LogicalType::Type::NONE; + std::shared_ptr geometry_statistics_; void PlainEncode(const T& src, std::string* dst) const; void PlainDecode(const std::string& src, T* dst) const; @@ -865,6 +1032,12 @@ void TypedStatisticsImpl::Update(const T* values, int64_t num_values, if (num_values == 0) return; SetMinMaxPair(comparator_->GetMinMax(values, num_values)); + + if constexpr (std::is_same::value) { + if (logical_type_ == LogicalType::Type::GEOMETRY) { + geometry_statistics_->Update(values, num_values, null_count); + } + } } template @@ -1035,17 +1208,18 @@ std::shared_ptr Statistics::Make(const ColumnDescriptor* descr, DCHECK(encoded_stats != nullptr); return Make(descr, encoded_stats->min(), encoded_stats->max(), num_values, encoded_stats->null_count, encoded_stats->distinct_count, + encoded_stats->geometry_statistics(), encoded_stats->has_min && encoded_stats->has_max, - encoded_stats->has_null_count, encoded_stats->has_distinct_count, pool); + encoded_stats->has_null_count, encoded_stats->has_distinct_count, + encoded_stats->has_geometry_statistics, pool); } -std::shared_ptr Statistics::Make(const ColumnDescriptor* descr, - const std::string& encoded_min, - const std::string& encoded_max, - int64_t num_values, int64_t null_count, - int64_t distinct_count, bool has_min_max, - bool has_null_count, bool has_distinct_count, - ::arrow::MemoryPool* pool) { +std::shared_ptr Statistics::Make( + const ColumnDescriptor* descr, const std::string& encoded_min, + const std::string& encoded_max, int64_t num_values, int64_t null_count, + int64_t distinct_count, const EncodedGeometryStatistics& geometry_statistics, + bool has_min_max, bool has_null_count, bool has_distinct_count, + bool has_geometry_statistics, ::arrow::MemoryPool* pool) { #define MAKE_STATS(CAP_TYPE, KLASS) \ case Type::CAP_TYPE: \ return std::make_shared>( \ diff --git a/cpp/src/parquet/statistics.h b/cpp/src/parquet/statistics.h index c5da44a7b6665..9ffbbc109c88e 100644 --- a/cpp/src/parquet/statistics.h +++ b/cpp/src/parquet/statistics.h @@ -114,6 +114,53 @@ std::shared_ptr> MakeComparator(const ColumnDescriptor* d return std::static_pointer_cast>(Comparator::Make(descr)); } +class PARQUET_EXPORT EncodedGeometryStatistics { + public: + static constexpr double kInf = std::numeric_limits::infinity(); + + EncodedGeometryStatistics() = default; + EncodedGeometryStatistics(const EncodedGeometryStatistics&) = default; + EncodedGeometryStatistics(EncodedGeometryStatistics&&) = default; + EncodedGeometryStatistics& operator=(const EncodedGeometryStatistics&) = default; + + double xmin{kInf}; + double xmax{-kInf}; + double ymin{kInf}; + double ymax{-kInf}; + double zmin{kInf}; + double zmax{-kInf}; + double mmin{kInf}; + double mmax{-kInf}; + std::vector> coverings; + std::vector geometry_types; + + bool has_z() const { return (zmax - zmin) > 0; } + + bool has_m() const { return (mmax - mmin) > 0; } +}; + +class GeometryStatisticsImpl; + +class PARQUET_EXPORT GeometryStatistics { + public: + GeometryStatistics(); + + bool Equals(const GeometryStatistics& other) const; + + void Merge(const GeometryStatistics& other); + + void Update(const ByteArray* values, int64_t num_values, int64_t null_count); + + EncodedGeometryStatistics Encode(); + + bool is_valid() const; + + static std::unique_ptr Decode(const EncodedGeometryStatistics& encoded); + + private: + std::unique_ptr impl_; +}; + // ---------------------------------------------------------------------- /// \brief Structure represented encoded statistics to be written to @@ -121,12 +168,16 @@ std::shared_ptr> MakeComparator(const ColumnDescriptor* d class PARQUET_EXPORT EncodedStatistics { std::string max_, min_; bool is_signed_ = false; + EncodedGeometryStatistics geometry_statistics_; public: EncodedStatistics() = default; const std::string& max() const { return max_; } const std::string& min() const { return min_; } + const EncodedGeometryStatistics& geometry_statistics() const { + return geometry_statistics_; + } int64_t null_count = 0; int64_t distinct_count = 0; @@ -135,6 +186,7 @@ class PARQUET_EXPORT EncodedStatistics { bool has_max = false; bool has_null_count = false; bool has_distinct_count = false; + bool has_geometry_statistics = false; // When all values in the statistics are null, it is set to true. // Otherwise, at least one value is not null, or we are not sure at all. @@ -189,6 +241,12 @@ class PARQUET_EXPORT EncodedStatistics { has_distinct_count = true; return *this; } + + EncodedStatistics& set_geometry(EncodedGeometryStatistics geometry_statistics) { + geometry_statistics_ = std::move(geometry_statistics); + has_geometry_statistics = true; + return *this; + } }; /// \brief Base type for computing column statistics while writing a file @@ -219,8 +277,9 @@ class PARQUET_EXPORT Statistics { static std::shared_ptr Make( const ColumnDescriptor* descr, const std::string& encoded_min, const std::string& encoded_max, int64_t num_values, int64_t null_count, - int64_t distinct_count, bool has_min_max, bool has_null_count, - bool has_distinct_count, + int64_t distinct_count, const EncodedGeometryStatistics& geometry_statistics, + bool has_min_max, bool has_null_count, bool has_distinct_count, + bool has_geometry_statistics, ::arrow::MemoryPool* pool = ::arrow::default_memory_pool()); // Helper function to convert EncodedStatistics to Statistics. @@ -250,6 +309,10 @@ class PARQUET_EXPORT Statistics { /// with TypedStatistics::min and max virtual bool HasMinMax() const = 0; + virtual bool HasGeometryStatistics() const { return false; }; + + virtual const GeometryStatistics* GeometryStatistics() const { return nullptr; } + /// \brief Reset state of object to initial (no data observed) state virtual void Reset() = 0; @@ -372,11 +435,14 @@ template std::shared_ptr> MakeStatistics( const ColumnDescriptor* descr, const std::string& encoded_min, const std::string& encoded_max, int64_t num_values, int64_t null_count, - int64_t distinct_count, bool has_min_max, bool has_null_count, - bool has_distinct_count, ::arrow::MemoryPool* pool = ::arrow::default_memory_pool()) { - return std::static_pointer_cast>(Statistics::Make( - descr, encoded_min, encoded_max, num_values, null_count, distinct_count, - has_min_max, has_null_count, has_distinct_count, pool)); + int64_t distinct_count, const EncodedGeometryStatistics& geometry_statistics, + bool has_min_max, bool has_null_count, bool has_distinct_count, + bool has_geometry_statistics, + ::arrow::MemoryPool* pool = ::arrow::default_memory_pool()) { + return std::static_pointer_cast>( + Statistics::Make(descr, encoded_min, encoded_max, num_values, null_count, + distinct_count, geometry_statistics, has_min_max, has_null_count, + has_distinct_count, has_geometry_statistics, pool)); } } // namespace parquet diff --git a/cpp/src/parquet/statistics_test.cc b/cpp/src/parquet/statistics_test.cc index dad414ac89b47..5df1a3340c13a 100644 --- a/cpp/src/parquet/statistics_test.cc +++ b/cpp/src/parquet/statistics_test.cc @@ -320,7 +320,7 @@ class TestStatistics : public PrimitiveTypedTest { auto statistics2 = MakeStatistics(this->schema_.Column(0), encoded_min, encoded_max, - this->values_.size(), 0, 0, true, true, true); + this->values_.size(), 0, 0, {}, true, true, true, false); auto statistics3 = MakeStatistics(this->schema_.Column(0)); std::vector valid_bits( @@ -541,9 +541,9 @@ void TestStatistics::TestMinMaxEncode() { std::string(reinterpret_cast(statistics1->max().ptr), statistics1->max().len)); - auto statistics2 = - MakeStatistics(this->schema_.Column(0), encoded_min, encoded_max, - this->values_.size(), 0, 0, true, true, true); + auto statistics2 = MakeStatistics(this->schema_.Column(0), encoded_min, + encoded_max, this->values_.size(), 0, + 0, {}, true, true, true, false); ASSERT_EQ(encoded_min, statistics2->EncodeMin()); ASSERT_EQ(encoded_max, statistics2->EncodeMax()); diff --git a/cpp/src/parquet/types.cc b/cpp/src/parquet/types.cc index 7b50ed48d06b0..6707fb78ed4e2 100644 --- a/cpp/src/parquet/types.cc +++ b/cpp/src/parquet/types.cc @@ -463,6 +463,31 @@ std::shared_ptr LogicalType::FromThrift( return UUIDLogicalType::Make(); } else if (type.__isset.FLOAT16) { return Float16LogicalType::Make(); + } else if (type.__isset.GEOMETRY) { + std::string crs; + if (type.GEOMETRY.__isset.crs) { + crs = type.GEOMETRY.crs; + } + + LogicalType::GeometryEdges::edges edges = LogicalType::GeometryEdges::UNKNOWN; + if (type.GEOMETRY.edges == format::Edges::PLANAR) { + edges = LogicalType::GeometryEdges::PLANAR; + } else if (type.GEOMETRY.edges == format::Edges::SPHERICAL) { + edges = LogicalType::GeometryEdges::SPHERICAL; + } + + LogicalType::GeometryEncoding::geometry_encoding encoding = + LogicalType::GeometryEncoding::UNKNOWN; + if (type.GEOMETRY.encoding == format::GeometryEncoding::WKB) { + encoding = LogicalType::GeometryEncoding::WKB; + } + + std::string metadata; + if (type.GEOMETRY.__isset.metadata) { + metadata = type.GEOMETRY.metadata; + } + + return GeometryLogicalType::Make(crs, edges, encoding, metadata); } else { throw ParquetException("Metadata contains Thrift LogicalType that is not recognized"); } @@ -520,6 +545,12 @@ std::shared_ptr LogicalType::Float16() { return Float16LogicalType::Make(); } +std::shared_ptr LogicalType::Geometry( + std::string crs, LogicalType::GeometryEdges::edges edges, + LogicalType::GeometryEncoding::geometry_encoding encoding, std::string metadata) { + return GeometryLogicalType::Make(std::move(crs), edges, encoding, std::move(metadata)); +} + std::shared_ptr LogicalType::None() { return NoLogicalType::Make(); } /* @@ -602,6 +633,7 @@ class LogicalType::Impl { class BSON; class UUID; class Float16; + class Geometry; class No; class Undefined; @@ -674,6 +706,9 @@ bool LogicalType::is_UUID() const { return impl_->type() == LogicalType::Type::U bool LogicalType::is_float16() const { return impl_->type() == LogicalType::Type::FLOAT16; } +bool LogicalType::is_geometry() const { + return impl_->type() == LogicalType::Type::GEOMETRY; +} bool LogicalType::is_none() const { return impl_->type() == LogicalType::Type::NONE; } bool LogicalType::is_valid() const { return impl_->type() != LogicalType::Type::UNDEFINED; @@ -1603,6 +1638,140 @@ class LogicalType::Impl::Float16 final : public LogicalType::Impl::Incompatible, GENERATE_MAKE(Float16) +#define geometry_edges_string(u___) \ + ((u___) == LogicalType::GeometryEdges::PLANAR \ + ? "planar" \ + : ((u___) == LogicalType::GeometryEdges::SPHERICAL ? "spherical" : "unknown")) + +#define geometry_encoding_string(u___) \ + ((u___) == LogicalType::GeometryEncoding::WKB ? "wkb" : "unknown") + +class LogicalType::Impl::Geometry final : public LogicalType::Impl::Incompatible, + public LogicalType::Impl::SimpleApplicable { + public: + friend class GeometryLogicalType; + + std::string ToString() const override; + std::string ToJSON() const override; + format::LogicalType ToThrift() const override; + bool Equals(const LogicalType& other) const override; + + const std::string& crs() const { return crs_; } + LogicalType::GeometryEdges::edges edges() const { return edges_; } + LogicalType::GeometryEncoding::geometry_encoding encoding() const { return encoding_; } + const std::string& metadata() const { return metadata_; } + + private: + Geometry(std::string crs, LogicalType::GeometryEdges::edges edges, + LogicalType::GeometryEncoding::geometry_encoding encoding, + std::string metadata) + : LogicalType::Impl(LogicalType::Type::GEOMETRY, SortOrder::UNKNOWN), + LogicalType::Impl::SimpleApplicable(parquet::Type::BYTE_ARRAY), + crs_(std::move(crs)), + edges_(edges), + encoding_(encoding), + metadata_(std::move(metadata)) {} + + std::string crs_; + LogicalType::GeometryEdges::edges edges_; + LogicalType::GeometryEncoding::geometry_encoding encoding_; + std::string metadata_; +}; + +std::string LogicalType::Impl::Geometry::ToString() const { + std::stringstream type; + type << "Geometry(crs=" << crs_ << ", edges=" << geometry_edges_string(edges_) + << ", encoding=" << geometry_encoding_string(encoding_) + << ", metadata=" << metadata_ << ")"; + return type.str(); +} + +std::string LogicalType::Impl::Geometry::ToJSON() const { + std::stringstream json; + json << R"({"Type": "Geometry")"; + + if (crs_.size() > 0) { + // TODO(paleolimbot): we'll need to escape the crs or assume that it's valid JSON + json << R"(, "crs": )" << crs_; + } + + json << R"(, "edges": ")" << geometry_edges_string(edges_) << R"(")"; + json << R"(, "encoding": ")" << geometry_encoding_string(encoding_) << R"(")"; + + if (metadata_.size() > 0) { + // TODO(paleolimbot): we'll need to escape the metadata or assume that it's valid JSON + json << R"(, "metadata": )" << crs_; + } + + json << "}"; + return json.str(); +} + +format::LogicalType LogicalType::Impl::Geometry::ToThrift() const { + format::LogicalType type; + format::GeometryType geometry_type; + + // Canonially export crs of "" as an unset CRS + if (crs_.size() > 0) { + geometry_type.__set_crs(crs_); + } + + DCHECK(edges_ != LogicalType::GeometryEdges::UNKNOWN); + if (edges_ == LogicalType::GeometryEdges::SPHERICAL) { + geometry_type.__set_edges(format::Edges::SPHERICAL); + } else { + geometry_type.__set_edges(format::Edges::PLANAR); + } + + DCHECK_EQ(encoding_, LogicalType::GeometryEncoding::WKB); + geometry_type.__set_encoding(format::GeometryEncoding::WKB); + + // Canonically export empty metadata as unset + if (metadata_.size() > 0) { + geometry_type.__set_metadata(metadata_); + } + + type.__set_GEOMETRY(geometry_type); + return type; +} + +bool LogicalType::Impl::Geometry::Equals(const LogicalType& other) const { + if (other.is_geometry()) { + const auto& other_geometry = checked_cast(other); + return crs() == other_geometry.crs() && + edges() == other_geometry.edges() && + encoding() == other_geometry.encoding() && + metadata() == other_geometry.metadata(); + } else { + return false; + } +} + +const std::string& GeometryLogicalType::crs() const { + return (dynamic_cast(*impl_)).crs(); +} + +LogicalType::GeometryEdges::edges GeometryLogicalType::edges() const { + return (dynamic_cast(*impl_)).edges(); +} + +LogicalType::GeometryEncoding::geometry_encoding GeometryLogicalType::encoding() const { + return (dynamic_cast(*impl_)).encoding(); +} + +const std::string& GeometryLogicalType::metadata() const { + return (dynamic_cast(*impl_)).metadata(); +} + +std::shared_ptr GeometryLogicalType::Make( + std::string crs, LogicalType::GeometryEdges::edges edges, + LogicalType::GeometryEncoding::geometry_encoding encoding, std::string metadata) { + auto* logical_type = new GeometryLogicalType(); + logical_type->impl_.reset(new LogicalType::Impl::Geometry( + std::move(crs), edges, encoding, std::move(metadata))); + return std::shared_ptr(logical_type); +} + class LogicalType::Impl::No final : public LogicalType::Impl::SimpleCompatible, public LogicalType::Impl::UniversalApplicable { public: diff --git a/cpp/src/parquet/types.h b/cpp/src/parquet/types.h index 70a1c4b73ec45..d708a558943a3 100644 --- a/cpp/src/parquet/types.h +++ b/cpp/src/parquet/types.h @@ -158,6 +158,7 @@ class PARQUET_EXPORT LogicalType { BSON, UUID, FLOAT16, + GEOMETRY, NONE // Not a real logical type; should always be last element }; }; @@ -166,6 +167,14 @@ class PARQUET_EXPORT LogicalType { enum unit { UNKNOWN = 0, MILLIS = 1, MICROS, NANOS }; }; + struct GeometryEncoding { + enum geometry_encoding { UNKNOWN = 0, WKB = 1 }; + }; + + struct GeometryEdges { + enum edges { UNKNOWN = 0, PLANAR = 1, SPHERICAL = 2 }; + }; + /// \brief If possible, return a logical type equivalent to the given legacy /// converted type (and decimal metadata if applicable). static std::shared_ptr FromConvertedType( @@ -213,6 +222,12 @@ class PARQUET_EXPORT LogicalType { static std::shared_ptr UUID(); static std::shared_ptr Float16(); + static std::shared_ptr Geometry( + std::string crs = "", + LogicalType::GeometryEdges::edges edges = GeometryEdges::PLANAR, + LogicalType::GeometryEncoding::geometry_encoding encoding = GeometryEncoding::WKB, + std::string metadata = ""); + /// \brief Create a placeholder for when no logical type is specified static std::shared_ptr None(); @@ -266,6 +281,7 @@ class PARQUET_EXPORT LogicalType { bool is_BSON() const; bool is_UUID() const; bool is_float16() const; + bool is_geometry() const; bool is_none() const; /// \brief Return true if this logical type is of a known type. bool is_valid() const; @@ -446,6 +462,23 @@ class PARQUET_EXPORT Float16LogicalType : public LogicalType { Float16LogicalType() = default; }; +class PARQUET_EXPORT GeometryLogicalType : public LogicalType { + public: + static std::shared_ptr Make( + std::string crs = "", + LogicalType::GeometryEdges::edges edges = GeometryEdges::PLANAR, + LogicalType::GeometryEncoding::geometry_encoding encoding = GeometryEncoding::WKB, + std::string metadata = ""); + + const std::string& crs() const; + LogicalType::GeometryEdges::edges edges() const; + LogicalType::GeometryEncoding::geometry_encoding encoding() const; + const std::string& metadata() const; + + private: + GeometryLogicalType() = default; +}; + /// \brief Allowed for any physical type. class PARQUET_EXPORT NoLogicalType : public LogicalType { public: