duckdb 0.8.1-dev96.0 → 0.8.1

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 (243) hide show
  1. package/binding.gyp +8 -8
  2. package/package.json +3 -1
  3. package/src/duckdb/extension/icu/icu-datepart.cpp +1 -1
  4. package/src/duckdb/extension/icu/icu-extension.cpp +1 -1
  5. package/src/duckdb/extension/icu/icu-makedate.cpp +5 -4
  6. package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
  7. package/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.cpp +0 -2
  8. package/src/duckdb/extension/json/buffered_json_reader.cpp +23 -14
  9. package/src/duckdb/extension/json/include/buffered_json_reader.hpp +6 -6
  10. package/src/duckdb/extension/json/include/json_common.hpp +12 -2
  11. package/src/duckdb/extension/json/include/json_scan.hpp +5 -2
  12. package/src/duckdb/extension/json/json_functions/json_contains.cpp +5 -0
  13. package/src/duckdb/extension/json/json_functions/json_create.cpp +10 -10
  14. package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
  15. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +2 -2
  16. package/src/duckdb/extension/json/json_functions/json_structure.cpp +5 -3
  17. package/src/duckdb/extension/json/json_functions/json_transform.cpp +11 -11
  18. package/src/duckdb/extension/json/json_functions/read_json.cpp +2 -1
  19. package/src/duckdb/extension/json/json_functions.cpp +6 -3
  20. package/src/duckdb/extension/json/json_scan.cpp +43 -27
  21. package/src/duckdb/extension/parquet/column_reader.cpp +5 -1
  22. package/src/duckdb/extension/parquet/include/decode_utils.hpp +6 -0
  23. package/src/duckdb/extension/parquet/parquet-extension.cpp +26 -1
  24. package/src/duckdb/src/catalog/catalog.cpp +5 -17
  25. package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +7 -1
  26. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +121 -0
  27. package/src/duckdb/src/catalog/catalog_search_path.cpp +49 -12
  28. package/src/duckdb/src/catalog/default/default_types.cpp +9 -84
  29. package/src/duckdb/src/common/adbc/adbc.cpp +118 -12
  30. package/src/duckdb/src/common/adbc/driver_manager.cpp +0 -20
  31. package/src/duckdb/src/common/arrow/arrow_converter.cpp +11 -12
  32. package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +4 -3
  33. package/src/duckdb/src/common/exception.cpp +4 -1
  34. package/src/duckdb/src/common/exception_format_value.cpp +24 -15
  35. package/src/duckdb/src/common/multi_file_reader.cpp +3 -0
  36. package/src/duckdb/src/common/random_engine.cpp +1 -1
  37. package/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +5 -4
  38. package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +44 -7
  39. package/src/duckdb/src/common/types/time.cpp +2 -8
  40. package/src/duckdb/src/common/types/timestamp.cpp +37 -1
  41. package/src/duckdb/src/common/types/value.cpp +1 -0
  42. package/src/duckdb/src/common/types.cpp +4 -0
  43. package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +30 -33
  44. package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +0 -4
  45. package/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp +30 -33
  46. package/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp +52 -65
  47. package/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp +48 -48
  48. package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +39 -40
  49. package/src/duckdb/src/core_functions/aggregate/distributive/bool.cpp +32 -32
  50. package/src/duckdb/src/core_functions/aggregate/distributive/entropy.cpp +34 -34
  51. package/src/duckdb/src/core_functions/aggregate/distributive/kurtosis.cpp +30 -31
  52. package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +88 -100
  53. package/src/duckdb/src/core_functions/aggregate/distributive/product.cpp +17 -17
  54. package/src/duckdb/src/core_functions/aggregate/distributive/skew.cpp +25 -27
  55. package/src/duckdb/src/core_functions/aggregate/distributive/string_agg.cpp +37 -38
  56. package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +22 -22
  57. package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +44 -80
  58. package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +49 -51
  59. package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +104 -122
  60. package/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +57 -93
  61. package/src/duckdb/src/core_functions/aggregate/nested/histogram.cpp +22 -23
  62. package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +18 -19
  63. package/src/duckdb/src/core_functions/aggregate/regression/regr_avg.cpp +16 -18
  64. package/src/duckdb/src/core_functions/aggregate/regression/regr_intercept.cpp +22 -25
  65. package/src/duckdb/src/core_functions/aggregate/regression/regr_r2.cpp +19 -24
  66. package/src/duckdb/src/core_functions/aggregate/regression/regr_sxx_syy.cpp +18 -23
  67. package/src/duckdb/src/core_functions/aggregate/regression/regr_sxy.cpp +14 -18
  68. package/src/duckdb/src/core_functions/function_list.cpp +1 -0
  69. package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +1 -1
  70. package/src/duckdb/src/core_functions/scalar/date/make_date.cpp +3 -0
  71. package/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +14 -0
  72. package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +1 -1
  73. package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +23 -6
  74. package/src/duckdb/src/core_functions/scalar/list/list_lambdas.cpp +1 -2
  75. package/src/duckdb/src/core_functions/scalar/map/map_concat.cpp +3 -0
  76. package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +3 -3
  77. package/src/duckdb/src/execution/index/art/art.cpp +80 -7
  78. package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +20 -1
  79. package/src/duckdb/src/execution/index/art/leaf.cpp +11 -11
  80. package/src/duckdb/src/execution/index/art/leaf_segment.cpp +10 -0
  81. package/src/duckdb/src/execution/index/art/node.cpp +48 -35
  82. package/src/duckdb/src/execution/index/art/node16.cpp +3 -0
  83. package/src/duckdb/src/execution/index/art/node256.cpp +1 -0
  84. package/src/duckdb/src/execution/index/art/node4.cpp +3 -0
  85. package/src/duckdb/src/execution/index/art/node48.cpp +2 -0
  86. package/src/duckdb/src/execution/index/art/prefix.cpp +2 -0
  87. package/src/duckdb/src/execution/join_hashtable.cpp +2 -0
  88. package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +26 -9
  89. package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +5 -2
  90. package/src/duckdb/src/execution/operator/helper/physical_set.cpp +5 -1
  91. package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +3 -6
  92. package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +1 -0
  93. package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +8 -3
  94. package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +0 -1
  95. package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +29 -3
  96. package/src/duckdb/src/execution/reservoir_sample.cpp +18 -4
  97. package/src/duckdb/src/function/aggregate/distributive/count.cpp +159 -21
  98. package/src/duckdb/src/function/aggregate/distributive/first.cpp +67 -74
  99. package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +7 -7
  100. package/src/duckdb/src/function/cast/list_casts.cpp +2 -4
  101. package/src/duckdb/src/function/pragma/pragma_queries.cpp +33 -23
  102. package/src/duckdb/src/function/scalar/list/list_extract.cpp +1 -1
  103. package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +1 -1
  104. package/src/duckdb/src/function/scalar/string/regexp/regexp_util.cpp +6 -2
  105. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +2 -2
  106. package/src/duckdb/src/function/table/arrow.cpp +2 -2
  107. package/src/duckdb/src/function/table/checkpoint.cpp +3 -0
  108. package/src/duckdb/src/function/table/read_csv.cpp +15 -17
  109. package/src/duckdb/src/function/table/repeat.cpp +3 -0
  110. package/src/duckdb/src/function/table/repeat_row.cpp +8 -1
  111. package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +4 -4
  112. package/src/duckdb/src/function/table/system/test_vector_types.cpp +81 -25
  113. package/src/duckdb/src/function/table/table_scan.cpp +2 -2
  114. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  115. package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +0 -3
  116. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +2 -0
  117. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +11 -1
  118. package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +8 -2
  119. package/src/duckdb/src/include/duckdb/catalog/default/builtin_types/types.hpp +97 -0
  120. package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +1 -1
  121. package/src/duckdb/src/include/duckdb/common/arrow/arrow_converter.hpp +2 -3
  122. package/src/duckdb/src/include/duckdb/common/arrow/arrow_options.hpp +8 -1
  123. package/src/duckdb/src/include/duckdb/common/arrow/result_arrow_wrapper.hpp +0 -1
  124. package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +16 -22
  125. package/src/duckdb/src/include/duckdb/common/exception.hpp +3 -0
  126. package/src/duckdb/src/include/duckdb/common/types/time.hpp +2 -0
  127. package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +4 -14
  128. package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +92 -57
  129. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/corr.hpp +20 -24
  130. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/covar.hpp +36 -39
  131. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/stddev.hpp +57 -53
  132. package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_count.hpp +8 -9
  133. package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_slope.hpp +16 -18
  134. package/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +7 -8
  135. package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +9 -0
  136. package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +2 -6
  137. package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +16 -36
  138. package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +10 -4
  139. package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +3 -0
  140. package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +1 -1
  141. package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +2 -0
  142. package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +13 -3
  143. package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +1 -0
  144. package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +9 -30
  145. package/src/duckdb/src/include/duckdb/function/aggregate_state.hpp +95 -0
  146. package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +4 -2
  147. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -1
  148. package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +2 -1
  149. package/src/duckdb/src/include/duckdb/function/table_function.hpp +3 -2
  150. package/src/duckdb/src/include/duckdb/main/attached_database.hpp +4 -1
  151. package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +3 -1
  152. package/src/duckdb/src/include/duckdb/main/config.hpp +5 -0
  153. package/src/duckdb/src/include/duckdb/main/database_manager.hpp +1 -0
  154. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +142 -136
  155. package/src/duckdb/src/include/duckdb/main/query_result.hpp +6 -0
  156. package/src/duckdb/src/include/duckdb/main/settings.hpp +19 -0
  157. package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +4 -0
  158. package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +12 -3
  159. package/src/duckdb/src/include/duckdb/parser/parser.hpp +2 -0
  160. package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +1 -1
  161. package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +2 -2
  162. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +0 -2
  163. package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +1 -1
  164. package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +3 -0
  165. package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +1 -1
  166. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +5 -0
  167. package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +6 -2
  168. package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +4 -0
  169. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +5 -1
  170. package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +5 -1
  171. package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +6 -2
  172. package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +4 -0
  173. package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/byte_reader.hpp +4 -0
  174. package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
  175. package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +13 -13
  176. package/src/duckdb/src/include/duckdb/storage/index.hpp +4 -2
  177. package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +0 -6
  178. package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +1 -1
  179. package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +2 -1
  180. package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -2
  181. package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +2 -1
  182. package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -1
  183. package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +2 -1
  184. package/src/duckdb/src/include/duckdb/storage/table_storage_info.hpp +0 -2
  185. package/src/duckdb/src/main/attached_database.cpp +8 -0
  186. package/src/duckdb/src/main/capi/arrow-c.cpp +4 -4
  187. package/src/duckdb/src/main/capi/config-c.cpp +2 -5
  188. package/src/duckdb/src/main/client_context.cpp +4 -3
  189. package/src/duckdb/src/main/config.cpp +2 -0
  190. package/src/duckdb/src/main/database.cpp +1 -0
  191. package/src/duckdb/src/main/database_manager.cpp +21 -0
  192. package/src/duckdb/src/main/query_result.cpp +6 -2
  193. package/src/duckdb/src/main/settings/settings.cpp +41 -6
  194. package/src/duckdb/src/optimizer/unnest_rewriter.cpp +27 -16
  195. package/src/duckdb/src/parallel/executor.cpp +38 -14
  196. package/src/duckdb/src/parallel/meta_pipeline.cpp +17 -3
  197. package/src/duckdb/src/parser/column_definition.cpp +5 -8
  198. package/src/duckdb/src/parser/parsed_data/create_info.cpp +0 -3
  199. package/src/duckdb/src/parser/parser.cpp +95 -35
  200. package/src/duckdb/src/parser/transform/expression/transform_function.cpp +1 -0
  201. package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +3 -0
  202. package/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +0 -2
  203. package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +0 -3
  204. package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -0
  205. package/src/duckdb/src/parser/transformer.cpp +0 -2
  206. package/src/duckdb/src/planner/bind_context.cpp +3 -4
  207. package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +0 -2
  208. package/src/duckdb/src/planner/binder/expression/bind_positional_reference_expression.cpp +8 -3
  209. package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +31 -15
  210. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +0 -27
  211. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +18 -1
  212. package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +0 -25
  213. package/src/duckdb/src/planner/binder/statement/bind_update.cpp +2 -114
  214. package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +6 -1
  215. package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +5 -0
  216. package/src/duckdb/src/planner/bound_result_modifier.cpp +14 -0
  217. package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +6 -5
  218. package/src/duckdb/src/planner/expression/bound_default_expression.cpp +7 -1
  219. package/src/duckdb/src/planner/expression.cpp +3 -0
  220. package/src/duckdb/src/planner/expression_binder.cpp +3 -2
  221. package/src/duckdb/src/planner/operator/logical_distinct.cpp +5 -4
  222. package/src/duckdb/src/planner/operator/logical_pivot.cpp +14 -2
  223. package/src/duckdb/src/planner/planner.cpp +5 -15
  224. package/src/duckdb/src/storage/data_table.cpp +10 -8
  225. package/src/duckdb/src/storage/index.cpp +13 -0
  226. package/src/duckdb/src/storage/storage_manager.cpp +6 -0
  227. package/src/duckdb/src/storage/table/column_data.cpp +7 -3
  228. package/src/duckdb/src/storage/table/list_column_data.cpp +5 -4
  229. package/src/duckdb/src/storage/table/row_group.cpp +4 -3
  230. package/src/duckdb/src/storage/table/row_group_collection.cpp +6 -3
  231. package/src/duckdb/src/storage/table/standard_column_data.cpp +4 -3
  232. package/src/duckdb/src/storage/table/struct_column_data.cpp +4 -3
  233. package/src/duckdb/src/storage/wal_replay.cpp +4 -5
  234. package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +0 -1
  235. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +0 -14
  236. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +12828 -12956
  237. package/src/duckdb/third_party/zstd/compress/zstd_compress.cpp +3 -0
  238. package/src/duckdb/third_party/zstd/include/zstd/compress/zstd_cwksp.h +4 -0
  239. package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +5 -5
  240. package/src/duckdb/ub_src_parser_transform_statement.cpp +0 -2
  241. package/test/extension.test.ts +11 -0
  242. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_database_info.hpp +0 -46
  243. package/src/duckdb/src/parser/transform/statement/transform_create_database.cpp +0 -27
