duckdb 0.7.2-dev3441.0 → 0.7.2-dev3546.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.
Files changed (160) hide show
  1. package/configure.py +2 -0
  2. package/package.json +2 -2
  3. package/src/duckdb/extension/json/json_functions/json_create.cpp +1 -1
  4. package/src/duckdb/extension/json/json_functions/read_json.cpp +1 -0
  5. package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +42 -0
  6. package/src/duckdb/src/catalog/catalog_search_path.cpp +5 -0
  7. package/src/duckdb/src/catalog/catalog_set.cpp +1 -1
  8. package/src/duckdb/src/catalog/default/default_functions.cpp +1 -0
  9. package/src/duckdb/src/common/arrow/arrow_converter.cpp +4 -4
  10. package/src/duckdb/src/common/compressed_file_system.cpp +2 -2
  11. package/src/duckdb/src/common/constants.cpp +1 -0
  12. package/src/duckdb/src/common/file_system.cpp +2 -2
  13. package/src/duckdb/src/common/row_operations/row_gather.cpp +2 -2
  14. package/src/duckdb/src/common/serializer/binary_deserializer.cpp +1 -1
  15. package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +1 -1
  16. package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +1 -1
  17. package/src/duckdb/src/common/serializer/buffered_serializer.cpp +4 -3
  18. package/src/duckdb/src/common/serializer.cpp +1 -1
  19. package/src/duckdb/src/common/sort/radix_sort.cpp +5 -5
  20. package/src/duckdb/src/common/string_util.cpp +2 -2
  21. package/src/duckdb/src/common/types/bit.cpp +2 -2
  22. package/src/duckdb/src/common/types/blob.cpp +2 -2
  23. package/src/duckdb/src/common/types/data_chunk.cpp +2 -2
  24. package/src/duckdb/src/common/types/date.cpp +1 -1
  25. package/src/duckdb/src/common/types/decimal.cpp +2 -2
  26. package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +14 -2
  27. package/src/duckdb/src/common/types/selection_vector.cpp +1 -1
  28. package/src/duckdb/src/common/types/time.cpp +1 -1
  29. package/src/duckdb/src/common/types/vector.cpp +10 -10
  30. package/src/duckdb/src/common/types/vector_buffer.cpp +11 -3
  31. package/src/duckdb/src/common/types/vector_cache.cpp +5 -5
  32. package/src/duckdb/src/common/virtual_file_system.cpp +4 -0
  33. package/src/duckdb/src/common/windows_util.cpp +2 -2
  34. package/src/duckdb/src/core_functions/aggregate/distributive/string_agg.cpp +6 -3
  35. package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +2 -5
  36. package/src/duckdb/src/core_functions/scalar/string/printf.cpp +1 -1
  37. package/src/duckdb/src/execution/aggregate_hashtable.cpp +1 -1
  38. package/src/duckdb/src/execution/join_hashtable.cpp +3 -3
  39. package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +2 -2
  40. package/src/duckdb/src/execution/operator/join/outer_join_marker.cpp +1 -1
  41. package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +1 -1
  42. package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +1 -1
  43. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +2 -7
  44. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +4 -41
  45. package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +158 -0
  46. package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +1 -1
  47. package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +2 -2
  48. package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +2 -2
  49. package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +3 -4
  50. package/src/duckdb/src/execution/window_segment_tree.cpp +1 -1
  51. package/src/duckdb/src/function/macro_function.cpp +43 -0
  52. package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -1
  53. package/src/duckdb/src/function/scalar/strftime_format.cpp +2 -1
  54. package/src/duckdb/src/function/scalar/string/concat.cpp +1 -1
  55. package/src/duckdb/src/function/scalar/string/like.cpp +2 -2
  56. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -5
  57. package/src/duckdb/src/function/scalar_macro_function.cpp +10 -0
  58. package/src/duckdb/src/function/table/copy_csv.cpp +3 -7
  59. package/src/duckdb/src/function/table/read_csv.cpp +60 -35
  60. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  61. package/src/duckdb/src/function/table_macro_function.cpp +10 -0
  62. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +3 -1
  63. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +0 -6
  64. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +0 -6
  65. package/src/duckdb/src/include/duckdb/common/allocator.hpp +3 -0
  66. package/src/duckdb/src/include/duckdb/common/compressed_file_system.hpp +3 -3
  67. package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -5
  68. package/src/duckdb/src/include/duckdb/common/field_writer.hpp +3 -3
  69. package/src/duckdb/src/include/duckdb/common/helper.hpp +22 -9
  70. package/src/duckdb/src/include/duckdb/common/memory_safety.hpp +15 -0
  71. package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +1 -0
  72. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +1 -1
  73. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +1 -1
  74. package/src/duckdb/src/include/duckdb/common/serializer/buffered_serializer.hpp +3 -2
  75. package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +2 -3
  76. package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +11 -6
  77. package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -1
  78. package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +1 -1
  79. package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +3 -3
  80. package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +16 -6
  81. package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +53 -22
  82. package/src/duckdb/src/include/duckdb/common/vector.hpp +5 -2
  83. package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +1 -1
  84. package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +4 -4
  85. package/src/duckdb/src/include/duckdb/execution/operator/join/outer_join_marker.hpp +1 -1
  86. package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +1 -1
  87. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_range_join.hpp +1 -1
  88. package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +0 -2
  89. package/src/duckdb/src/include/duckdb/execution/operator/persistent/buffered_csv_reader.hpp +2 -2
  90. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_file_handle.hpp +27 -127
  91. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +1 -2
  92. package/src/duckdb/src/include/duckdb/execution/operator/persistent/parallel_csv_reader.hpp +2 -2
  93. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +1 -1
  94. package/src/duckdb/src/include/duckdb/execution/perfect_aggregate_hashtable.hpp +2 -2
  95. package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +1 -1
  96. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +7 -1
  97. package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +3 -4
  98. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +7 -2
  99. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +2 -4
  100. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +5 -0
  101. package/src/duckdb/src/include/duckdb/optimizer/join_order/join_relation.hpp +3 -3
  102. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +4 -7
  103. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +8 -12
  104. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +6 -20
  105. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +6 -18
  106. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +4 -8
  107. package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +4 -38
  108. package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +5 -2
  109. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -10
  110. package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +5 -0
  111. package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +2 -2
  112. package/src/duckdb/src/include/duckdb/storage/buffer/buffer_handle.hpp +9 -2
  113. package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +1 -1
  114. package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +1 -1
  115. package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +1 -1
  116. package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +2 -2
  117. package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +5 -5
  118. package/src/duckdb/src/optimizer/unnest_rewriter.cpp +14 -6
  119. package/src/duckdb/src/parser/parsed_data/attach_info.cpp +42 -0
  120. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +0 -7
  121. package/src/duckdb/src/parser/parsed_data/create_info.cpp +19 -8
  122. package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +46 -0
  123. package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +56 -0
  124. package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +47 -0
  125. package/src/duckdb/src/parser/parsed_data/detach_info.cpp +34 -0
  126. package/src/duckdb/src/parser/parsed_data/drop_info.cpp +46 -0
  127. package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +24 -0
  128. package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +37 -0
  129. package/src/duckdb/src/parser/statement/insert_statement.cpp +4 -1
  130. package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +10 -0
  131. package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +27 -9
  132. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +2 -1
  133. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +1 -0
  134. package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +32 -7
  135. package/src/duckdb/src/planner/logical_operator.cpp +1 -2
  136. package/src/duckdb/src/planner/operator/logical_create_index.cpp +16 -25
  137. package/src/duckdb/src/planner/operator/logical_insert.cpp +30 -0
  138. package/src/duckdb/src/planner/operator/logical_simple.cpp +33 -5
  139. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +6 -16
  140. package/src/duckdb/src/planner/planner.cpp +4 -13
  141. package/src/duckdb/src/storage/arena_allocator.cpp +1 -1
  142. package/src/duckdb/src/storage/buffer/buffer_handle.cpp +2 -11
  143. package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +1 -1
  144. package/src/duckdb/src/storage/checkpoint_manager.cpp +12 -6
  145. package/src/duckdb/src/storage/compression/string_uncompressed.cpp +2 -2
  146. package/src/duckdb/src/storage/statistics/list_stats.cpp +1 -1
  147. package/src/duckdb/src/storage/statistics/struct_stats.cpp +1 -1
  148. package/src/duckdb/src/storage/storage_info.cpp +1 -1
  149. package/src/duckdb/src/storage/table/row_group.cpp +2 -2
  150. package/src/duckdb/src/storage/table/update_segment.cpp +7 -6
  151. package/src/duckdb/third_party/fsst/libfsst.cpp +1 -2
  152. package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +9 -0
  153. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +13 -12
  154. package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +2 -1
  155. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +12537 -12415
  156. package/src/duckdb/ub_src_catalog_catalog_entry.cpp +1 -1
  157. package/src/duckdb/ub_src_execution_operator_persistent.cpp +2 -0
  158. package/src/duckdb/ub_src_parser_parsed_data.cpp +16 -0
  159. package/src/statement.cpp +15 -13
  160. package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +0 -104
