Skip to content

Commit

Permalink
generate files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tishj committed Dec 20, 2024
1 parent 8726323 commit 9037ba2
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 145 deletions.
276 changes: 139 additions & 137 deletions extension/parquet/include/parquet.json
Original file line number Diff line number Diff line change
@@ -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<string, string>"
}
],
"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<ParquetColumnDefinition>"
},
{
"id": 104,
"name": "encryption_config",
"type": "shared_ptr<ParquetEncryptionConfig>",
"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<FieldID>",
"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<string, string>"
}
],
"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<ParquetColumnDefinition>"
},
{
"id": 104,
"name": "encryption_config",
"type": "shared_ptr<ParquetEncryptionConfig>",
"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<FieldID>",
"serialize_property": "ids.operator*()",
"deserialize_property": "ids.operator*()"
}
],
"pointer_type": "none"
}
]
11 changes: 3 additions & 8 deletions extension/parquet/serialize_parquet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Value>(100, "identifier", identifier);
serializer.WritePropertyWithDefault<string>(101, "name", name);
serializer.WriteProperty<LogicalType>(103, "type", type);
Expand All @@ -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<Value>(100, "identifier", result.identifier);
deserializer.ReadPropertyWithDefault<string>(101, "name", result.name);
deserializer.ReadProperty<LogicalType>(103, "type", result.type);
Expand All @@ -59,8 +57,7 @@ void ParquetEncryptionConfig::Serialize(Serializer &serializer) const {
}

shared_ptr<ParquetEncryptionConfig> ParquetEncryptionConfig::Deserialize(Deserializer &deserializer) {
auto result =
duckdb::shared_ptr<ParquetEncryptionConfig>(new ParquetEncryptionConfig(deserializer.Get<ClientContext &>()));
auto result = duckdb::shared_ptr<ParquetEncryptionConfig>(new ParquetEncryptionConfig(deserializer.Get<ClientContext &>()));
deserializer.ReadPropertyWithDefault<string>(100, "footer_key", result->footer_key);
deserializer.ReadPropertyWithDefault<unordered_map<string, string>>(101, "column_keys", result->column_keys);
return result;
Expand All @@ -71,8 +68,7 @@ void ParquetOptions::Serialize(Serializer &serializer) const {
serializer.WritePropertyWithDefault<bool>(101, "file_row_number", file_row_number);
serializer.WriteProperty<MultiFileReaderOptions>(102, "file_options", file_options);
serializer.WritePropertyWithDefault<vector<ParquetColumnDefinition>>(103, "schema", schema);
serializer.WritePropertyWithDefault<shared_ptr<ParquetEncryptionConfig>>(104, "encryption_config",
encryption_config, nullptr);
serializer.WritePropertyWithDefault<shared_ptr<ParquetEncryptionConfig>>(104, "encryption_config", encryption_config, nullptr);
serializer.WritePropertyWithDefault<bool>(105, "debug_use_openssl", debug_use_openssl, true);
serializer.WritePropertyWithDefault<idx_t>(106, "explicit_cardinality", explicit_cardinality, 0);
}
Expand All @@ -83,8 +79,7 @@ ParquetOptions ParquetOptions::Deserialize(Deserializer &deserializer) {
deserializer.ReadPropertyWithDefault<bool>(101, "file_row_number", result.file_row_number);
deserializer.ReadProperty<MultiFileReaderOptions>(102, "file_options", result.file_options);
deserializer.ReadPropertyWithDefault<vector<ParquetColumnDefinition>>(103, "schema", result.schema);
deserializer.ReadPropertyWithExplicitDefault<shared_ptr<ParquetEncryptionConfig>>(
104, "encryption_config", result.encryption_config, nullptr);
deserializer.ReadPropertyWithExplicitDefault<shared_ptr<ParquetEncryptionConfig>>(104, "encryption_config", result.encryption_config, nullptr);
deserializer.ReadPropertyWithExplicitDefault<bool>(105, "debug_use_openssl", result.debug_use_openssl, true);
deserializer.ReadPropertyWithExplicitDefault<idx_t>(106, "explicit_cardinality", result.explicit_cardinality, 0);
return result;
Expand Down

0 comments on commit 9037ba2

Please sign in to comment.