@@ -12,6 +12,7 @@
12
12
  #include "duckdb/common/types/data_chunk.hpp"
13
13
  #include "duckdb/common/winapi.hpp"
14
14
  #include "duckdb/common/preserved_error.hpp"
15
+ #include "duckdb/common/arrow/arrow_options.hpp"
15
16
 
16
17
  namespace duckdb {
17
18
  struct BoxRendererConfig;
@@ -20,7 +21,11 @@ enum class QueryResultType : uint8_t { MATERIALIZED_RESULT, STREAM_RESULT, PENDI
20
21
 
21
22
  //! A set of properties from the client context that can be used to interpret the query result
22
23
  struct ClientProperties {
24
+ ClientProperties(string time_zone_p, ArrowOffsetSize arrow_offset_size_p)
25
+ : time_zone(std::move(time_zone_p)), arrow_offset_size(arrow_offset_size_p) {
26
+ }
23
27
  string time_zone;
28
+ ArrowOffsetSize arrow_offset_size;
24
29
  };
25
30
 
26
31
  class BaseQueryResult {
@@ -141,6 +146,7 @@ public:
141
146
  }
142
147
  }
143
148
 
149
+ static ArrowOptions GetArrowOptions(QueryResult &query_result);
144
150
  static string GetConfigTimezone(QueryResult &query_result);
145
151
 
146
152
  private:
@@ -309,6 +309,15 @@ struct LogQueryPathSetting {
309
309
  static Value GetSetting(ClientContext &context);
310
310
  };
311
311
 
312
+ struct LockConfigurationSetting {
313
+ static constexpr const char *Name = "lock_configuration";
314
+ static constexpr const char *Description = "Whether or not the configuration can be altered";
315
+ static constexpr const LogicalTypeId InputType = LogicalTypeId::BOOLEAN;
316
+ static void SetGlobal(DatabaseInstance *db, DBConfig &config, const Value &parameter);
317
+ static void ResetGlobal(DatabaseInstance *db, DBConfig &config);
318
+ static Value GetSetting(ClientContext &context);
319
+ };
320
+
312
321
  struct ImmediateTransactionModeSetting {
313
322
  static constexpr const char *Name = "immediate_transaction_mode";
314
323
  static constexpr const char *Description =
@@ -388,6 +397,16 @@ struct PreserveInsertionOrder {
388
397
  static Value GetSetting(ClientContext &context);
389
398
  };
390
399
 
400
+ struct ExportLargeBufferArrow {
401
+ static constexpr const char *Name = "arrow_large_buffer_size";
402
+ static constexpr const char *Description =
403
+ "If arrow buffers for strings, blobs, uuids and bits should be exported using large buffers";
404
+ static constexpr const LogicalTypeId InputType = LogicalTypeId::BOOLEAN;
405
+ static void SetGlobal(DatabaseInstance *db, DBConfig &config, const Value &parameter);
406
+ static void ResetGlobal(DatabaseInstance *db, DBConfig &config);
407
+ static Value GetSetting(ClientContext &context);
408
+ };
409
+
391
410
  struct ProfilerHistorySize {
392
411
  static constexpr const char *Name = "profiler_history_size";
393
412
  static constexpr const char *Description = "Sets the profiler history size";
@@ -45,6 +45,8 @@ public:
45
45
 
46
46
  //! Contains all bindings that need to be updated
47
47
  vector<ReplaceBinding> replace_bindings;
48
+ //! Stores the table index of the former child of the LOGICAL_UNNEST
49
+ idx_t overwritten_tbl_idx;
48
50
  };
49
51
 
50
52
  //! The UnnestRewriter optimizer traverses the logical operator tree and rewrites duplicate
@@ -79,6 +81,8 @@ private:
79
81
  vector<LHSBinding> lhs_bindings;
80
82
  //! Stores the table index of the former child of the LOGICAL_UNNEST
81
83
  idx_t overwritten_tbl_idx;
84
+ //! The number of distinct columns to unnest
85
+ idx_t distinct_unnest_count;
82
86
  };
83
87
 
84
88
  } // namespace duckdb
