duckdb 0.8.1-dev96.0 → 0.8.2-dev1.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 +8 -8
- package/package.json +3 -1
- package/src/duckdb/extension/icu/icu-datepart.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +1 -1
- package/src/duckdb/extension/icu/icu-makedate.cpp +5 -4
- package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.cpp +0 -2
- package/src/duckdb/extension/json/buffered_json_reader.cpp +23 -14
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +6 -6
- package/src/duckdb/extension/json/include/json_common.hpp +12 -2
- package/src/duckdb/extension/json/include/json_scan.hpp +5 -2
- package/src/duckdb/extension/json/json_functions/json_contains.cpp +5 -0
- package/src/duckdb/extension/json/json_functions/json_create.cpp +10 -10
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +5 -3
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +11 -11
- package/src/duckdb/extension/json/json_functions/read_json.cpp +2 -1
- package/src/duckdb/extension/json/json_functions.cpp +6 -3
- package/src/duckdb/extension/json/json_scan.cpp +43 -27
- package/src/duckdb/extension/parquet/column_reader.cpp +5 -1
- package/src/duckdb/extension/parquet/include/decode_utils.hpp +6 -0
- package/src/duckdb/extension/parquet/parquet-extension.cpp +26 -1
- package/src/duckdb/src/catalog/catalog.cpp +5 -17
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +7 -1
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +121 -0
- package/src/duckdb/src/catalog/catalog_search_path.cpp +49 -12
- package/src/duckdb/src/catalog/default/default_types.cpp +9 -84
- package/src/duckdb/src/common/adbc/adbc.cpp +118 -12
- package/src/duckdb/src/common/adbc/driver_manager.cpp +0 -20
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +11 -12
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +4 -3
- package/src/duckdb/src/common/exception.cpp +4 -1
- package/src/duckdb/src/common/exception_format_value.cpp +24 -15
- package/src/duckdb/src/common/multi_file_reader.cpp +3 -0
- package/src/duckdb/src/common/random_engine.cpp +1 -1
- package/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +5 -4
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +44 -7
- package/src/duckdb/src/common/types/time.cpp +2 -8
- package/src/duckdb/src/common/types/timestamp.cpp +37 -1
- package/src/duckdb/src/common/types/value.cpp +1 -0
- package/src/duckdb/src/common/types.cpp +4 -0
- package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +30 -33
- package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +0 -4
- package/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp +30 -33
- package/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp +52 -65
- package/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp +48 -48
- package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +39 -40
- package/src/duckdb/src/core_functions/aggregate/distributive/bool.cpp +32 -32
- package/src/duckdb/src/core_functions/aggregate/distributive/entropy.cpp +34 -34
- package/src/duckdb/src/core_functions/aggregate/distributive/kurtosis.cpp +30 -31
- package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +88 -100
- package/src/duckdb/src/core_functions/aggregate/distributive/product.cpp +17 -17
- package/src/duckdb/src/core_functions/aggregate/distributive/skew.cpp +25 -27
- package/src/duckdb/src/core_functions/aggregate/distributive/string_agg.cpp +37 -38
- package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +22 -22
- package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +44 -80
- package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +49 -51
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +104 -122
- package/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +57 -93
- package/src/duckdb/src/core_functions/aggregate/nested/histogram.cpp +22 -23
- package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +18 -19
- package/src/duckdb/src/core_functions/aggregate/regression/regr_avg.cpp +16 -18
- package/src/duckdb/src/core_functions/aggregate/regression/regr_intercept.cpp +22 -25
- package/src/duckdb/src/core_functions/aggregate/regression/regr_r2.cpp +19 -24
- package/src/duckdb/src/core_functions/aggregate/regression/regr_sxx_syy.cpp +18 -23
- package/src/duckdb/src/core_functions/aggregate/regression/regr_sxy.cpp +14 -18
- package/src/duckdb/src/core_functions/function_list.cpp +1 -0
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/date/make_date.cpp +3 -0
- package/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +14 -0
- package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +23 -6
- package/src/duckdb/src/core_functions/scalar/list/list_lambdas.cpp +1 -2
- package/src/duckdb/src/core_functions/scalar/map/map_concat.cpp +3 -0
- package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +3 -3
- package/src/duckdb/src/execution/index/art/art.cpp +80 -7
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +20 -1
- package/src/duckdb/src/execution/index/art/leaf.cpp +11 -11
- package/src/duckdb/src/execution/index/art/leaf_segment.cpp +10 -0
- package/src/duckdb/src/execution/index/art/node.cpp +48 -35
- package/src/duckdb/src/execution/index/art/node16.cpp +3 -0
- package/src/duckdb/src/execution/index/art/node256.cpp +1 -0
- package/src/duckdb/src/execution/index/art/node4.cpp +3 -0
- package/src/duckdb/src/execution/index/art/node48.cpp +2 -0
- package/src/duckdb/src/execution/index/art/prefix.cpp +2 -0
- package/src/duckdb/src/execution/join_hashtable.cpp +2 -0
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +26 -9
- package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +5 -2
- package/src/duckdb/src/execution/operator/helper/physical_set.cpp +5 -1
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +3 -6
- package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +1 -0
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +8 -3
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +0 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +29 -3
- package/src/duckdb/src/execution/reservoir_sample.cpp +18 -4
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +159 -21
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +67 -74
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +7 -7
- package/src/duckdb/src/function/cast/list_casts.cpp +2 -4
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +33 -23
- package/src/duckdb/src/function/scalar/list/list_extract.cpp +1 -1
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/regexp/regexp_util.cpp +6 -2
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +2 -2
- package/src/duckdb/src/function/table/arrow.cpp +2 -2
- package/src/duckdb/src/function/table/checkpoint.cpp +3 -0
- package/src/duckdb/src/function/table/read_csv.cpp +15 -17
- package/src/duckdb/src/function/table/repeat.cpp +3 -0
- package/src/duckdb/src/function/table/repeat_row.cpp +8 -1
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +4 -4
- package/src/duckdb/src/function/table/system/test_vector_types.cpp +81 -25
- package/src/duckdb/src/function/table/table_scan.cpp +2 -2
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +0 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +2 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +11 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +8 -2
- package/src/duckdb/src/include/duckdb/catalog/default/builtin_types/types.hpp +97 -0
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_converter.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_options.hpp +8 -1
- package/src/duckdb/src/include/duckdb/common/arrow/result_arrow_wrapper.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +16 -22
- package/src/duckdb/src/include/duckdb/common/exception.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/time.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +4 -14
- package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +92 -57
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/corr.hpp +20 -24
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/covar.hpp +36 -39
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/stddev.hpp +57 -53
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_count.hpp +8 -9
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_slope.hpp +16 -18
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +7 -8
- package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +9 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +2 -6
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +16 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +10 -4
- package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +13 -3
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +9 -30
- package/src/duckdb/src/include/duckdb/function/aggregate_state.hpp +95 -0
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +4 -2
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +3 -2
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +4 -1
- package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +5 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +142 -136
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +6 -0
- package/src/duckdb/src/include/duckdb/main/settings.hpp +19 -0
- package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +12 -3
- package/src/duckdb/src/include/duckdb/parser/parser.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +5 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +4 -0
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/byte_reader.hpp +4 -0
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +13 -13
- package/src/duckdb/src/include/duckdb/storage/index.hpp +4 -2
- package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +0 -6
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table_storage_info.hpp +0 -2
- package/src/duckdb/src/main/attached_database.cpp +8 -0
- package/src/duckdb/src/main/capi/arrow-c.cpp +4 -4
- package/src/duckdb/src/main/capi/config-c.cpp +2 -5
- package/src/duckdb/src/main/client_context.cpp +4 -3
- package/src/duckdb/src/main/config.cpp +2 -0
- package/src/duckdb/src/main/database.cpp +1 -0
- package/src/duckdb/src/main/database_manager.cpp +21 -0
- package/src/duckdb/src/main/query_result.cpp +6 -2
- package/src/duckdb/src/main/settings/settings.cpp +41 -6
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +27 -16
- package/src/duckdb/src/parallel/executor.cpp +38 -14
- package/src/duckdb/src/parallel/meta_pipeline.cpp +17 -3
- package/src/duckdb/src/parser/column_definition.cpp +5 -8
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +0 -3
- package/src/duckdb/src/parser/parser.cpp +95 -35
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +1 -0
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +3 -0
- package/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +0 -2
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +0 -3
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -0
- package/src/duckdb/src/parser/transformer.cpp +0 -2
- package/src/duckdb/src/planner/bind_context.cpp +3 -4
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +0 -2
- package/src/duckdb/src/planner/binder/expression/bind_positional_reference_expression.cpp +8 -3
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +31 -15
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +0 -27
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +18 -1
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +0 -25
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +2 -114
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +6 -1
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +5 -0
- package/src/duckdb/src/planner/bound_result_modifier.cpp +14 -0
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +6 -5
- package/src/duckdb/src/planner/expression/bound_default_expression.cpp +7 -1
- package/src/duckdb/src/planner/expression.cpp +3 -0
- package/src/duckdb/src/planner/expression_binder.cpp +3 -2
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +5 -4
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +14 -2
- package/src/duckdb/src/planner/planner.cpp +5 -15
- package/src/duckdb/src/storage/data_table.cpp +10 -8
- package/src/duckdb/src/storage/index.cpp +13 -0
- package/src/duckdb/src/storage/storage_manager.cpp +6 -0
- package/src/duckdb/src/storage/table/column_data.cpp +7 -3
- package/src/duckdb/src/storage/table/list_column_data.cpp +5 -4
- package/src/duckdb/src/storage/table/row_group.cpp +4 -3
- package/src/duckdb/src/storage/table/row_group_collection.cpp +6 -3
- package/src/duckdb/src/storage/table/standard_column_data.cpp +4 -3
- package/src/duckdb/src/storage/table/struct_column_data.cpp +4 -3
- package/src/duckdb/src/storage/wal_replay.cpp +4 -5
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +0 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +0 -14
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +12828 -12956
- package/src/duckdb/third_party/zstd/compress/zstd_compress.cpp +3 -0
- package/src/duckdb/third_party/zstd/include/zstd/compress/zstd_cwksp.h +4 -0
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +5 -5
- package/src/duckdb/ub_src_parser_transform_statement.cpp +0 -2
- package/test/extension.test.ts +11 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_database_info.hpp +0 -46
- 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 ¶meter);
|
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 ¶meter);
|
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
|
};
|
@@ -93,9 +93,9 @@ public:
|
|
93
93
|
|
94
94
|
unique_ptr<TableRef> Copy() override;
|
95
95
|
|
96
|
-
//! Serializes a blob into a
|
96
|
+
//! Serializes a blob into a PivotRef
|
97
97
|
void Serialize(FieldWriter &serializer) const override;
|
98
|
-
//! Deserializes a blob back into a
|
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
|
-
|
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
|
-
|
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
|
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
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
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
|
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
|
};
|
@@ -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->
|
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->
|
99
|
+
arrow_wrapper->options.time_zone = "UTC";
|
100
100
|
} else {
|
101
|
-
arrow_wrapper->
|
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
|
-
|
46
|
-
if (!config_option) {
|
47
|
-
return DuckDBError;
|
48
|
-
}
|
45
|
+
|
49
46
|
try {
|
50
47
|
auto db_config = (DBConfig *)config;
|
51
|
-
db_config->
|
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
|
-
|
1157
|
-
|
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() {
|