duckdb 0.7.2-dev654.0 → 0.7.2-dev832.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +2 -0
- package/lib/duckdb.d.ts +12 -1
- package/lib/duckdb.js +19 -0
- package/package.json +1 -1
- package/src/duckdb/extension/json/include/json_common.hpp +1 -0
- package/src/duckdb/extension/json/include/json_functions.hpp +2 -0
- package/src/duckdb/extension/json/include/json_serializer.hpp +77 -0
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +147 -0
- package/src/duckdb/extension/json/json_functions.cpp +12 -4
- package/src/duckdb/extension/json/json_scan.cpp +2 -2
- package/src/duckdb/extension/json/json_serializer.cpp +217 -0
- package/src/duckdb/src/common/enums/expression_type.cpp +8 -222
- package/src/duckdb/src/common/enums/join_type.cpp +3 -22
- package/src/duckdb/src/common/exception.cpp +2 -2
- package/src/duckdb/src/common/serializer/enum_serializer.cpp +1172 -0
- package/src/duckdb/src/common/types/column_data_collection_segment.cpp +11 -6
- package/src/duckdb/src/common/types/value.cpp +117 -0
- package/src/duckdb/src/common/types/vector.cpp +140 -1
- package/src/duckdb/src/common/types.cpp +166 -89
- package/src/duckdb/src/common/vector_operations/vector_cast.cpp +2 -1
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +10 -5
- package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +2 -1
- package/src/duckdb/src/execution/index/art/art.cpp +5 -5
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +3 -0
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +14 -2
- package/src/duckdb/src/function/cast/cast_function_set.cpp +1 -1
- package/src/duckdb/src/function/cast/enum_casts.cpp +25 -3
- package/src/duckdb/src/function/cast/list_casts.cpp +17 -4
- package/src/duckdb/src/function/cast/map_cast.cpp +5 -2
- package/src/duckdb/src/function/cast/string_cast.cpp +36 -10
- package/src/duckdb/src/function/cast/struct_cast.cpp +23 -3
- package/src/duckdb/src/function/cast/union_casts.cpp +33 -7
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +243 -0
- package/src/duckdb/src/function/scalar/string/regexp/regexp_util.cpp +79 -0
- package/src/duckdb/src/function/scalar/string/regexp.cpp +21 -80
- package/src/duckdb/src/function/table/arrow_conversion.cpp +7 -1
- package/src/duckdb/src/function/table/table_scan.cpp +1 -1
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/common/enums/aggregate_handling.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/enums/joinref_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/order_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/set_operation_type.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/exception.hpp +40 -9
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +45 -0
- package/src/duckdb/src/include/duckdb/common/preserved_error.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/serializer/enum_serializer.hpp +113 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +336 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +268 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +126 -0
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/partitionable_hashtable.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/cast/bound_cast_data.hpp +84 -0
- package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +28 -64
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +81 -1
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/recursive_cte_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/select_node.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/set_operation_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node.hpp +11 -1
- package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +24 -1
- package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +2 -1
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +6 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +9 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +3 -1
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/index.hpp +4 -3
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +2 -2
- package/src/duckdb/src/main/extension/extension_install.cpp +7 -2
- package/src/duckdb/src/optimizer/deliminator.cpp +1 -1
- package/src/duckdb/src/optimizer/filter_combiner.cpp +1 -1
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +3 -3
- package/src/duckdb/src/optimizer/rule/move_constants.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +1 -1
- package/src/duckdb/src/parser/common_table_expression_info.cpp +19 -0
- package/src/duckdb/src/parser/expression/between_expression.cpp +17 -0
- package/src/duckdb/src/parser/expression/case_expression.cpp +28 -0
- package/src/duckdb/src/parser/expression/cast_expression.cpp +17 -0
- package/src/duckdb/src/parser/expression/collate_expression.cpp +16 -0
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +15 -0
- package/src/duckdb/src/parser/expression/comparison_expression.cpp +16 -0
- package/src/duckdb/src/parser/expression/conjunction_expression.cpp +15 -0
- package/src/duckdb/src/parser/expression/constant_expression.cpp +14 -0
- package/src/duckdb/src/parser/expression/default_expression.cpp +7 -0
- package/src/duckdb/src/parser/expression/function_expression.cpp +35 -0
- package/src/duckdb/src/parser/expression/lambda_expression.cpp +16 -0
- package/src/duckdb/src/parser/expression/operator_expression.cpp +15 -0
- package/src/duckdb/src/parser/expression/parameter_expression.cpp +15 -0
- package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +14 -0
- package/src/duckdb/src/parser/expression/star_expression.cpp +20 -0
- package/src/duckdb/src/parser/expression/subquery_expression.cpp +20 -0
- package/src/duckdb/src/parser/expression/window_expression.cpp +43 -0
- package/src/duckdb/src/parser/parsed_data/sample_options.cpp +22 -10
- package/src/duckdb/src/parser/parsed_expression.cpp +72 -0
- package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +21 -0
- package/src/duckdb/src/parser/query_node/select_node.cpp +31 -0
- package/src/duckdb/src/parser/query_node/set_operation_node.cpp +17 -0
- package/src/duckdb/src/parser/query_node.cpp +50 -0
- package/src/duckdb/src/parser/result_modifier.cpp +78 -0
- package/src/duckdb/src/parser/statement/select_statement.cpp +12 -0
- package/src/duckdb/src/parser/tableref/basetableref.cpp +21 -0
- package/src/duckdb/src/parser/tableref/emptytableref.cpp +4 -0
- package/src/duckdb/src/parser/tableref/expressionlistref.cpp +17 -0
- package/src/duckdb/src/parser/tableref/joinref.cpp +25 -0
- package/src/duckdb/src/parser/tableref/pivotref.cpp +53 -0
- package/src/duckdb/src/parser/tableref/subqueryref.cpp +15 -0
- package/src/duckdb/src/parser/tableref/table_function.cpp +17 -0
- package/src/duckdb/src/parser/tableref.cpp +46 -0
- package/src/duckdb/src/parser/transform/expression/transform_bool_expr.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +4 -0
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +3 -1
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_expression.cpp +4 -0
- package/src/duckdb/src/storage/data_table.cpp +15 -13
- package/src/duckdb/src/storage/index.cpp +12 -1
- package/src/duckdb/src/storage/local_storage.cpp +20 -23
- package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +0 -1
- package/src/duckdb/third_party/re2/re2/re2.cc +9 -0
- package/src/duckdb/third_party/re2/re2/re2.h +2 -0
- package/src/duckdb/ub_extension_json_json_functions.cpp +2 -0
- package/src/duckdb/ub_src_common_serializer.cpp +2 -0
- package/src/duckdb/ub_src_function_scalar_string_regexp.cpp +4 -0
- package/src/duckdb/ub_src_parser.cpp +2 -0
- package/src/utils.cpp +12 -0
- package/test/extension.test.ts +44 -26
@@ -5,6 +5,8 @@
|
|
5
5
|
#include "duckdb/common/types/hash.hpp"
|
6
6
|
#include "duckdb/parser/expression/list.hpp"
|
7
7
|
#include "duckdb/parser/parsed_expression_iterator.hpp"
|
8
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
9
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
8
10
|
|
9
11
|
namespace duckdb {
|
10
12
|
|
@@ -107,6 +109,76 @@ void ParsedExpression::Serialize(Serializer &serializer) const {
|
|
107
109
|
writer.Finalize();
|
108
110
|
}
|
109
111
|
|
112
|
+
void ParsedExpression::FormatSerialize(FormatSerializer &serializer) const {
|
113
|
+
serializer.WriteProperty("class", GetExpressionClass());
|
114
|
+
serializer.WriteProperty("type", type);
|
115
|
+
serializer.WriteProperty("alias", alias);
|
116
|
+
}
|
117
|
+
|
118
|
+
unique_ptr<ParsedExpression> ParsedExpression::FormatDeserialize(FormatDeserializer &deserializer) {
|
119
|
+
auto expression_class = deserializer.ReadProperty<ExpressionClass>("class");
|
120
|
+
auto type = deserializer.ReadProperty<ExpressionType>("type");
|
121
|
+
auto alias = deserializer.ReadProperty<string>("alias");
|
122
|
+
unique_ptr<ParsedExpression> result;
|
123
|
+
switch (expression_class) {
|
124
|
+
case ExpressionClass::BETWEEN:
|
125
|
+
result = BetweenExpression::FormatDeserialize(type, deserializer);
|
126
|
+
break;
|
127
|
+
case ExpressionClass::CASE:
|
128
|
+
result = CaseExpression::FormatDeserialize(type, deserializer);
|
129
|
+
break;
|
130
|
+
case ExpressionClass::CAST:
|
131
|
+
result = CastExpression::FormatDeserialize(type, deserializer);
|
132
|
+
break;
|
133
|
+
case ExpressionClass::COLLATE:
|
134
|
+
result = CollateExpression::FormatDeserialize(type, deserializer);
|
135
|
+
break;
|
136
|
+
case ExpressionClass::COLUMN_REF:
|
137
|
+
result = ColumnRefExpression::FormatDeserialize(type, deserializer);
|
138
|
+
break;
|
139
|
+
case ExpressionClass::COMPARISON:
|
140
|
+
result = ComparisonExpression::FormatDeserialize(type, deserializer);
|
141
|
+
break;
|
142
|
+
case ExpressionClass::CONJUNCTION:
|
143
|
+
result = ConjunctionExpression::FormatDeserialize(type, deserializer);
|
144
|
+
break;
|
145
|
+
case ExpressionClass::CONSTANT:
|
146
|
+
result = ConstantExpression::FormatDeserialize(type, deserializer);
|
147
|
+
break;
|
148
|
+
case ExpressionClass::DEFAULT:
|
149
|
+
result = make_unique<DefaultExpression>();
|
150
|
+
break;
|
151
|
+
case ExpressionClass::FUNCTION:
|
152
|
+
result = FunctionExpression::FormatDeserialize(type, deserializer);
|
153
|
+
break;
|
154
|
+
case ExpressionClass::LAMBDA:
|
155
|
+
result = LambdaExpression::FormatDeserialize(type, deserializer);
|
156
|
+
break;
|
157
|
+
case ExpressionClass::OPERATOR:
|
158
|
+
result = OperatorExpression::FormatDeserialize(type, deserializer);
|
159
|
+
break;
|
160
|
+
case ExpressionClass::PARAMETER:
|
161
|
+
result = ParameterExpression::FormatDeserialize(type, deserializer);
|
162
|
+
break;
|
163
|
+
case ExpressionClass::POSITIONAL_REFERENCE:
|
164
|
+
result = PositionalReferenceExpression::FormatDeserialize(type, deserializer);
|
165
|
+
break;
|
166
|
+
case ExpressionClass::STAR:
|
167
|
+
result = StarExpression::FormatDeserialize(type, deserializer);
|
168
|
+
break;
|
169
|
+
case ExpressionClass::SUBQUERY:
|
170
|
+
result = SubqueryExpression::FormatDeserialize(type, deserializer);
|
171
|
+
break;
|
172
|
+
case ExpressionClass::WINDOW:
|
173
|
+
result = WindowExpression::FormatDeserialize(type, deserializer);
|
174
|
+
break;
|
175
|
+
default:
|
176
|
+
throw SerializationException("Unsupported type for expression deserialization!");
|
177
|
+
}
|
178
|
+
result->alias = alias;
|
179
|
+
return result;
|
180
|
+
}
|
181
|
+
|
110
182
|
unique_ptr<ParsedExpression> ParsedExpression::Deserialize(Deserializer &source) {
|
111
183
|
FieldReader reader(source);
|
112
184
|
auto expression_class = reader.ReadRequired<ExpressionClass>();
|
@@ -1,5 +1,7 @@
|
|
1
1
|
#include "duckdb/parser/query_node/recursive_cte_node.hpp"
|
2
2
|
#include "duckdb/common/field_writer.hpp"
|
3
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
4
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
3
5
|
|
4
6
|
namespace duckdb {
|
5
7
|
|
@@ -64,4 +66,23 @@ unique_ptr<QueryNode> RecursiveCTENode::Deserialize(FieldReader &reader) {
|
|
64
66
|
return std::move(result);
|
65
67
|
}
|
66
68
|
|
69
|
+
void RecursiveCTENode::FormatSerialize(FormatSerializer &serializer) const {
|
70
|
+
QueryNode::FormatSerialize(serializer);
|
71
|
+
serializer.WriteProperty("cte_name", ctename);
|
72
|
+
serializer.WriteProperty("union_all", union_all);
|
73
|
+
serializer.WriteProperty("left", *left);
|
74
|
+
serializer.WriteProperty("right", *right);
|
75
|
+
serializer.WriteProperty("aliases", aliases);
|
76
|
+
}
|
77
|
+
|
78
|
+
unique_ptr<QueryNode> RecursiveCTENode::FormatDeserialize(FormatDeserializer &deserializer) {
|
79
|
+
auto result = make_unique<RecursiveCTENode>();
|
80
|
+
deserializer.ReadProperty("cte_name", result->ctename);
|
81
|
+
deserializer.ReadProperty("union_all", result->union_all);
|
82
|
+
deserializer.ReadProperty("left", result->left);
|
83
|
+
deserializer.ReadProperty("right", result->right);
|
84
|
+
deserializer.ReadProperty("aliases", result->aliases);
|
85
|
+
return std::move(result);
|
86
|
+
}
|
87
|
+
|
67
88
|
} // namespace duckdb
|
@@ -2,6 +2,8 @@
|
|
2
2
|
#include "duckdb/parser/expression_util.hpp"
|
3
3
|
#include "duckdb/common/field_writer.hpp"
|
4
4
|
#include "duckdb/parser/keyword_helper.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
6
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
5
7
|
|
6
8
|
namespace duckdb {
|
7
9
|
|
@@ -192,6 +194,35 @@ void SelectNode::Serialize(FieldWriter &writer) const {
|
|
192
194
|
writer.WriteOptional(qualify);
|
193
195
|
}
|
194
196
|
|
197
|
+
void SelectNode::FormatSerialize(FormatSerializer &serializer) const {
|
198
|
+
QueryNode::FormatSerialize(serializer);
|
199
|
+
serializer.WriteProperty("select_list", select_list);
|
200
|
+
serializer.WriteOptionalProperty("from_table", from_table);
|
201
|
+
serializer.WriteOptionalProperty("where_clause", where_clause);
|
202
|
+
serializer.WriteProperty("group_expressions", groups.group_expressions);
|
203
|
+
serializer.WriteProperty("group_sets", groups.grouping_sets);
|
204
|
+
serializer.WriteProperty("aggregate_handling", aggregate_handling);
|
205
|
+
serializer.WriteOptionalProperty("having", having);
|
206
|
+
serializer.WriteOptionalProperty("sample", sample);
|
207
|
+
serializer.WriteOptionalProperty("qualify", qualify);
|
208
|
+
}
|
209
|
+
|
210
|
+
unique_ptr<QueryNode> SelectNode::FormatDeserialize(FormatDeserializer &deserializer) {
|
211
|
+
auto result = make_unique<SelectNode>();
|
212
|
+
|
213
|
+
deserializer.ReadProperty("select_list", result->select_list);
|
214
|
+
deserializer.ReadOptionalProperty("from_table", result->from_table);
|
215
|
+
deserializer.ReadOptionalProperty("where_clause", result->where_clause);
|
216
|
+
deserializer.ReadProperty("group_expressions", result->groups.group_expressions);
|
217
|
+
deserializer.ReadProperty("group_sets", result->groups.grouping_sets);
|
218
|
+
deserializer.ReadProperty("aggregate_handling", result->aggregate_handling);
|
219
|
+
deserializer.ReadOptionalProperty("having", result->having);
|
220
|
+
deserializer.ReadOptionalProperty("sample", result->sample);
|
221
|
+
deserializer.ReadOptionalProperty("qualify", result->qualify);
|
222
|
+
|
223
|
+
return std::move(result);
|
224
|
+
}
|
225
|
+
|
195
226
|
unique_ptr<QueryNode> SelectNode::Deserialize(FieldReader &reader) {
|
196
227
|
auto result = make_unique<SelectNode>();
|
197
228
|
result->select_list = reader.ReadRequiredSerializableList<ParsedExpression>();
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/parser/query_node/set_operation_node.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
4
6
|
|
5
7
|
namespace duckdb {
|
6
8
|
|
@@ -81,4 +83,19 @@ unique_ptr<QueryNode> SetOperationNode::Deserialize(FieldReader &reader) {
|
|
81
83
|
return std::move(result);
|
82
84
|
}
|
83
85
|
|
86
|
+
void SetOperationNode::FormatSerialize(duckdb::FormatSerializer &serializer) const {
|
87
|
+
QueryNode::FormatSerialize(serializer);
|
88
|
+
serializer.WriteProperty("set_op_type", setop_type);
|
89
|
+
serializer.WriteProperty("left", *left);
|
90
|
+
serializer.WriteProperty("right", *right);
|
91
|
+
}
|
92
|
+
|
93
|
+
unique_ptr<QueryNode> SetOperationNode::FormatDeserialize(duckdb::FormatDeserializer &deserializer) {
|
94
|
+
auto result = make_unique<SetOperationNode>();
|
95
|
+
deserializer.ReadProperty("set_op_type", result->setop_type);
|
96
|
+
deserializer.ReadProperty("left", result->left);
|
97
|
+
deserializer.ReadProperty("right", result->right);
|
98
|
+
return std::move(result);
|
99
|
+
}
|
100
|
+
|
84
101
|
} // namespace duckdb
|
@@ -5,6 +5,8 @@
|
|
5
5
|
#include "duckdb/parser/query_node/recursive_cte_node.hpp"
|
6
6
|
#include "duckdb/common/limits.hpp"
|
7
7
|
#include "duckdb/common/field_writer.hpp"
|
8
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
9
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
8
10
|
|
9
11
|
namespace duckdb {
|
10
12
|
|
@@ -65,6 +67,16 @@ string CommonTableExpressionMap::ToString() const {
|
|
65
67
|
return result;
|
66
68
|
}
|
67
69
|
|
70
|
+
void CommonTableExpressionMap::FormatSerialize(FormatSerializer &serializer) const {
|
71
|
+
serializer.WriteProperty("map", map);
|
72
|
+
}
|
73
|
+
|
74
|
+
CommonTableExpressionMap CommonTableExpressionMap::FormatDeserialize(FormatDeserializer &deserializer) {
|
75
|
+
auto result = CommonTableExpressionMap();
|
76
|
+
deserializer.ReadProperty("map", result.map);
|
77
|
+
return result;
|
78
|
+
}
|
79
|
+
|
68
80
|
string QueryNode::ResultModifiersToString() const {
|
69
81
|
string result;
|
70
82
|
for (idx_t modifier_idx = 0; modifier_idx < modifiers.size(); modifier_idx++) {
|
@@ -155,6 +167,7 @@ void QueryNode::Serialize(Serializer &main_serializer) const {
|
|
155
167
|
writer.WriteField<QueryNodeType>(type);
|
156
168
|
writer.WriteSerializableList(modifiers);
|
157
169
|
// cte_map
|
170
|
+
|
158
171
|
writer.WriteField<uint32_t>((uint32_t)cte_map.map.size());
|
159
172
|
auto &serializer = writer.GetSerializer();
|
160
173
|
for (auto &cte : cte_map.map) {
|
@@ -163,9 +176,46 @@ void QueryNode::Serialize(Serializer &main_serializer) const {
|
|
163
176
|
cte.second->query->Serialize(serializer);
|
164
177
|
}
|
165
178
|
Serialize(writer);
|
179
|
+
|
166
180
|
writer.Finalize();
|
167
181
|
}
|
168
182
|
|
183
|
+
// Children should call the base method before their own.
|
184
|
+
void QueryNode::FormatSerialize(FormatSerializer &serializer) const {
|
185
|
+
serializer.WriteProperty("type", type);
|
186
|
+
serializer.WriteProperty("modifiers", modifiers);
|
187
|
+
serializer.WriteProperty("cte_map", cte_map);
|
188
|
+
}
|
189
|
+
|
190
|
+
unique_ptr<QueryNode> QueryNode::FormatDeserialize(FormatDeserializer &deserializer) {
|
191
|
+
|
192
|
+
auto type = deserializer.ReadProperty<QueryNodeType>("type");
|
193
|
+
|
194
|
+
auto modifiers = deserializer.ReadProperty<vector<unique_ptr<ResultModifier>>>("modifiers");
|
195
|
+
auto cte_map = deserializer.ReadProperty<CommonTableExpressionMap>("cte_map");
|
196
|
+
|
197
|
+
unique_ptr<QueryNode> result;
|
198
|
+
|
199
|
+
switch (type) {
|
200
|
+
case QueryNodeType::SELECT_NODE:
|
201
|
+
result = SelectNode::FormatDeserialize(deserializer);
|
202
|
+
break;
|
203
|
+
case QueryNodeType::SET_OPERATION_NODE:
|
204
|
+
result = SetOperationNode::FormatDeserialize(deserializer);
|
205
|
+
break;
|
206
|
+
case QueryNodeType::RECURSIVE_CTE_NODE:
|
207
|
+
result = RecursiveCTENode::FormatDeserialize(deserializer);
|
208
|
+
break;
|
209
|
+
default:
|
210
|
+
throw SerializationException("Could not deserialize Query Node: unknown type!");
|
211
|
+
}
|
212
|
+
|
213
|
+
result->type = type;
|
214
|
+
result->modifiers = std::move(modifiers);
|
215
|
+
result->cte_map = std::move(cte_map);
|
216
|
+
return result;
|
217
|
+
}
|
218
|
+
|
169
219
|
unique_ptr<QueryNode> QueryNode::Deserialize(Deserializer &main_source) {
|
170
220
|
FieldReader reader(main_source);
|
171
221
|
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/parser/result_modifier.hpp"
|
2
2
|
#include "duckdb/common/field_writer.hpp"
|
3
3
|
#include "duckdb/parser/expression_util.hpp"
|
4
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
4
6
|
|
5
7
|
namespace duckdb {
|
6
8
|
|
@@ -18,6 +20,33 @@ void ResultModifier::Serialize(Serializer &serializer) const {
|
|
18
20
|
writer.Finalize();
|
19
21
|
}
|
20
22
|
|
23
|
+
void ResultModifier::FormatSerialize(FormatSerializer &serializer) const {
|
24
|
+
serializer.WriteProperty("type", type);
|
25
|
+
}
|
26
|
+
|
27
|
+
std::unique_ptr<ResultModifier> ResultModifier::FormatDeserialize(FormatDeserializer &deserializer) {
|
28
|
+
auto type = deserializer.ReadProperty<ResultModifierType>("type");
|
29
|
+
|
30
|
+
unique_ptr<ResultModifier> result;
|
31
|
+
switch (type) {
|
32
|
+
case ResultModifierType::LIMIT_MODIFIER:
|
33
|
+
result = LimitModifier::FormatDeserialize(deserializer);
|
34
|
+
break;
|
35
|
+
case ResultModifierType::ORDER_MODIFIER:
|
36
|
+
result = OrderModifier::FormatDeserialize(deserializer);
|
37
|
+
break;
|
38
|
+
case ResultModifierType::DISTINCT_MODIFIER:
|
39
|
+
result = DistinctModifier::FormatDeserialize(deserializer);
|
40
|
+
break;
|
41
|
+
case ResultModifierType::LIMIT_PERCENT_MODIFIER:
|
42
|
+
result = LimitPercentModifier::FormatDeserialize(deserializer);
|
43
|
+
break;
|
44
|
+
default:
|
45
|
+
throw InternalException("Unrecognized ResultModifierType for Deserialization");
|
46
|
+
}
|
47
|
+
return result;
|
48
|
+
}
|
49
|
+
|
21
50
|
unique_ptr<ResultModifier> ResultModifier::Deserialize(Deserializer &source) {
|
22
51
|
FieldReader reader(source);
|
23
52
|
auto type = reader.ReadRequired<ResultModifierType>();
|
@@ -73,6 +102,16 @@ void LimitModifier::Serialize(FieldWriter &writer) const {
|
|
73
102
|
writer.WriteOptional(offset);
|
74
103
|
}
|
75
104
|
|
105
|
+
void LimitModifier::FormatSerialize(FormatSerializer &serializer) const {
|
106
|
+
ResultModifier::FormatSerialize(serializer);
|
107
|
+
serializer.WriteOptionalProperty("limit", limit);
|
108
|
+
serializer.WriteOptionalProperty("offset", offset);
|
109
|
+
}
|
110
|
+
|
111
|
+
unique_ptr<ResultModifier> LimitModifier::FormatDeserialize(FormatDeserializer &deserializer) {
|
112
|
+
throw NotImplementedException("err");
|
113
|
+
}
|
114
|
+
|
76
115
|
unique_ptr<ResultModifier> LimitModifier::Deserialize(FieldReader &reader) {
|
77
116
|
auto mod = make_unique<LimitModifier>();
|
78
117
|
mod->limit = reader.ReadOptional<ParsedExpression>(nullptr);
|
@@ -103,6 +142,16 @@ void DistinctModifier::Serialize(FieldWriter &writer) const {
|
|
103
142
|
writer.WriteSerializableList(distinct_on_targets);
|
104
143
|
}
|
105
144
|
|
145
|
+
void DistinctModifier::FormatSerialize(duckdb::FormatSerializer &serializer) const {
|
146
|
+
ResultModifier::FormatSerialize(serializer);
|
147
|
+
serializer.WriteProperty("distinct_on_targets", distinct_on_targets);
|
148
|
+
}
|
149
|
+
|
150
|
+
unique_ptr<ResultModifier> DistinctModifier::FormatDeserialize(FormatDeserializer &deserializer) {
|
151
|
+
auto mod = make_unique<DistinctModifier>();
|
152
|
+
throw NotImplementedException("");
|
153
|
+
}
|
154
|
+
|
106
155
|
unique_ptr<ResultModifier> DistinctModifier::Deserialize(FieldReader &reader) {
|
107
156
|
auto mod = make_unique<DistinctModifier>();
|
108
157
|
mod->distinct_on_targets = reader.ReadRequiredSerializableList<ParsedExpression>();
|
@@ -170,6 +219,16 @@ void OrderByNode::Serialize(Serializer &serializer) const {
|
|
170
219
|
writer.Finalize();
|
171
220
|
}
|
172
221
|
|
222
|
+
void OrderByNode::FormatSerialize(FormatSerializer &serializer) const {
|
223
|
+
serializer.WriteProperty("type", type);
|
224
|
+
serializer.WriteProperty("null_order", null_order);
|
225
|
+
serializer.WriteProperty("expression", expression);
|
226
|
+
}
|
227
|
+
|
228
|
+
OrderByNode OrderByNode::FormatDeserialize(FormatDeserializer &deserializer) {
|
229
|
+
throw NotImplementedException("err");
|
230
|
+
}
|
231
|
+
|
173
232
|
OrderByNode OrderByNode::Deserialize(Deserializer &source) {
|
174
233
|
FieldReader reader(source);
|
175
234
|
auto type = reader.ReadRequired<OrderType>();
|
@@ -183,6 +242,14 @@ void OrderModifier::Serialize(FieldWriter &writer) const {
|
|
183
242
|
writer.WriteRegularSerializableList(orders);
|
184
243
|
}
|
185
244
|
|
245
|
+
void OrderModifier::FormatSerialize(FormatSerializer &serializer) const {
|
246
|
+
ResultModifier::FormatSerialize(serializer);
|
247
|
+
serializer.WriteProperty("orders", orders);
|
248
|
+
}
|
249
|
+
unique_ptr<ResultModifier> OrderModifier::FormatDeserialize(FormatDeserializer &deserializer) {
|
250
|
+
throw NotImplementedException("err");
|
251
|
+
}
|
252
|
+
|
186
253
|
unique_ptr<ResultModifier> OrderModifier::Deserialize(FieldReader &reader) {
|
187
254
|
auto mod = make_unique<OrderModifier>();
|
188
255
|
mod->orders = reader.ReadRequiredSerializableList<OrderByNode, OrderByNode>();
|
@@ -219,6 +286,12 @@ void LimitPercentModifier::Serialize(FieldWriter &writer) const {
|
|
219
286
|
writer.WriteOptional(offset);
|
220
287
|
}
|
221
288
|
|
289
|
+
void LimitPercentModifier::FormatSerialize(FormatSerializer &serializer) const {
|
290
|
+
ResultModifier::FormatSerialize(serializer);
|
291
|
+
serializer.WriteProperty("limit", limit);
|
292
|
+
serializer.WriteProperty("offset", offset);
|
293
|
+
}
|
294
|
+
|
222
295
|
unique_ptr<ResultModifier> LimitPercentModifier::Deserialize(FieldReader &reader) {
|
223
296
|
auto mod = make_unique<LimitPercentModifier>();
|
224
297
|
mod->limit = reader.ReadOptional<ParsedExpression>(nullptr);
|
@@ -226,4 +299,9 @@ unique_ptr<ResultModifier> LimitPercentModifier::Deserialize(FieldReader &reader
|
|
226
299
|
return std::move(mod);
|
227
300
|
}
|
228
301
|
|
302
|
+
unique_ptr<ResultModifier> LimitPercentModifier::FormatDeserialize(FormatDeserializer &deserializer) {
|
303
|
+
auto mod = make_unique<LimitPercentModifier>();
|
304
|
+
throw NotImplementedException("err");
|
305
|
+
}
|
306
|
+
|
229
307
|
} // namespace duckdb
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/parser/statement/select_statement.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/serializer.hpp"
|
4
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
4
6
|
|
5
7
|
namespace duckdb {
|
6
8
|
|
@@ -15,12 +17,22 @@ void SelectStatement::Serialize(Serializer &serializer) const {
|
|
15
17
|
node->Serialize(serializer);
|
16
18
|
}
|
17
19
|
|
20
|
+
void SelectStatement::FormatSerialize(FormatSerializer &serializer) const {
|
21
|
+
node->FormatSerialize(serializer);
|
22
|
+
}
|
23
|
+
|
18
24
|
unique_ptr<SelectStatement> SelectStatement::Deserialize(Deserializer &source) {
|
19
25
|
auto result = make_unique<SelectStatement>();
|
20
26
|
result->node = QueryNode::Deserialize(source);
|
21
27
|
return result;
|
22
28
|
}
|
23
29
|
|
30
|
+
unique_ptr<SelectStatement> SelectStatement::FormatDeserialize(FormatDeserializer &deserializer) {
|
31
|
+
auto result = make_unique<SelectStatement>();
|
32
|
+
deserializer.ReadProperty("node", result->node);
|
33
|
+
return result;
|
34
|
+
}
|
35
|
+
|
24
36
|
bool SelectStatement::Equals(const SQLStatement *other_p) const {
|
25
37
|
if (type != other_p->type) {
|
26
38
|
return false;
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
#include "duckdb/common/field_writer.hpp"
|
4
4
|
#include "duckdb/parser/keyword_helper.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
6
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
5
7
|
|
6
8
|
namespace duckdb {
|
7
9
|
|
@@ -29,6 +31,25 @@ void BaseTableRef::Serialize(FieldWriter &writer) const {
|
|
29
31
|
writer.WriteString(catalog_name);
|
30
32
|
}
|
31
33
|
|
34
|
+
void BaseTableRef::FormatSerialize(FormatSerializer &serializer) const {
|
35
|
+
TableRef::FormatSerialize(serializer);
|
36
|
+
serializer.WriteProperty("schema_name", schema_name);
|
37
|
+
serializer.WriteProperty("table_name", table_name);
|
38
|
+
serializer.WriteProperty("column_name_alias", column_name_alias);
|
39
|
+
serializer.WriteProperty("catalog_name", catalog_name);
|
40
|
+
}
|
41
|
+
|
42
|
+
unique_ptr<TableRef> BaseTableRef::FormatDeserialize(FormatDeserializer &deserializer) {
|
43
|
+
auto result = make_unique<BaseTableRef>();
|
44
|
+
|
45
|
+
deserializer.ReadProperty("schema_name", result->schema_name);
|
46
|
+
deserializer.ReadProperty("table_name", result->table_name);
|
47
|
+
deserializer.ReadProperty("column_name_alias", result->column_name_alias);
|
48
|
+
deserializer.ReadProperty("catalog_name", result->catalog_name);
|
49
|
+
|
50
|
+
return std::move(result);
|
51
|
+
}
|
52
|
+
|
32
53
|
unique_ptr<TableRef> BaseTableRef::Deserialize(FieldReader &reader) {
|
33
54
|
auto result = make_unique<BaseTableRef>();
|
34
55
|
|
@@ -23,4 +23,8 @@ unique_ptr<TableRef> EmptyTableRef::Deserialize(FieldReader &reader) {
|
|
23
23
|
return make_unique<EmptyTableRef>();
|
24
24
|
}
|
25
25
|
|
26
|
+
unique_ptr<TableRef> EmptyTableRef::FormatDeserialize(FormatDeserializer &source) {
|
27
|
+
return make_unique<EmptyTableRef>();
|
28
|
+
}
|
29
|
+
|
26
30
|
} // namespace duckdb
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/parser/tableref/expressionlistref.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
4
6
|
|
5
7
|
namespace duckdb {
|
6
8
|
|
@@ -73,6 +75,21 @@ void ExpressionListRef::Serialize(FieldWriter &writer) const {
|
|
73
75
|
}
|
74
76
|
}
|
75
77
|
|
78
|
+
void ExpressionListRef::FormatSerialize(FormatSerializer &serializer) const {
|
79
|
+
TableRef::FormatSerialize(serializer);
|
80
|
+
serializer.WriteProperty("expected_names", expected_names);
|
81
|
+
serializer.WriteProperty("expected_types", expected_types);
|
82
|
+
serializer.WriteProperty("values", values);
|
83
|
+
}
|
84
|
+
|
85
|
+
unique_ptr<TableRef> ExpressionListRef::FormatDeserialize(FormatDeserializer &source) {
|
86
|
+
auto result = make_unique<ExpressionListRef>();
|
87
|
+
source.ReadProperty("expected_names", result->expected_names);
|
88
|
+
source.ReadProperty("expected_types", result->expected_types);
|
89
|
+
source.ReadProperty("values", result->values);
|
90
|
+
return std::move(result);
|
91
|
+
}
|
92
|
+
|
76
93
|
unique_ptr<TableRef> ExpressionListRef::Deserialize(FieldReader &reader) {
|
77
94
|
auto result = make_unique<ExpressionListRef>();
|
78
95
|
// value list
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
#include "duckdb/common/limits.hpp"
|
4
4
|
#include "duckdb/common/field_writer.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
6
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
5
7
|
|
6
8
|
namespace duckdb {
|
7
9
|
|
@@ -82,6 +84,29 @@ void JoinRef::Serialize(FieldWriter &writer) const {
|
|
82
84
|
writer.WriteList<string>(using_columns);
|
83
85
|
}
|
84
86
|
|
87
|
+
void JoinRef::FormatSerialize(FormatSerializer &serializer) const {
|
88
|
+
TableRef::FormatSerialize(serializer);
|
89
|
+
serializer.WriteProperty("left", *left);
|
90
|
+
serializer.WriteProperty("right", *right);
|
91
|
+
serializer.WriteOptionalProperty("condition", condition);
|
92
|
+
serializer.WriteProperty("join_type", type);
|
93
|
+
serializer.WriteProperty("ref_type", ref_type);
|
94
|
+
serializer.WriteProperty("using_columns", using_columns);
|
95
|
+
}
|
96
|
+
|
97
|
+
unique_ptr<TableRef> JoinRef::FormatDeserialize(FormatDeserializer &source) {
|
98
|
+
auto result = make_unique<JoinRef>(JoinRefType::REGULAR);
|
99
|
+
|
100
|
+
source.ReadProperty("left", result->left);
|
101
|
+
source.ReadProperty("right", result->right);
|
102
|
+
source.ReadOptionalProperty("condition", result->condition);
|
103
|
+
source.ReadProperty("join_type", result->type);
|
104
|
+
source.ReadProperty("ref_type", result->ref_type);
|
105
|
+
source.ReadProperty("using_columns", result->using_columns);
|
106
|
+
|
107
|
+
return std::move(result);
|
108
|
+
}
|
109
|
+
|
85
110
|
unique_ptr<TableRef> JoinRef::Deserialize(FieldReader &reader) {
|
86
111
|
auto result = make_unique<JoinRef>(JoinRefType::REGULAR);
|
87
112
|
result->left = reader.ReadRequiredSerializable<TableRef>();
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
#include "duckdb/common/limits.hpp"
|
4
4
|
#include "duckdb/common/field_writer.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
6
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
5
7
|
|
6
8
|
namespace duckdb {
|
7
9
|
|
@@ -107,6 +109,12 @@ void PivotColumn::Serialize(Serializer &serializer) const {
|
|
107
109
|
writer.Finalize();
|
108
110
|
}
|
109
111
|
|
112
|
+
void PivotColumn::FormatSerialize(FormatSerializer &serializer) const {
|
113
|
+
serializer.WriteProperty("names", names);
|
114
|
+
serializer.WriteProperty("entries", entries);
|
115
|
+
serializer.WriteProperty("pivot_enum", pivot_enum);
|
116
|
+
}
|
117
|
+
|
110
118
|
PivotColumn PivotColumn::Deserialize(Deserializer &source) {
|
111
119
|
PivotColumn result;
|
112
120
|
FieldReader reader(source);
|
@@ -117,6 +125,14 @@ PivotColumn PivotColumn::Deserialize(Deserializer &source) {
|
|
117
125
|
return result;
|
118
126
|
}
|
119
127
|
|
128
|
+
PivotColumn PivotColumn::FormatDeserialize(FormatDeserializer &source) {
|
129
|
+
PivotColumn result;
|
130
|
+
source.ReadProperty("names", result.names);
|
131
|
+
source.ReadProperty("entries", result.entries);
|
132
|
+
source.ReadProperty("pivot_enum", result.pivot_enum);
|
133
|
+
return result;
|
134
|
+
}
|
135
|
+
|
120
136
|
//===--------------------------------------------------------------------===//
|
121
137
|
// PivotColumnEntry
|
122
138
|
//===--------------------------------------------------------------------===//
|
@@ -136,6 +152,12 @@ void PivotColumnEntry::Serialize(Serializer &serializer) const {
|
|
136
152
|
writer.Finalize();
|
137
153
|
}
|
138
154
|
|
155
|
+
void PivotColumnEntry::FormatSerialize(FormatSerializer &serializer) const {
|
156
|
+
serializer.WriteProperty("values", values);
|
157
|
+
serializer.WriteOptionalProperty("star_expr", star_expr);
|
158
|
+
serializer.WriteProperty("alias", alias);
|
159
|
+
}
|
160
|
+
|
139
161
|
PivotColumnEntry PivotColumnEntry::Deserialize(Deserializer &source) {
|
140
162
|
PivotColumnEntry result;
|
141
163
|
FieldReader reader(source);
|
@@ -146,6 +168,14 @@ PivotColumnEntry PivotColumnEntry::Deserialize(Deserializer &source) {
|
|
146
168
|
return result;
|
147
169
|
}
|
148
170
|
|
171
|
+
PivotColumnEntry PivotColumnEntry::FormatDeserialize(FormatDeserializer &source) {
|
172
|
+
PivotColumnEntry result;
|
173
|
+
source.ReadProperty("values", result.values);
|
174
|
+
source.ReadOptionalProperty("star_expr", result.star_expr);
|
175
|
+
source.ReadProperty("alias", result.alias);
|
176
|
+
return result;
|
177
|
+
}
|
178
|
+
|
149
179
|
//===--------------------------------------------------------------------===//
|
150
180
|
// PivotRef
|
151
181
|
//===--------------------------------------------------------------------===//
|
@@ -281,6 +311,17 @@ void PivotRef::Serialize(FieldWriter &writer) const {
|
|
281
311
|
writer.WriteField<bool>(include_nulls);
|
282
312
|
}
|
283
313
|
|
314
|
+
void PivotRef::FormatSerialize(FormatSerializer &serializer) const {
|
315
|
+
TableRef::FormatSerialize(serializer);
|
316
|
+
serializer.WriteProperty("source", source);
|
317
|
+
serializer.WriteProperty("aggregates", aggregates);
|
318
|
+
serializer.WriteProperty("unpivot_names", unpivot_names);
|
319
|
+
serializer.WriteProperty("pivots", pivots);
|
320
|
+
serializer.WriteProperty("groups", groups);
|
321
|
+
serializer.WriteProperty("column_name_alias", column_name_alias);
|
322
|
+
serializer.WriteProperty("include_nulls", include_nulls);
|
323
|
+
}
|
324
|
+
|
284
325
|
unique_ptr<TableRef> PivotRef::Deserialize(FieldReader &reader) {
|
285
326
|
auto result = make_unique<PivotRef>();
|
286
327
|
result->source = reader.ReadRequiredSerializable<TableRef>();
|
@@ -293,4 +334,16 @@ unique_ptr<TableRef> PivotRef::Deserialize(FieldReader &reader) {
|
|
293
334
|
return std::move(result);
|
294
335
|
}
|
295
336
|
|
337
|
+
unique_ptr<TableRef> PivotRef::FormatDeserialize(FormatDeserializer &source) {
|
338
|
+
auto result = make_unique<PivotRef>();
|
339
|
+
source.ReadProperty("source", result->source);
|
340
|
+
source.ReadProperty("aggregates", result->aggregates);
|
341
|
+
source.ReadProperty("unpivot_names", result->unpivot_names);
|
342
|
+
source.ReadProperty("pivots", result->pivots);
|
343
|
+
source.ReadProperty("groups", result->groups);
|
344
|
+
source.ReadProperty("column_name_alias", result->column_name_alias);
|
345
|
+
source.ReadProperty("include_nulls", result->include_nulls);
|
346
|
+
return std::move(result);
|
347
|
+
}
|
348
|
+
|
296
349
|
} // namespace duckdb
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
#include "duckdb/common/limits.hpp"
|
4
4
|
#include "duckdb/common/field_writer.hpp"
|
5
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
6
|
+
#include "duckdb/common/serializer/format_deserializer.hpp"
|
5
7
|
|
6
8
|
namespace duckdb {
|
7
9
|
|
@@ -35,6 +37,19 @@ void SubqueryRef::Serialize(FieldWriter &writer) const {
|
|
35
37
|
writer.WriteList<string>(column_name_alias);
|
36
38
|
}
|
37
39
|
|
40
|
+
void SubqueryRef::FormatSerialize(FormatSerializer &serializer) const {
|
41
|
+
TableRef::FormatSerialize(serializer);
|
42
|
+
serializer.WriteProperty("subquery", subquery);
|
43
|
+
serializer.WriteProperty("column_name_alias", column_name_alias);
|
44
|
+
}
|
45
|
+
|
46
|
+
unique_ptr<TableRef> SubqueryRef::FormatDeserialize(FormatDeserializer &deserializer) {
|
47
|
+
auto subquery = deserializer.ReadProperty<unique_ptr<SelectStatement>>("subquery");
|
48
|
+
auto result = make_unique<SubqueryRef>(std::move(subquery));
|
49
|
+
deserializer.ReadProperty("column_name_alias", result->column_name_alias);
|
50
|
+
return std::move(result);
|
51
|
+
}
|
52
|
+
|
38
53
|
unique_ptr<TableRef> SubqueryRef::Deserialize(FieldReader &reader) {
|
39
54
|
auto subquery = reader.ReadRequiredSerializable<SelectStatement>();
|
40
55
|
auto result = make_unique<SubqueryRef>(std::move(subquery));
|