@@ -14,6 +14,13 @@ namespace duckdb {
14
14
 
15
15
  class PhysicalRecursiveCTE;
16
16
 
17
+ struct PipelineFinishGroup {
18
+ explicit PipelineFinishGroup(Pipeline *group_base_p) : group_base(group_base_p) {
19
+ }
20
+ Pipeline *group_base;
21
+ unordered_set<Pipeline *> group_members;
22
+ };
23
+
17
24
  //! MetaPipeline represents a set of pipelines that all have the same sink
18
25
  class MetaPipeline : public std::enable_shared_from_this<MetaPipeline> {
19
26
  //! We follow these rules when building:
@@ -57,7 +64,9 @@ public:
57
64
  //! Make sure that the given pipeline has its own PipelineFinishEvent (e.g., for IEJoin - double Finalize)
58
65
  void AddFinishEvent(Pipeline *pipeline);
59
66
  //! Whether the pipeline needs its own PipelineFinishEvent
60
- bool HasFinishEvent(Pipeline *pipeline);
67
+ bool HasFinishEvent(Pipeline *pipeline) const;
68
+ //! Whether this pipeline is part of a PipelineFinishEvent
69
+ optional_ptr<Pipeline> GetFinishGroup(Pipeline *pipeline) const;
61
70
 
62
71
  public:
63
72
  //! Build the MetaPipeline with 'op' as the first operator (excl. the shared sink)
@@ -86,8 +95,6 @@ private:
86
95
  bool recursive_cte;
87
96
  //! All pipelines with a different source, but the same sink
88
97
  vector<shared_ptr<Pipeline>> pipelines;
89
- //! The pipelines that must finish before the MetaPipeline is finished
90
- vector<Pipeline *> final_pipelines;
91
98
  //! Dependencies within this MetaPipeline
92
99
  unordered_map<Pipeline *, vector<Pipeline *>> dependencies;
93
100
  //! Other MetaPipelines that this MetaPipeline depends on
@@ -96,6 +103,8 @@ private:
96
103
  idx_t next_batch_index;
97
104
  //! Pipelines (other than the base pipeline) that need their own PipelineFinishEvent (e.g., for IEJoin)
98
105
  unordered_set<Pipeline *> finish_pipelines;
106
+ //! Mapping from pipeline (e.g., child or union) to finish pipeline
107
+ unordered_map<Pipeline *, Pipeline *> finish_map;
99
108
  };
100
109
 
101
110
  } // namespace duckdb
