From 9037ba2a5ea1ca4367c16a55f69d1f49cb3a198f Mon Sep 17 00:00:00 2001 From: Tishj Date: Fri, 20 Dec 2024 11:15:30 +0100 Subject: [PATCH] generate files --- extension/parquet/include/parquet.json | 276 ++++++++++++------------ extension/parquet/serialize_parquet.cpp | 11 +- 2 files changed, 142 insertions(+), 145 deletions(-) diff --git a/extension/parquet/include/parquet.json b/extension/parquet/include/parquet.json index ac9fbcb59911..4b067c1493a1 100644 --- a/extension/parquet/include/parquet.json +++ b/extension/parquet/include/parquet.json @@ -1,138 +1,140 @@ [ - { - "class": "ParquetColumnDefinition", - "includes": [ - "parquet_reader.hpp" - ], - "members": [ - { - "id": 100, - "name": "field_id", - "type": "int32_t" - }, - { - "id": 101, - "name": "name", - "type": "string" - }, - { - "id": 103, - "name": "type", - "type": "LogicalType" - }, - { - "id": 104, - "name": "default_value", - "type": "Value" - } - ], - "pointer_type": "none" - }, - { - "class": "ParquetEncryptionConfig", - "includes": [ - "parquet_crypto.hpp" - ], - "members": [ - { - "id": 100, - "name": "footer_key", - "type": "string" - }, - { - "id": 101, - "name": "column_keys", - "type": "unordered_map" - } - ], - "pointer_type": "shared_ptr", - "constructor": ["$ClientContext"] - }, - { - "class": "ParquetOptions", - "includes": [ - "parquet_reader.hpp" - ], - "members": [ - { - "id": 100, - "name": "binary_as_string", - "type": "bool" - }, - { - "id": 101, - "name": "file_row_number", - "type": "bool" - }, - { - "id": 102, - "name": "file_options", - "type": "MultiFileReaderOptions" - }, - { - "id": 103, - "name": "schema", - "type": "vector" - }, - { - "id": 104, - "name": "encryption_config", - "type": "shared_ptr", - "default": "nullptr" - }, - { - "id": 105, - "name": "debug_use_openssl", - "type": "bool", - "default": "true" - }, - { - "id": 106, - "name": "explicit_cardinality", - "type": "idx_t", - "default": "0" - } - ], - "pointer_type": "none" - }, - { - "class": "FieldID", - "includes": [ - "parquet_writer.hpp" - ], - "members": [ - { - "id": 100, - "name": "set", - "type": "bool" - }, - { - "id": 101, - "name": "field_id", - "type": "int32_t" - }, - { - "id": 102, - "name": "child_field_ids", - "type": "ChildFieldIDs" - } - ], - "pointer_type": "none" - }, - { - "class": "ChildFieldIDs", - "includes": [ - "parquet_writer.hpp" - ], - "members": [ - { - "id": 100, - "name": "ids", - "type": "case_insensitive_map_t", - "serialize_property": "ids.operator*()", - "deserialize_property": "ids.operator*()" - } - ], - "pointer_type": "none" - } -] + { + "class": "ParquetColumnDefinition", + "includes": [ + "parquet_reader.hpp" + ], + "members": [ + { + "id": 100, + "name": "identifier", + "type": "Value" + }, + { + "id": 101, + "name": "name", + "type": "string" + }, + { + "id": 103, + "name": "type", + "type": "LogicalType" + }, + { + "id": 104, + "name": "default_value", + "type": "Value" + } + ], + "pointer_type": "none" + }, + { + "class": "ParquetEncryptionConfig", + "includes": [ + "parquet_crypto.hpp" + ], + "members": [ + { + "id": 100, + "name": "footer_key", + "type": "string" + }, + { + "id": 101, + "name": "column_keys", + "type": "unordered_map" + } + ], + "pointer_type": "shared_ptr", + "constructor": [ + "$ClientContext" + ] + }, + { + "class": "ParquetOptions", + "includes": [ + "parquet_reader.hpp" + ], + "members": [ + { + "id": 100, + "name": "binary_as_string", + "type": "bool" + }, + { + "id": 101, + "name": "file_row_number", + "type": "bool" + }, + { + "id": 102, + "name": "file_options", + "type": "MultiFileReaderOptions" + }, + { + "id": 103, + "name": "schema", + "type": "vector" + }, + { + "id": 104, + "name": "encryption_config", + "type": "shared_ptr", + "default": "nullptr" + }, + { + "id": 105, + "name": "debug_use_openssl", + "type": "bool", + "default": "true" + }, + { + "id": 106, + "name": "explicit_cardinality", + "type": "idx_t", + "default": "0" + } + ], + "pointer_type": "none" + }, + { + "class": "FieldID", + "includes": [ + "parquet_writer.hpp" + ], + "members": [ + { + "id": 100, + "name": "set", + "type": "bool" + }, + { + "id": 101, + "name": "field_id", + "type": "int32_t" + }, + { + "id": 102, + "name": "child_field_ids", + "type": "ChildFieldIDs" + } + ], + "pointer_type": "none" + }, + { + "class": "ChildFieldIDs", + "includes": [ + "parquet_writer.hpp" + ], + "members": [ + { + "id": 100, + "name": "ids", + "type": "case_insensitive_map_t", + "serialize_property": "ids.operator*()", + "deserialize_property": "ids.operator*()" + } + ], + "pointer_type": "none" + } +] \ No newline at end of file diff --git a/extension/parquet/serialize_parquet.cpp b/extension/parquet/serialize_parquet.cpp index b030ba92d318..4091e5b856e6 100644 --- a/extension/parquet/serialize_parquet.cpp +++ b/extension/parquet/serialize_parquet.cpp @@ -36,7 +36,6 @@ FieldID FieldID::Deserialize(Deserializer &deserializer) { } void ParquetColumnDefinition::Serialize(Serializer &serializer) const { - //! FIXME: this breaks backwards compatibility, do we care? serializer.WriteProperty(100, "identifier", identifier); serializer.WritePropertyWithDefault(101, "name", name); serializer.WriteProperty(103, "type", type); @@ -45,7 +44,6 @@ void ParquetColumnDefinition::Serialize(Serializer &serializer) const { ParquetColumnDefinition ParquetColumnDefinition::Deserialize(Deserializer &deserializer) { ParquetColumnDefinition result; - //! FIXME: this breaks backwards compatibility, do we care? deserializer.ReadProperty(100, "identifier", result.identifier); deserializer.ReadPropertyWithDefault(101, "name", result.name); deserializer.ReadProperty(103, "type", result.type); @@ -59,8 +57,7 @@ void ParquetEncryptionConfig::Serialize(Serializer &serializer) const { } shared_ptr ParquetEncryptionConfig::Deserialize(Deserializer &deserializer) { - auto result = - duckdb::shared_ptr(new ParquetEncryptionConfig(deserializer.Get())); + auto result = duckdb::shared_ptr(new ParquetEncryptionConfig(deserializer.Get())); deserializer.ReadPropertyWithDefault(100, "footer_key", result->footer_key); deserializer.ReadPropertyWithDefault>(101, "column_keys", result->column_keys); return result; @@ -71,8 +68,7 @@ void ParquetOptions::Serialize(Serializer &serializer) const { serializer.WritePropertyWithDefault(101, "file_row_number", file_row_number); serializer.WriteProperty(102, "file_options", file_options); serializer.WritePropertyWithDefault>(103, "schema", schema); - serializer.WritePropertyWithDefault>(104, "encryption_config", - encryption_config, nullptr); + serializer.WritePropertyWithDefault>(104, "encryption_config", encryption_config, nullptr); serializer.WritePropertyWithDefault(105, "debug_use_openssl", debug_use_openssl, true); serializer.WritePropertyWithDefault(106, "explicit_cardinality", explicit_cardinality, 0); } @@ -83,8 +79,7 @@ ParquetOptions ParquetOptions::Deserialize(Deserializer &deserializer) { deserializer.ReadPropertyWithDefault(101, "file_row_number", result.file_row_number); deserializer.ReadProperty(102, "file_options", result.file_options); deserializer.ReadPropertyWithDefault>(103, "schema", result.schema); - deserializer.ReadPropertyWithExplicitDefault>( - 104, "encryption_config", result.encryption_config, nullptr); + deserializer.ReadPropertyWithExplicitDefault>(104, "encryption_config", result.encryption_config, nullptr); deserializer.ReadPropertyWithExplicitDefault(105, "debug_use_openssl", result.debug_use_openssl, true); deserializer.ReadPropertyWithExplicitDefault(106, "explicit_cardinality", result.explicit_cardinality, 0); return result;