@@ -10,7 +10,7 @@
10
10
 
11
11
  #include "src/catalog/catalog_entry/index_catalog_entry.cpp"
12
12
 
13
- #include "src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp"
13
+ #include "src/catalog/catalog_entry/macro_catalog_entry.cpp"
14
14
 
15
15
  #include "src/catalog/catalog_entry/pragma_function_catalog_entry.cpp"
16
16
 
@@ -6,6 +6,8 @@
6
6
 
7
7
  #include "src/execution/operator/persistent/csv_buffer.cpp"
8
8
 
9
+ #include "src/execution/operator/persistent/csv_file_handle.cpp"
10
+
9
11
  #include "src/execution/operator/persistent/csv_reader_options.cpp"
10
12
 
11
13
  #include "src/execution/operator/persistent/physical_fixed_batch_copy.cpp"
@@ -6,6 +6,8 @@
6
6
 
7
7
  #include "src/parser/parsed_data/alter_table_info.cpp"
8
8
 
9
+ #include "src/parser/parsed_data/attach_info.cpp"
10
+
9
11
  #include "src/parser/parsed_data/create_info.cpp"
10
12
 
11
13
  #include "src/parser/parsed_data/create_index_info.cpp"
@@ -16,15 +18,29 @@
16
18
 
17
19
  #include "src/parser/parsed_data/create_copy_function_info.cpp"