@@ -62,6 +62,8 @@ public:
62
62
  //! Parses a column list (i.e. as found in a CREATE TABLE statement)
63
63
  static ColumnList ParseColumnList(const string &column_list, ParserOptions options = ParserOptions());
64
64
 
65
+ static bool StripUnicodeSpaces(const string &query_str, string &new_query);
66
+
65
67
  private:
66
68
  ParserOptions options;
67
69
  };
@@ -11,7 +11,7 @@
11
11
  #include "duckdb/parser/tableref.hpp"
12
12
 
13
13
  namespace duckdb {
14
- //! Represents a cross product
14
+
15
15
  class EmptyTableRef : public TableRef {
16
16
  public:
17
17
  static constexpr const TableReferenceType TYPE = TableReferenceType::EMPTY;
@@ -93,9 +93,9 @@ public:
93
93
 
94
94
  unique_ptr<TableRef> Copy() override;
95
95
 
96
- //! Serializes a blob into a JoinRef
96
+ //! Serializes a blob into a PivotRef
97
97
  void Serialize(FieldWriter &serializer) const override;
98
- //! Deserializes a blob back into a JoinRef
98
+ //! Deserializes a blob back into a PivotRef
99
99
  static unique_ptr<TableRef> Deserialize(FieldReader &source);
100
100
 
101
101
  void FormatSerialize(FormatSerializer &serializer) const override;
@@ -127,8 +127,6 @@ private:
127
127
  unique_ptr<CreateStatement> TransformCreateFunction(duckdb_libpgquery::PGCreateFunctionStmt &stmt);
128
128
  //! Transform a Postgres duckdb_libpgquery::T_PGCreateTypeStmt node into CreateStatement
129
129
  unique_ptr<CreateStatement> TransformCreateType(duckdb_libpgquery::PGCreateTypeStmt &stmt);
130
- //! Transform a Postgres duckdb_libpgquery::T_PGCreateDatabaseStmt node into a CreateStatement
131
- unique_ptr<CreateStatement> TransformCreateDatabase(duckdb_libpgquery::PGCreateDatabaseStmt &stmt);
132
130
  //! Transform a Postgres duckdb_libpgquery::T_PGAlterSeqStmt node into CreateStatement
133
131
  unique_ptr<AlterStatement> TransformAlterSequence(duckdb_libpgquery::PGAlterSeqStmt &stmt);
134
132
  //! Transform a Postgres duckdb_libpgquery::T_PGDropStmt node into a Drop[Table,Schema]Statement
@@ -56,7 +56,7 @@ public:
56
56
  //! or throws an exception if the column could not be bound.
57
57
  BindResult BindColumn(ColumnRefExpression &colref, idx_t depth);
58
58
  string BindColumn(PositionalReferenceExpression &ref, string &table_name, string &column_name);
59
- BindResult BindColumn(PositionalReferenceExpression &ref, idx_t depth);
59
+ unique_ptr<ColumnRefExpression> PositionToColumn(PositionalReferenceExpression &ref);
60
60
 
61
61
  unique_ptr<ParsedExpression> ExpandGeneratedColumn(const string &table_name, const string &column_name);
62
62
 
@@ -95,6 +95,9 @@ public:
95
95
  unique_ptr<BoundOrderModifier> Copy() const;
96
96
  static bool Equals(const BoundOrderModifier &left, const BoundOrderModifier &right);
97
97
  static bool Equals(const unique_ptr<BoundOrderModifier> &left, const unique_ptr<BoundOrderModifier> &right);
98
+
99
+ void Serialize(Serializer &serializer) const;
100
+ static unique_ptr<BoundOrderModifier> Deserialize(Deserializer &source, PlanDeserializationState &state);
98
101
  };
99
102
 
100
103
  enum class DistinctType : uint8_t { DISTINCT = 0, DISTINCT_ON = 1 };
@@ -124,8 +124,8 @@ protected:
124
124
  const LogicalType &list_child_type);
125
125
  BindResult BindExpression(OperatorExpression &expr, idx_t depth);
126
126
  BindResult BindExpression(ParameterExpression &expr, idx_t depth);
127
- BindResult BindExpression(PositionalReferenceExpression &ref, idx_t depth);
128
127
  BindResult BindExpression(SubqueryExpression &expr, idx_t depth);
128
+ BindResult BindPositionalReference(unique_ptr<ParsedExpression> &expr, idx_t depth, bool root_expression);
129
129
 
130
130
  void TransformCapturedLambdaColumn(unique_ptr<Expression> &original, unique_ptr<Expression> &replacement,
131
131
  vector<unique_ptr<Expression>> &captures, LogicalType &list_child_type);
@@ -83,6 +83,11 @@ public:
83
83
  return true;
84
84
  }
85
85
 
86
+ //! Allows LogicalOperators to opt out of serialization
87
+ virtual bool SupportSerialization() const {
88
+ return true;
89
+ };
90
+
86
91
  //! Returns the set of table indexes of this operator
87
92
  virtual vector<idx_t> GetTableIndex() const;
88
93
 
@@ -8,10 +8,10 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/planner/logical_operator.hpp"
12
- #include "duckdb/function/copy_function.hpp"
13
11
  #include "duckdb/common/filename_pattern.hpp"
14
12
  #include "duckdb/common/local_file_system.hpp"
13
+ #include "duckdb/function/copy_function.hpp"
14
+ #include "duckdb/planner/logical_operator.hpp"
15
15
 