18
20
 
21
+ #include "src/parser/parsed_data/create_macro_info.cpp"
22
+
19
23
  #include "src/parser/parsed_data/create_pragma_function_info.cpp"
20
24
 
25
+ #include "src/parser/parsed_data/create_sequence_info.cpp"
26
+
21
27
  #include "src/parser/parsed_data/create_scalar_function_info.cpp"
22
28
 
23
29
  #include "src/parser/parsed_data/create_table_function_info.cpp"
24
30
 
25
31
  #include "src/parser/parsed_data/create_table_info.cpp"
26
32
 
33
+ #include "src/parser/parsed_data/create_type_info.cpp"
34
+
27
35
  #include "src/parser/parsed_data/create_view_info.cpp"
28
36
 
37
+ #include "src/parser/parsed_data/detach_info.cpp"
38
+
39
+ #include "src/parser/parsed_data/drop_info.cpp"
40
+
29
41
  #include "src/parser/parsed_data/sample_options.cpp"
30
42
 
43
+ #include "src/parser/parsed_data/transaction_info.cpp"
44
+
45
+ #include "src/parser/parsed_data/vacuum_info.cpp"
46
+
package/src/statement.cpp CHANGED
@@ -354,24 +354,21 @@ struct RunPreparedTask : public Task {
354
354
  auto deleter = [](Napi::Env, void *finalizeData, void *hint) {
355
355
  delete static_cast<std::shared_ptr<duckdb::QueryResult> *>(hint);
356
356
  };
357
-
358
357
  std::shared_ptr<duckdb::QueryResult> result_ptr = std::move(result);
359
358
 
360
359
  duckdb::idx_t out_idx = 1;
361
- while (true) {
362
- auto chunk = result_ptr->Fetch();
363
-
364
- if (!chunk || chunk->size() == 0) {
365
- break;
360
+ for (auto &chunk : materialized_result->Collection().Chunks()) {
361
+ if (chunk.size() == 0) {
362
+ continue;
366
363
  }
367
364
 
368
- D_ASSERT(chunk->ColumnCount() == 2);
369
- D_ASSERT(chunk->data[0].GetType() == duckdb::LogicalType::BLOB);
370
- D_ASSERT(chunk->data[1].GetType() == duckdb::LogicalType::BOOLEAN);
365
+ D_ASSERT(chunk.ColumnCount() == 2);
366
+ D_ASSERT(chunk.data[0].GetType() == duckdb::LogicalType::BLOB);
367
+ D_ASSERT(chunk.data[1].GetType() == duckdb::LogicalType::BOOLEAN);
371
368
 
372
- for (duckdb::idx_t row_idx = 0; row_idx < chunk->size(); row_idx++) {
373
- duckdb::string_t blob = ((duckdb::string_t *)(chunk->data[0].GetData()))[row_idx];
374
- bool is_header = chunk->data[1].GetData()[row_idx];
369
+ for (duckdb::idx_t row_idx = 0; row_idx < chunk.size(); row_idx++) {
370
+ duckdb::string_t blob = duckdb::FlatVector::GetData<duckdb::string_t>(chunk.data[0])[row_idx];
371
+ bool is_header = chunk.data[1].GetData()[row_idx];
375
372
 
376
373
  // Create shared pointer to give (shared) ownership to ArrayBuffer, not that for these materialized
377
374
  // query results, the string data is owned by the QueryResult
@@ -398,7 +395,12 @@ struct RunPreparedTask : public Task {
398
395
  result_arr.Set(out_idx++, null_arr);
399
396
 
400
397
  // Confirm all rows are set
401
- D_ASSERT(out_idx == materialized_result->RowCount() + 1);
398
+ if (materialized_result->RowCount() > 0) {
399
+ // Non empty results should have their
400
+ D_ASSERT(out_idx == materialized_result->RowCount() + 1);
401
+ } else {
402
+ D_ASSERT(out_idx == 2);
403
+ }
402
404
 
403
405
  cb.MakeCallback(statement.Value(), {env.Null(), result_arr});
404
406
  } break;
@@ -1,104 +0,0 @@
1
- #include "duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp"
2
- #include "duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp"
3
- #include "duckdb/common/field_writer.hpp"
4
- #include "duckdb/function/scalar_macro_function.hpp"
5
- #include "duckdb/function/table_macro_function.hpp"
6
-
7
- namespace duckdb {
8
-
9
- MacroCatalogEntry::MacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info)
10
- : FunctionEntry(
11
- (info.function->type == MacroType::SCALAR_MACRO ? CatalogType::MACRO_ENTRY : CatalogType::TABLE_MACRO_ENTRY),
12
- catalog, schema, info),
13
- function(std::move(info.function)) {
14
- this->temporary = info.temporary;
15
- this->internal = info.internal;
16
- }
17
-
18
- ScalarMacroCatalogEntry::ScalarMacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info)
19
- : MacroCatalogEntry(catalog, schema, info) {
20
- }
21
-
22
- void ScalarMacroCatalogEntry::Serialize(Serializer &main_serializer) const {
23
- D_ASSERT(!internal);
24
- auto &scalar_function = function->Cast<ScalarMacroFunction>();
25
- FieldWriter writer(main_serializer);
26
- writer.WriteString(schema.name);
27
- writer.WriteString(name);
28
- writer.WriteSerializable(*scalar_function.expression);
29
- // writer.WriteSerializableList(function->parameters);
30
- writer.WriteSerializableList(function->parameters);
31
- writer.WriteField<uint32_t>((uint32_t)function->default_parameters.size());
32
- auto &serializer = writer.GetSerializer();
33
- for (auto &kv : function->default_parameters) {
34
- serializer.WriteString(kv.first);
35
- kv.second->Serialize(serializer);
36
- }
37
- writer.Finalize();
38
- }
39
-
40
- unique_ptr<CreateMacroInfo> ScalarMacroCatalogEntry::Deserialize(Deserializer &main_source, ClientContext &context) {
41
- auto info = make_uniq<CreateMacroInfo>(CatalogType::MACRO_ENTRY);
42
- FieldReader reader(main_source);
43
- info->schema = reader.ReadRequired<string>();
44
- info->name = reader.ReadRequired<string>();
45
- auto expression = reader.ReadRequiredSerializable<ParsedExpression>();
46
- auto func = make_uniq<ScalarMacroFunction>(std::move(expression));
47
- info->function = std::move(func);
48
- info->function->parameters = reader.ReadRequiredSerializableList<ParsedExpression>();
49
- auto default_param_count = reader.ReadRequired<uint32_t>();
50
- auto &source = reader.GetSource();
51
- for (idx_t i = 0; i < default_param_count; i++) {
52
- auto name = source.Read<string>();
53
- info->function->default_parameters[name] = ParsedExpression::Deserialize(source);
54
- }
55
- // dont like this
56
- // info->type=CatalogType::MACRO_ENTRY;
57
- reader.Finalize();
58
- return info;
59
- }
60
-
61
- TableMacroCatalogEntry::TableMacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info)
62
- : MacroCatalogEntry(catalog, schema, info) {
63
- }
64
-
65
- void TableMacroCatalogEntry::Serialize(Serializer &main_serializer) const {
66
- D_ASSERT(!internal);
67
- FieldWriter writer(main_serializer);
68
-
69
- auto &table_function = function->Cast<TableMacroFunction>();
70
- writer.WriteString(schema.name);
71
- writer.WriteString(name);
72
- writer.WriteSerializable(*table_function.query_node);
73
- writer.WriteSerializableList(function->parameters);
74
- writer.WriteField<uint32_t>((uint32_t)function->default_parameters.size());
75
- auto &serializer = writer.GetSerializer();
76
- for (auto &kv : function->default_parameters) {
77
- serializer.WriteString(kv.first);
78
- kv.second->Serialize(serializer);
79
- }
80
- writer.Finalize();
81
- }
82
-
83
- unique_ptr<CreateMacroInfo> TableMacroCatalogEntry::Deserialize(Deserializer &main_source, ClientContext &context) {
84
- auto info = make_uniq<CreateMacroInfo>(CatalogType::TABLE_MACRO_ENTRY);
85
- FieldReader reader(main_source);
86
- info->schema = reader.ReadRequired<string>();
87
- info->name = reader.ReadRequired<string>();
88
- auto query_node = reader.ReadRequiredSerializable<QueryNode>();
89
- auto table_function = make_uniq<TableMacroFunction>(std::move(query_node));
90
- info->function = std::move(table_function);
91
- info->function->parameters = reader.ReadRequiredSerializableList<ParsedExpression>();
92
- auto default_param_count = reader.ReadRequired<uint32_t>();
93
- auto &source = reader.GetSource();
94
- for (idx_t i = 0; i < default_param_count; i++) {
95
- auto name = source.Read<string>();
96
- info->function->default_parameters[name] = ParsedExpression::Deserialize(source);
97
- }
98
-
99
- reader.Finalize();
100
-
101
- return info;
102
- }
103
-
104
- } // namespace duckdb