16
16
  namespace duckdb {
17
17
 
@@ -41,6 +41,10 @@ public:
41
41
  void Serialize(FieldWriter &writer) const override;
42
42
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
43
43
  idx_t EstimateCardinality(ClientContext &context) override;
44
+ //! Skips the serialization check in VerifyPlan
45
+ bool SupportSerialization() const override {
46
+ return false;
47
+ }
44
48
 
45
49
  protected:
46
50
  void ResolveTypes() override {
@@ -29,6 +29,10 @@ public:
29
29
  public:
30
30
  void Serialize(FieldWriter &writer) const override;
31
31
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
32
+ //! Skips the serialization check in VerifyPlan
33
+ bool SupportSerialization() const override {
34
+ return false;
35
+ }
32
36
 
33
37
  protected:
34
38
  void ResolveTypes() override {
@@ -8,8 +8,8 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/planner/logical_operator.hpp"
12
11
  #include "duckdb/parser/statement/explain_statement.hpp"
12
+ #include "duckdb/planner/logical_operator.hpp"
13
13
 
14
14
  namespace duckdb {
15
15
 
@@ -37,6 +37,10 @@ public:
37
37
  idx_t EstimateCardinality(ClientContext &context) override {
38
38
  return 3;
39
39
  }
40
+ //! Skips the serialization check in VerifyPlan
41
+ bool SupportSerialization() const override {
42
+ return false;
43
+ }
40
44
 
41
45
  protected:
42
46
  void ResolveTypes() override {
@@ -8,8 +8,8 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/planner/logical_operator.hpp"
12
11
  #include "duckdb/function/table_function.hpp"
12
+ #include "duckdb/planner/logical_operator.hpp"
13
13
  #include "duckdb/planner/table_filter.hpp"
14
14
 
15
15
  namespace duckdb {
@@ -62,6 +62,10 @@ public:
62
62
  void Serialize(FieldWriter &writer) const override;
63
63
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
64
64
  vector<idx_t> GetTableIndex() const override;
65
+ //! Skips the serialization check in VerifyPlan
66
+ bool SupportSerialization() const override {
67
+ return function.verify_serialization;
68
+ };
65
69
 
66
70
  protected:
67
71
  void ResolveTypes() override;
@@ -8,9 +8,9 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/planner/logical_operator.hpp"
12
- #include "duckdb/parser/parsed_data/pragma_info.hpp"
13
11
  #include "duckdb/function/pragma_function.hpp"
12
+ #include "duckdb/parser/parsed_data/pragma_info.hpp"
13
+ #include "duckdb/planner/logical_operator.hpp"
14
14
 
15
15
  namespace duckdb {
16
16
 
@@ -34,6 +34,10 @@ public:
34
34
  void Serialize(FieldWriter &writer) const override;
35
35
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
36
36
  idx_t EstimateCardinality(ClientContext &context) override;
37
+ //! Skips the serialization check in VerifyPlan
38
+ bool SupportSerialization() const override {
39
+ return false;
40
+ }
37
41
 
38
42
  protected:
39
43
  void ResolveTypes() override {
@@ -36,6 +36,10 @@ public:
36
36
  void Serialize(FieldWriter &writer) const override;
37
37
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
38
38
  idx_t EstimateCardinality(ClientContext &context) override;
39
+ //! Skips the serialization check in VerifyPlan
40
+ bool SupportSerialization() const override {
41
+ return false;
42
+ }
39
43
 
40
44
  protected:
41
45
  void ResolveTypes() override {
@@ -45,6 +45,7 @@ public:
45
45
  inline T ReadValue(uint8_t bytes, uint8_t trailing_zero) {
46
46
  T result = 0;
47
47
  switch (bytes) {
48
+ // LCOV_EXCL_START
48
49
  case 1:
49
50
  result = Load<uint8_t>(buffer + index);
50
51
  index++;
@@ -73,6 +74,7 @@ public:
73
74
  memcpy(&result, (void *)(buffer + index), 7);
74
75
  index += 7;
75
76
  return result;
77
+ // LCOV_EXCL_STOP
76
78
  default:
77
79
  if (trailing_zero < 8) {
78
80
  result = Load<T>(buffer + index);
@@ -93,6 +95,7 @@ inline uint32_t ByteReader::ReadValue(uint8_t bytes, uint8_t trailing_zero) {
93
95
  uint32_t result = 0;
94
96
  switch (bytes) {
95
97
  case 0:
98
+ // LCOV_EXCL_START
96
99
  if (trailing_zero < 8) {
97
100
  result = Load<uint32_t>(buffer + index);
98
101
  index += sizeof(uint32_t);
@@ -115,6 +118,7 @@ inline uint32_t ByteReader::ReadValue(uint8_t bytes, uint8_t trailing_zero) {
115
118
  result = Load<uint32_t>(buffer + index);
116
119
  index += 4;
117
120
  return result;
121
+ // LCOV_EXCL_STOP
118
122
  default:
119
123
  throw InternalException("Write of %llu bytes attempted into address pointing to 4 byte value", bytes);
120
124
  }
@@ -181,7 +181,7 @@ public:
181
181
 
182
182
  idx_t GetTotalRows();
183
183
 
184
- void GetStorageInfo(TableStorageInfo &result);
184
+ vector<ColumnSegmentInfo> GetColumnSegmentInfo();
185
185
  static bool IsForeignKeyIndex(const vector<PhysicalIndex> &fk_keys, Index &index, ForeignKeyType fk_type);
186
186
 
187
187
  //! Initializes a special scan that is used to create an index on the table, it keeps locks on the table
@@ -21,43 +21,43 @@ public:
21
21
 
22
22
  // LCOV_EXCL_START
23
23
  unique_ptr<Block> ConvertBlock(block_id_t block_id, FileBuffer &source_buffer) override {
24
- throw InternalException("Cannot perform IO in in-memory database!");
24
+ throw InternalException("Cannot perform IO in in-memory database - ConvertBlock!");
25
25
  }
26
26
  unique_ptr<Block> CreateBlock(block_id_t block_id, FileBuffer *source_buffer) override {
27
- throw InternalException("Cannot perform IO in in-memory database!");
27
+ throw InternalException("Cannot perform IO in in-memory database - CreateBlock!");
28
28
  }
29
29
  block_id_t GetFreeBlockId() override {
30
- throw InternalException("Cannot perform IO in in-memory database!");
30
+ throw InternalException("Cannot perform IO in in-memory database - GetFreeBlockId!");
31
31
  }
32
32
  bool IsRootBlock(block_id_t root) override {
33
- throw InternalException("Cannot perform IO in in-memory database!");
33
+ throw InternalException("Cannot perform IO in in-memory database - IsRootBlock!");
34
34
  }
35
35
  void MarkBlockAsFree(block_id_t block_id) override {
36
- throw InternalException("Cannot perform IO in in-memory database!");
36
+ throw InternalException("Cannot perform IO in in-memory database - MarkBlockAsFree!");
37
37
  }
38
38
  void MarkBlockAsModified(block_id_t block_id) override {
39
- throw InternalException("Cannot perform IO in in-memory database!");
39
+ throw InternalException("Cannot perform IO in in-memory database - MarkBlockAsModified!");
40
40
  }
41
41
  void IncreaseBlockReferenceCount(block_id_t block_id) override {
42
- throw InternalException("Cannot perform IO in in-memory database!");
42
+ throw InternalException("Cannot perform IO in in-memory database - IncreaseBlockReferenceCount!");
43
43
  }
44
44
  block_id_t GetMetaBlock() override {
45
- throw InternalException("Cannot perform IO in in-memory database!");
45
+ throw InternalException("Cannot perform IO in in-memory database - GetMetaBlock!");
46
46
  }
47
47
  void Read(Block &block) override {
48
- throw InternalException("Cannot perform IO in in-memory database!");
48
+ throw InternalException("Cannot perform IO in in-memory database - Read!");
49
49
  }
50
50
  void Write(FileBuffer &block, block_id_t block_id) override {
51
- throw InternalException("Cannot perform IO in in-memory database!");
51
+ throw InternalException("Cannot perform IO in in-memory database - Write!");
52
52
  }
53
53
  void WriteHeader(DatabaseHeader header) override {
54
- throw InternalException("Cannot perform IO in in-memory database!");
54
+ throw InternalException("Cannot perform IO in in-memory database - WriteHeader!");
55
55
  }
56
56
  idx_t TotalBlocks() override {
57
- throw InternalException("Cannot perform IO in in-memory database!");
57
+ throw InternalException("Cannot perform IO in in-memory database - TotalBlocks!");
58
58
  }
59
59
  idx_t FreeBlocks() override {
60
- throw InternalException("Cannot perform IO in in-memory database!");
60
+ throw InternalException("Cannot perform IO in in-memory database - FreeBlocks!");
61
61
  }
62
62
  // LCOV_EXCL_STOP
63
63
  };
@@ -104,8 +104,10 @@ public:
104
104
  //! Obtains a lock and calls Vacuum while holding that lock
105
105
  void Vacuum();
106
106
 
107
- //! Returns the string representation of an index
108
- virtual string ToString() = 0;
107
+ //! Returns the string representation of an index, or only traverses and verifies the index
108
+ virtual string VerifyAndToString(IndexLock &state, const bool only_verify) = 0;
109
+ //! Obtains a lock and calls VerifyAndToString while holding that lock
110
+ string VerifyAndToString(const bool only_verify);
109
111
 
110
112
  //! Returns true if the index is affected by updates on the specified column IDs, and false otherwise
111
113
  bool IndexIsUpdated(const vector<PhysicalIndex> &column_ids) const;
@@ -28,17 +28,11 @@ typedef unique_ptr<Catalog> (*attach_function_t)(StorageExtensionInfo *storage_i
28
28
  const string &name, AttachInfo &info, AccessMode access_mode);
29
29
  typedef unique_ptr<TransactionManager> (*create_transaction_manager_t)(StorageExtensionInfo *storage_info,
30
30
  AttachedDatabase &db, Catalog &catalog);
31
- typedef unique_ptr<TableFunctionRef> (*create_database_t)(StorageExtensionInfo *info, ClientContext &context,
32
- const string &database_name, const string &source_path);
33
- typedef unique_ptr<TableFunctionRef> (*drop_database_t)(StorageExtensionInfo *storage_info, ClientContext &context,
34
- const string &database_name);
35
31
 
36
32
  class StorageExtension {
37
33
  public:
38
34
  attach_function_t attach;
39
35
  create_transaction_manager_t create_transaction_manager;
40
- create_database_t create_database;
41
- drop_database_t drop_database;
42
36
 
43
37
  //! Additional info passed to the various storage functions
44
38
  shared_ptr<StorageExtensionInfo> storage_info;
@@ -130,7 +130,7 @@ public:
130
130
  idx_t start_row, Deserializer &source, const LogicalType &type,
131
131
  optional_ptr<ColumnData> parent);
132
132
 
133
- virtual void GetStorageInfo(idx_t row_group_index, vector<idx_t> col_path, TableStorageInfo &result);
133
+ virtual void GetColumnSegmentInfo(idx_t row_group_index, vector<idx_t> col_path, vector<ColumnSegmentInfo> &result);
134
134
  virtual void Verify(RowGroup &parent);
135
135
 
136
136
  bool CheckZonemap(TableFilter &filter);
@@ -58,7 +58,8 @@ public:
58
58
 
59
59
  void DeserializeColumn(Deserializer &source) override;
60
60
 
61
- void GetStorageInfo(idx_t row_group_index, vector<idx_t> col_path, TableStorageInfo &result) override;
61
+ void GetColumnSegmentInfo(duckdb::idx_t row_group_index, vector<duckdb::idx_t> col_path,
62
+ vector<duckdb::ColumnSegmentInfo> &result) override;
62
63
 
63
64
  private:
64
65
  uint64_t FetchListOffset(idx_t row_idx);
@@ -31,7 +31,7 @@ class RowGroupCollection;
31
31
  class RowGroupWriter;
32
32
  class UpdateSegment;
33
33
  class TableStatistics;
34
- class TableStorageInfo;
34
+ struct ColumnSegmentInfo;
35
35
  class Vector;
36
36
  struct ColumnCheckpointState;
37
37
  struct RowGroupPointer;
@@ -141,7 +141,7 @@ public:
141
141
  void MergeIntoStatistics(idx_t column_idx, BaseStatistics &other);
142
142
  unique_ptr<BaseStatistics> GetStatistics(idx_t column_idx);
143
143
 
144
- void GetStorageInfo(idx_t row_group_index, TableStorageInfo &result);
144
+ void GetColumnSegmentInfo(idx_t row_group_index, vector<ColumnSegmentInfo> &result);
145
145
 
146
146
  void Verify();
147
147
 
@@ -26,6 +26,7 @@ struct TableAppendState;
26
26
  class DuckTransaction;
27
27
  class BoundConstraint;
28
28
  class RowGroupSegmentTree;
29
+ struct ColumnSegmentInfo;
29
30
 
30
31
  class RowGroupCollection {
31
32
  public:
@@ -88,7 +89,7 @@ public:
88
89
  void CommitDropColumn(idx_t index);
89
90
  void CommitDropTable();
90
91
 
91
- void GetStorageInfo(TableStorageInfo &result);
92
+ vector<ColumnSegmentInfo> GetColumnSegmentInfo();
92
93
  const vector<LogicalType> &GetTypes() const;
93
94
 
94
95
  shared_ptr<RowGroupCollection> AddColumn(ClientContext &context, ColumnDefinition &new_column,
@@ -56,7 +56,8 @@ public:
56
56
 
57
57
  void DeserializeColumn(Deserializer &source) override;
58
58
 
59
- void GetStorageInfo(idx_t row_group_index, vector<idx_t> col_path, TableStorageInfo &result) override;
59
+ void GetColumnSegmentInfo(duckdb::idx_t row_group_index, vector<duckdb::idx_t> col_path,
60
+ vector<duckdb::ColumnSegmentInfo> &result) override;
60
61
 
61
62
  void Verify(RowGroup &parent) override;
62
63
  };
@@ -59,7 +59,8 @@ public:
59
59
 
60
60
  void DeserializeColumn(Deserializer &source) override;
61
61
 
62
- void GetStorageInfo(idx_t row_group_index, vector<idx_t> col_path, TableStorageInfo &result) override;
62
+ void GetColumnSegmentInfo(duckdb::idx_t row_group_index, vector<duckdb::idx_t> col_path,
63
+ vector<duckdb::ColumnSegmentInfo> &result) override;
63
64
 
64
65
  void Verify(RowGroup &parent) override;
65
66
  };
@@ -43,8 +43,6 @@ public:
43
43
  idx_t cardinality = DConstants::INVALID_INDEX;
44
44
  //! Info of the indexes of a table
45
45
  vector<IndexInfo> index_info;
46
- //! Info of the column segments of the table
47
- vector<ColumnSegmentInfo> column_segments;
48
46
  };
49
47
 
50
48
  } // namespace duckdb
@@ -124,4 +124,12 @@ Catalog &AttachedDatabase::ParentCatalog() {
124
124
  return *parent_catalog;
125
125
  }
126
126
 
127
+ bool AttachedDatabase::IsInitialDatabase() const {
128
+ return is_initial_database;
129
+ }
130
+
131
+ void AttachedDatabase::SetInitialDatabase() {
132
+ is_initial_database = true;
133
+ }
134
+
127
135
  } // namespace duckdb
@@ -25,7 +25,7 @@ duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema
25
25
  }
26
26
  auto wrapper = reinterpret_cast<ArrowResultWrapper *>(result);
27
27
  ArrowConverter::ToArrowSchema((ArrowSchema *)*out_schema, wrapper->result->types, wrapper->result->names,
28
- wrapper->timezone_config);
28
+ wrapper->options);
29
29
  return DuckDBSuccess;
30
30
  }
31
31
 
@@ -41,7 +41,7 @@ duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *o
41
41
  if (!wrapper->current_chunk || wrapper->current_chunk->size() == 0) {
42
42
  return DuckDBSuccess;
43
43
  }
44
- ArrowConverter::ToArrowArray(*wrapper->current_chunk, reinterpret_cast<ArrowArray *>(*out_array));
44
+ ArrowConverter::ToArrowArray(*wrapper->current_chunk, reinterpret_cast<ArrowArray *>(*out_array), wrapper->options);
45
45
  return DuckDBSuccess;
46
46
  }
47
47
 
@@ -96,9 +96,9 @@ duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement prepared_st
96
96
  auto arrow_wrapper = new ArrowResultWrapper();
97
97
  if (wrapper->statement->context->config.set_variables.find("TimeZone") ==
98
98
  wrapper->statement->context->config.set_variables.end()) {
99
- arrow_wrapper->timezone_config = "UTC";
99
+ arrow_wrapper->options.time_zone = "UTC";
100
100
  } else {
101
- arrow_wrapper->timezone_config =
101
+ arrow_wrapper->options.time_zone =
102
102
  wrapper->statement->context->config.set_variables["TimeZone"].GetValue<std::string>();
103
103
  }
104
104
 
@@ -42,13 +42,10 @@ duckdb_state duckdb_set_config(duckdb_config config, const char *name, const cha
42
42
  if (!config || !name || !option) {
43
43
  return DuckDBError;
44
44
  }
45
- auto config_option = DBConfig::GetOptionByName(name);
46
- if (!config_option) {
47
- return DuckDBError;
48
- }
45
+
49
46
  try {
50
47
  auto db_config = (DBConfig *)config;
51
- db_config->SetOption(*config_option, Value(option));
48
+ db_config->SetOptionByName(name, Value(option));
52
49
  } catch (...) {
53
50
  return DuckDBError;
54
51
  }
@@ -319,6 +319,8 @@ shared_ptr<PreparedStatementData> ClientContext::CreatePreparedStatement(ClientC
319
319
  planner.parameter_data.emplace_back(value);
320
320
  }
321
321
  }
322
+
323
+ client_data->http_state = make_shared<HTTPState>();
322
324
  planner.CreatePlan(std::move(statement));
323
325
  D_ASSERT(planner.plan || !planner.properties.bound_all_parameters);
324
326
  profiler.EndPhase();
@@ -1153,9 +1155,8 @@ ParserOptions ClientContext::GetParserOptions() const {
1153
1155
  }
1154
1156
 
1155
1157
  ClientProperties ClientContext::GetClientProperties() const {
1156
- ClientProperties properties;
1157
- properties.time_zone = ClientConfig::GetConfig(*this).ExtractTimezone();
1158
- return properties;
1158
+ auto client_context = ClientConfig::GetConfig(*this);
1159
+ return {client_context.ExtractTimezone(), db->config.options.arrow_offset_size};
1159
1160
  }
1160
1161
 
1161
1162
  bool ClientContext::ExecutionIsFinished() {