duckdb 0.7.2-dev321.0 → 0.7.2-dev3294.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 +36 -19
- package/lib/duckdb.d.ts +55 -2
- package/lib/duckdb.js +20 -1
- package/package.json +2 -2
- package/src/connection.cpp +14 -15
- package/src/data_chunk.cpp +14 -2
- package/src/database.cpp +15 -16
- package/src/duckdb/extension/icu/icu-dateadd.cpp +5 -5
- package/src/duckdb/extension/icu/icu-datefunc.cpp +23 -11
- package/src/duckdb/extension/icu/icu-datepart.cpp +76 -22
- package/src/duckdb/extension/icu/icu-datesub.cpp +4 -4
- package/src/duckdb/extension/icu/icu-datetrunc.cpp +2 -2
- package/src/duckdb/extension/icu/icu-extension.cpp +37 -34
- package/src/duckdb/extension/icu/icu-list-range.cpp +207 -0
- package/src/duckdb/extension/icu/icu-makedate.cpp +54 -2
- package/src/duckdb/extension/icu/icu-strptime.cpp +138 -50
- package/src/duckdb/extension/icu/icu-table-range.cpp +12 -12
- package/src/duckdb/extension/icu/icu-timebucket.cpp +7 -7
- package/src/duckdb/extension/icu/icu-timezone.cpp +23 -22
- package/src/duckdb/extension/icu/include/icu-datefunc.hpp +10 -8
- package/src/duckdb/extension/icu/include/icu-list-range.hpp +17 -0
- package/src/duckdb/extension/icu/third_party/icu/common/unicode/localpointer.h +22 -22
- package/src/duckdb/extension/icu/third_party/icu/i18n/calendar.cpp +4 -0
- package/src/duckdb/extension/icu/third_party/icu/i18n/dangical.cpp +28 -28
- package/src/duckdb/extension/icu/third_party/icu/i18n/dangical.h +4 -4
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/numberformatter.h +1 -1
- package/src/duckdb/extension/icu/third_party/icu/stubdata/stubdata.cpp +1 -1
- package/src/duckdb/extension/json/buffered_json_reader.cpp +3 -3
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +5 -5
- package/src/duckdb/extension/json/include/json_common.hpp +2 -1
- package/src/duckdb/extension/json/include/json_deserializer.hpp +93 -0
- package/src/duckdb/extension/json/include/json_executors.hpp +2 -2
- package/src/duckdb/extension/json/include/json_functions.hpp +37 -32
- package/src/duckdb/extension/json/include/json_scan.hpp +10 -11
- package/src/duckdb/extension/json/include/json_serializer.hpp +89 -0
- package/src/duckdb/extension/json/include/json_structure.hpp +1 -1
- package/src/duckdb/extension/json/include/json_transform.hpp +1 -1
- package/src/duckdb/extension/json/json-extension.cpp +14 -18
- package/src/duckdb/extension/json/json_deserializer.cpp +306 -0
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +21 -21
- package/src/duckdb/extension/json/json_functions/json_array_length.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_contains.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_create.cpp +48 -47
- package/src/duckdb/extension/json/json_functions/json_extract.cpp +4 -6
- package/src/duckdb/extension/json/json_functions/json_keys.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +4 -4
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +277 -0
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +6 -6
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +11 -10
- package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_valid.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/read_json.cpp +30 -39
- package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +4 -4
- package/src/duckdb/extension/json/json_functions.cpp +41 -24
- package/src/duckdb/extension/json/json_scan.cpp +9 -32
- package/src/duckdb/extension/json/json_serializer.cpp +253 -0
- package/src/duckdb/extension/parquet/column_reader.cpp +158 -94
- package/src/duckdb/extension/parquet/column_writer.cpp +109 -108
- package/src/duckdb/extension/parquet/include/boolean_column_reader.hpp +5 -3
- package/src/duckdb/extension/parquet/include/callback_column_reader.hpp +3 -0
- package/src/duckdb/extension/parquet/include/cast_column_reader.hpp +7 -4
- package/src/duckdb/extension/parquet/include/column_reader.hpp +25 -8
- package/src/duckdb/extension/parquet/include/column_writer.hpp +7 -8
- package/src/duckdb/extension/parquet/include/decode_utils.hpp +5 -4
- package/src/duckdb/extension/parquet/include/list_column_reader.hpp +6 -4
- package/src/duckdb/extension/parquet/include/parquet_dbp_decoder.hpp +3 -3
- package/src/duckdb/extension/parquet/include/parquet_decimal_utils.hpp +3 -3
- package/src/duckdb/extension/parquet/include/parquet_file_metadata_cache.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_metadata.hpp +1 -0
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +27 -52
- package/src/duckdb/extension/parquet/include/parquet_statistics.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_support.hpp +10 -9
- package/src/duckdb/extension/parquet/include/parquet_timestamp.hpp +2 -1
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +10 -3
- package/src/duckdb/extension/parquet/include/row_number_column_reader.hpp +6 -3
- package/src/duckdb/extension/parquet/include/string_column_reader.hpp +4 -1
- package/src/duckdb/extension/parquet/include/struct_column_reader.hpp +7 -3
- package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +3 -0
- package/src/duckdb/extension/parquet/include/zstd_file_system.hpp +2 -2
- package/src/duckdb/extension/parquet/parquet-extension.cpp +175 -282
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +57 -39
- package/src/duckdb/extension/parquet/parquet_reader.cpp +120 -255
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +31 -9
- package/src/duckdb/extension/parquet/parquet_timestamp.cpp +16 -6
- package/src/duckdb/extension/parquet/parquet_writer.cpp +24 -10
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +4 -4
- package/src/duckdb/src/catalog/catalog.cpp +211 -142
- package/src/duckdb/src/catalog/catalog_entry/copy_function_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +4 -4
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +100 -92
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +100 -125
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +8 -8
- package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +3 -4
- package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +8 -8
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +19 -19
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +9 -9
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +9 -9
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +30 -20
- package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +8 -9
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +16 -10
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +27 -27
- package/src/duckdb/src/catalog/catalog_entry.cpp +29 -8
- package/src/duckdb/src/catalog/catalog_search_path.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_set.cpp +132 -132
- package/src/duckdb/src/catalog/catalog_transaction.cpp +5 -1
- package/src/duckdb/src/catalog/default/default_functions.cpp +17 -11
- package/src/duckdb/src/catalog/default/default_schemas.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_types.cpp +4 -4
- package/src/duckdb/src/catalog/default/default_views.cpp +5 -5
- package/src/duckdb/src/catalog/dependency_list.cpp +15 -2
- package/src/duckdb/src/catalog/dependency_manager.cpp +51 -46
- package/src/duckdb/src/catalog/duck_catalog.cpp +64 -26
- package/src/duckdb/src/catalog/similar_catalog_entry.cpp +1 -1
- package/src/duckdb/src/common/adbc/adbc.cpp +444 -0
- package/src/duckdb/src/common/adbc/driver_manager.cpp +749 -0
- package/src/duckdb/src/common/allocator.cpp +2 -2
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +125 -56
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +12 -12
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +21 -3
- package/src/duckdb/src/common/box_renderer.cpp +113 -25
- package/src/duckdb/src/common/compressed_file_system.cpp +15 -0
- package/src/duckdb/src/common/constants.cpp +10 -1
- package/src/duckdb/src/common/enum_util.cpp +5908 -0
- package/src/duckdb/src/common/enums/date_part_specifier.cpp +82 -0
- package/src/duckdb/src/common/enums/expression_type.cpp +83 -85
- package/src/duckdb/src/common/enums/join_type.cpp +6 -24
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +4 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +8 -0
- package/src/duckdb/src/common/exception.cpp +20 -2
- package/src/duckdb/src/common/exception_format_value.cpp +1 -1
- package/src/duckdb/src/common/field_writer.cpp +2 -1
- package/src/duckdb/src/common/file_buffer.cpp +8 -0
- package/src/duckdb/src/common/file_system.cpp +5 -3
- package/src/duckdb/src/common/filename_pattern.cpp +41 -0
- package/src/duckdb/src/common/gzip_file_system.cpp +69 -5
- package/src/duckdb/src/common/hive_partitioning.cpp +150 -19
- package/src/duckdb/src/common/local_file_system.cpp +80 -14
- package/src/duckdb/src/common/multi_file_reader.cpp +390 -0
- package/src/duckdb/src/common/operator/cast_operators.cpp +25 -26
- package/src/duckdb/src/common/pipe_file_system.cpp +2 -1
- package/src/duckdb/src/common/preserved_error.cpp +7 -5
- package/src/duckdb/src/common/progress_bar/progress_bar.cpp +8 -1
- package/src/duckdb/src/common/radix_partitioning.cpp +115 -349
- package/src/duckdb/src/common/random_engine.cpp +1 -1
- package/src/duckdb/src/common/re2_regex.cpp +4 -4
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +22 -17
- package/src/duckdb/src/common/row_operations/row_external.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_gather.cpp +5 -3
- package/src/duckdb/src/common/row_operations/row_heap_scatter.cpp +2 -2
- package/src/duckdb/src/common/row_operations/row_match.cpp +117 -22
- package/src/duckdb/src/common/row_operations/row_scatter.cpp +7 -5
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +143 -0
- package/src/duckdb/src/common/serializer/binary_serializer.cpp +160 -0
- package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +4 -0
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +21 -3
- package/src/duckdb/src/common/sort/comparators.cpp +14 -5
- package/src/duckdb/src/common/sort/merge_sorter.cpp +3 -3
- package/src/duckdb/src/common/sort/partition_state.cpp +564 -0
- package/src/duckdb/src/common/sort/sort_state.cpp +13 -12
- package/src/duckdb/src/common/sort/sorted_block.cpp +23 -18
- package/src/duckdb/src/common/string_util.cpp +49 -4
- package/src/duckdb/src/common/tree_renderer.cpp +7 -9
- package/src/duckdb/src/common/types/batched_data_collection.cpp +5 -4
- package/src/duckdb/src/common/types/bit.cpp +107 -65
- package/src/duckdb/src/common/types/blob.cpp +10 -10
- package/src/duckdb/src/common/types/chunk_collection.cpp +4 -4
- package/src/duckdb/src/common/types/{column_data_allocator.cpp → column/column_data_allocator.cpp} +4 -3
- package/src/duckdb/src/common/types/{column_data_collection.cpp → column/column_data_collection.cpp} +68 -8
- package/src/duckdb/src/common/types/{column_data_collection_segment.cpp → column/column_data_collection_segment.cpp} +14 -11
- package/src/duckdb/src/common/types/{column_data_consumer.cpp → column/column_data_consumer.cpp} +1 -1
- package/src/duckdb/src/common/types/{partitioned_column_data.cpp → column/partitioned_column_data.cpp} +14 -12
- package/src/duckdb/src/common/types/conflict_manager.cpp +5 -4
- package/src/duckdb/src/common/types/data_chunk.cpp +1 -1
- package/src/duckdb/src/common/types/hash.cpp +1 -1
- package/src/duckdb/src/common/types/hyperloglog.cpp +3 -3
- package/src/duckdb/src/common/types/interval.cpp +0 -41
- package/src/duckdb/src/common/types/list_segment.cpp +658 -0
- package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +316 -0
- package/src/duckdb/src/common/types/{row_data_collection.cpp → row/row_data_collection.cpp} +2 -2
- package/src/duckdb/src/common/types/{row_data_collection_scanner.cpp → row/row_data_collection_scanner.cpp} +3 -3
- package/src/duckdb/src/common/types/{row_layout.cpp → row/row_layout.cpp} +1 -1
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +465 -0
- package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +511 -0
- package/src/duckdb/src/common/types/row/tuple_data_iterator.cpp +96 -0
- package/src/duckdb/src/common/types/row/tuple_data_layout.cpp +119 -0
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +1200 -0
- package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +170 -0
- package/src/duckdb/src/common/types/string_heap.cpp +3 -3
- package/src/duckdb/src/common/types/string_type.cpp +3 -3
- package/src/duckdb/src/common/types/time.cpp +13 -0
- package/src/duckdb/src/common/types/timestamp.cpp +1 -1
- package/src/duckdb/src/common/types/validity_mask.cpp +24 -7
- package/src/duckdb/src/common/types/value.cpp +184 -101
- package/src/duckdb/src/common/types/vector.cpp +352 -154
- package/src/duckdb/src/common/types/vector_buffer.cpp +4 -4
- package/src/duckdb/src/common/types/vector_cache.cpp +4 -4
- package/src/duckdb/src/common/types.cpp +326 -175
- package/src/duckdb/src/common/value_operations/comparison_operations.cpp +14 -22
- package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +10 -10
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +13 -12
- package/src/duckdb/src/common/vector_operations/vector_cast.cpp +2 -1
- package/src/duckdb/src/common/vector_operations/vector_copy.cpp +14 -11
- package/src/duckdb/src/common/virtual_file_system.cpp +1 -1
- package/src/duckdb/src/{function → core_functions}/aggregate/algebraic/avg.cpp +13 -16
- package/src/duckdb/src/core_functions/aggregate/algebraic/corr.cpp +13 -0
- package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +21 -0
- package/src/duckdb/src/core_functions/aggregate/algebraic/stddev.cpp +34 -0
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/approx_count.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/arg_min_max.cpp +10 -26
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitagg.cpp +13 -13
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitstring_agg.cpp +33 -18
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bool.cpp +3 -17
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/entropy.cpp +6 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/kurtosis.cpp +8 -8
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/minmax.cpp +30 -30
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/product.cpp +2 -11
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/skew.cpp +10 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/string_agg.cpp +13 -15
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/sum.cpp +44 -44
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/approximate_quantile.cpp +14 -12
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/mode.cpp +6 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/quantile.cpp +56 -33
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/reservoir_quantile.cpp +10 -11
- package/src/duckdb/src/{function → core_functions}/aggregate/nested/histogram.cpp +6 -6
- package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +190 -0
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_avg.cpp +7 -11
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_count.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_intercept.cpp +5 -8
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_r2.cpp +5 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_slope.cpp +5 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxx_syy.cpp +8 -12
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxy.cpp +6 -8
- package/src/duckdb/src/core_functions/core_functions.cpp +50 -0
- package/src/duckdb/src/core_functions/function_list.cpp +355 -0
- package/src/duckdb/src/{function → core_functions}/scalar/bit/bitstring.cpp +16 -18
- package/src/duckdb/src/{function → core_functions}/scalar/blob/base64.cpp +6 -6
- package/src/duckdb/src/{function → core_functions}/scalar/blob/encode.cpp +8 -7
- package/src/duckdb/src/{function → core_functions}/scalar/date/age.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/scalar/date/current.cpp +8 -10
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_diff.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_part.cpp +153 -156
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_sub.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_trunc.cpp +5 -8
- package/src/duckdb/src/{function → core_functions}/scalar/date/epoch.cpp +7 -8
- package/src/duckdb/src/{function → core_functions}/scalar/date/make_date.cpp +14 -14
- package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +251 -0
- package/src/duckdb/src/{function → core_functions}/scalar/date/time_bucket.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/date/to_interval.cpp +39 -19
- package/src/duckdb/src/{function/scalar/enum/enum_functions_implementation.cpp → core_functions/scalar/enum/enum_functions.cpp} +18 -22
- package/src/duckdb/src/{function → core_functions}/scalar/generic/alias.cpp +5 -5
- package/src/duckdb/src/{function → core_functions}/scalar/generic/current_setting.cpp +9 -10
- package/src/duckdb/src/core_functions/scalar/generic/error.cpp +21 -0
- package/src/duckdb/src/{function → core_functions}/scalar/generic/hash.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/generic/least.cpp +8 -9
- package/src/duckdb/src/{function → core_functions}/scalar/generic/stats.cpp +9 -9
- package/src/duckdb/src/{function/scalar/system → core_functions/scalar/generic}/system_functions.cpp +24 -13
- package/src/duckdb/src/{function → core_functions}/scalar/generic/typeof.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/list/array_slice.cpp +4 -14
- package/src/duckdb/src/{function → core_functions}/scalar/list/flatten.cpp +7 -7
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_aggregates.cpp +18 -29
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_lambdas.cpp +18 -29
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_sort.cpp +47 -81
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_value.cpp +6 -7
- package/src/duckdb/src/{function → core_functions}/scalar/list/range.cpp +8 -6
- package/src/duckdb/src/{function → core_functions}/scalar/map/cardinality.cpp +6 -5
- package/src/duckdb/src/{function → core_functions}/scalar/map/map.cpp +54 -65
- package/src/duckdb/src/core_functions/scalar/map/map_concat.cpp +186 -0
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_entries.cpp +7 -6
- package/src/duckdb/src/core_functions/scalar/map/map_extract.cpp +152 -0
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_from_entries.cpp +7 -6
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_keys_values.cpp +9 -8
- package/src/duckdb/src/{function → core_functions}/scalar/math/numeric.cpp +242 -126
- package/src/duckdb/src/{function → core_functions}/scalar/operators/bitwise.cpp +19 -20
- package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/random.cpp +8 -9
- package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/setseed.cpp +7 -7
- package/src/duckdb/src/{function → core_functions}/scalar/string/ascii.cpp +5 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/bar.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/string/chr.cpp +5 -6
- package/src/duckdb/src/core_functions/scalar/string/damerau_levenshtein.cpp +104 -0
- package/src/duckdb/src/core_functions/scalar/string/format_bytes.cpp +29 -0
- package/src/duckdb/src/{function/scalar/string/mismatches.cpp → core_functions/scalar/string/hamming.cpp} +5 -14
- package/src/duckdb/src/core_functions/scalar/string/hex.cpp +374 -0
- package/src/duckdb/src/{function → core_functions}/scalar/string/instr.cpp +7 -14
- package/src/duckdb/src/{function → core_functions}/scalar/string/jaccard.cpp +4 -7
- package/src/duckdb/src/{function → core_functions}/scalar/string/jaro_winkler.cpp +12 -11
- package/src/duckdb/src/{function → core_functions}/scalar/string/left_right.cpp +18 -11
- package/src/duckdb/src/{function → core_functions}/scalar/string/levenshtein.cpp +7 -16
- package/src/duckdb/src/{function → core_functions}/scalar/string/md5.cpp +15 -21
- package/src/duckdb/src/{function → core_functions}/scalar/string/pad.cpp +10 -16
- package/src/duckdb/src/{function → core_functions}/scalar/string/printf.cpp +15 -15
- package/src/duckdb/src/{function → core_functions}/scalar/string/repeat.cpp +4 -7
- package/src/duckdb/src/{function → core_functions}/scalar/string/replace.cpp +7 -10
- package/src/duckdb/src/{function → core_functions}/scalar/string/reverse.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/string/starts_with.cpp +6 -10
- package/src/duckdb/src/{function → core_functions}/scalar/string/string_split.cpp +17 -17
- package/src/duckdb/src/{function → core_functions}/scalar/string/translate.cpp +7 -10
- package/src/duckdb/src/{function → core_functions}/scalar/string/trim.cpp +22 -17
- package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +28 -0
- package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_insert.cpp +6 -6
- package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_pack.cpp +7 -8
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_extract.cpp +9 -13
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_tag.cpp +4 -8
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_value.cpp +6 -61
- package/src/duckdb/src/execution/adaptive_filter.cpp +1 -1
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +332 -340
- package/src/duckdb/src/execution/column_binding_resolver.cpp +22 -12
- package/src/duckdb/src/execution/expression_executor/execute_between.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_case.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +3 -2
- package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +3 -3
- package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +6 -6
- package/src/duckdb/src/execution/expression_executor/execute_constant.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_function.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_operator.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_parameter.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_reference.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor.cpp +5 -4
- package/src/duckdb/src/execution/expression_executor_state.cpp +3 -4
- package/src/duckdb/src/execution/index/art/art.cpp +309 -276
- package/src/duckdb/src/execution/index/art/art_key.cpp +24 -34
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +224 -0
- package/src/duckdb/src/execution/index/art/iterator.cpp +142 -123
- package/src/duckdb/src/execution/index/art/leaf.cpp +319 -170
- package/src/duckdb/src/execution/index/art/leaf_segment.cpp +42 -0
- package/src/duckdb/src/execution/index/art/node.cpp +444 -379
- package/src/duckdb/src/execution/index/art/node16.cpp +178 -114
- package/src/duckdb/src/execution/index/art/node256.cpp +117 -79
- package/src/duckdb/src/execution/index/art/node4.cpp +169 -114
- package/src/duckdb/src/execution/index/art/node48.cpp +175 -105
- package/src/duckdb/src/execution/index/art/prefix.cpp +405 -127
- package/src/duckdb/src/execution/index/art/prefix_segment.cpp +42 -0
- package/src/duckdb/src/execution/index/art/swizzleable_pointer.cpp +10 -85
- package/src/duckdb/src/execution/join_hashtable.cpp +203 -337
- package/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +12 -3
- package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +13 -13
- package/src/duckdb/src/execution/operator/aggregate/grouped_aggregate_data.cpp +4 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +103 -83
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +34 -28
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +13 -9
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +71 -64
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +250 -816
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +12 -12
- package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +3 -8
- package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +8 -23
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +22 -19
- package/src/duckdb/src/execution/operator/helper/physical_limit_percent.cpp +21 -21
- package/src/duckdb/src/execution/operator/helper/physical_load.cpp +3 -2
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +17 -13
- package/src/duckdb/src/execution/operator/helper/physical_pragma.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_prepare.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +14 -12
- package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +4 -3
- package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +8 -14
- package/src/duckdb/src/execution/operator/helper/physical_set.cpp +7 -6
- package/src/duckdb/src/execution/operator/helper/physical_streaming_limit.cpp +6 -6
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +5 -4
- package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +17 -14
- package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +37 -22
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +699 -0
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +66 -42
- package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +2 -1
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +9 -10
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +22 -21
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +205 -180
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +51 -46
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +33 -22
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +9 -20
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +31 -29
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +39 -42
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +13 -12
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +5 -3
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +26 -26
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +20 -20
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +58 -50
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +97 -44
- package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +17 -13
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +14 -19
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +139 -31
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +209 -0
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +196 -175
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +39 -52
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +22 -28
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +47 -41
- package/src/duckdb/src/execution/operator/persistent/physical_fixed_batch_copy.cpp +494 -0
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +78 -81
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +26 -29
- package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +81 -0
- package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +37 -3
- package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +7 -7
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +5 -6
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +19 -11
- package/src/duckdb/src/execution/operator/scan/physical_dummy_scan.cpp +4 -19
- package/src/duckdb/src/execution/operator/scan/physical_empty_result.cpp +3 -2
- package/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp +1 -1
- package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +39 -15
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +31 -17
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +4 -20
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +13 -25
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +5 -20
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +36 -36
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +5 -20
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +5 -20
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +6 -21
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +41 -68
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +5 -20
- package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +5 -20
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +5 -21
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +27 -30
- package/src/duckdb/src/execution/operator/set/physical_union.cpp +15 -4
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +32 -45
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +35 -39
- package/src/duckdb/src/execution/physical_operator.cpp +33 -42
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +28 -22
- package/src/duckdb/src/execution/physical_plan/plan_any_join.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_asof_join.cpp +103 -0
- package/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp +2 -4
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +103 -60
- package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +38 -7
- package/src/duckdb/src/execution/physical_plan/plan_create.cpp +9 -9
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +16 -16
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +8 -7
- package/src/duckdb/src/execution/physical_plan/plan_cross_product.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +12 -13
- package/src/duckdb/src/execution/physical_plan/plan_distinct.cpp +15 -16
- package/src/duckdb/src/execution/physical_plan/plan_dummy_scan.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_empty_result.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_execute.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +9 -12
- package/src/duckdb/src/execution/physical_plan/plan_export.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp +6 -6
- package/src/duckdb/src/execution/physical_plan/plan_filter.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_get.cpp +12 -13
- package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +28 -8
- package/src/duckdb/src/execution/physical_plan/plan_limit.cpp +6 -7
- package/src/duckdb/src/execution/physical_plan/plan_limit_percent.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_order.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_pivot.cpp +14 -0
- package/src/duckdb/src/execution/physical_plan/plan_positional_join.cpp +14 -5
- package/src/duckdb/src/execution/physical_plan/plan_pragma.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_prepare.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_projection.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +7 -7
- package/src/duckdb/src/execution/physical_plan/plan_reset.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_sample.cpp +6 -5
- package/src/duckdb/src/execution/physical_plan/plan_set.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_set_operation.cpp +5 -5
- package/src/duckdb/src/execution/physical_plan/plan_show_select.cpp +3 -5
- package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +14 -14
- package/src/duckdb/src/execution/physical_plan/plan_top_n.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_unnest.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_window.cpp +13 -13
- package/src/duckdb/src/execution/physical_plan_generator.cpp +53 -43
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +96 -66
- package/src/duckdb/src/execution/reservoir_sample.cpp +3 -3
- package/src/duckdb/src/execution/window_segment_tree.cpp +200 -26
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +1 -0
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +12 -10
- package/src/duckdb/src/function/aggregate/distributive_functions.cpp +0 -17
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +289 -98
- package/src/duckdb/src/function/built_in_functions.cpp +10 -10
- package/src/duckdb/src/function/cast/cast_function_set.cpp +3 -2
- package/src/duckdb/src/function/cast/enum_casts.cpp +28 -6
- package/src/duckdb/src/function/cast/list_casts.cpp +20 -7
- package/src/duckdb/src/function/cast/map_cast.cpp +6 -3
- package/src/duckdb/src/function/cast/string_cast.cpp +40 -14
- package/src/duckdb/src/function/cast/struct_cast.cpp +28 -8
- package/src/duckdb/src/function/cast/time_casts.cpp +2 -2
- package/src/duckdb/src/function/cast/union_casts.cpp +40 -14
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +5 -6
- package/src/duckdb/src/function/cast_rules.cpp +9 -4
- package/src/duckdb/src/function/compression_config.cpp +9 -9
- package/src/duckdb/src/function/function.cpp +4 -12
- package/src/duckdb/src/function/function_binder.cpp +10 -16
- package/src/duckdb/src/function/function_set.cpp +25 -0
- package/src/duckdb/src/function/macro_function.cpp +3 -3
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +25 -2
- package/src/duckdb/src/function/pragma_function.cpp +1 -1
- package/src/duckdb/src/function/scalar/generic/constant_or_null.cpp +6 -6
- package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -8
- package/src/duckdb/src/function/scalar/list/contains_or_position.cpp +5 -147
- package/src/duckdb/src/function/scalar/list/list_concat.cpp +6 -5
- package/src/duckdb/src/function/scalar/list/list_extract.cpp +1 -1
- package/src/duckdb/src/function/scalar/nested_functions.cpp +0 -22
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +38 -31
- package/src/duckdb/src/function/scalar/operators/multiply.cpp +5 -0
- package/src/duckdb/src/function/scalar/operators.cpp +0 -6
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +41 -40
- package/src/duckdb/src/function/scalar/{date/strftime.cpp → strftime_format.cpp} +22 -173
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/concat.cpp +6 -6
- package/src/duckdb/src/function/scalar/string/contains.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/length.cpp +0 -19
- package/src/duckdb/src/function/scalar/string/like.cpp +14 -15
- package/src/duckdb/src/function/scalar/string/nfc_normalize.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/prefix.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +243 -0
- package/src/duckdb/src/function/scalar/string/regexp/regexp_util.cpp +79 -0
- package/src/duckdb/src/function/scalar/string/regexp.cpp +183 -125
- package/src/duckdb/src/function/scalar/string/strip_accents.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/substring.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/suffix.cpp +2 -2
- package/src/duckdb/src/function/scalar/string_functions.cpp +0 -38
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +6 -6
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +28 -25
- package/src/duckdb/src/function/scalar_macro_function.cpp +4 -4
- package/src/duckdb/src/function/table/arrow.cpp +58 -48
- package/src/duckdb/src/function/table/arrow_conversion.cpp +104 -64
- package/src/duckdb/src/function/table/checkpoint.cpp +12 -8
- package/src/duckdb/src/function/table/copy_csv.cpp +106 -46
- package/src/duckdb/src/function/table/glob.cpp +7 -12
- package/src/duckdb/src/function/table/pragma_detailed_profiling_output.cpp +15 -14
- package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +13 -11
- package/src/duckdb/src/function/table/range.cpp +11 -10
- package/src/duckdb/src/function/table/read_csv.cpp +329 -276
- package/src/duckdb/src/function/table/repeat.cpp +4 -4
- package/src/duckdb/src/function/table/repeat_row.cpp +60 -0
- package/src/duckdb/src/function/table/summary.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +31 -30
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +31 -30
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +4 -4
- package/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +13 -13
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +4 -4
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +56 -68
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +15 -14
- package/src/duckdb/src/function/table/system/duckdb_keywords.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +9 -9
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +10 -11
- package/src/duckdb/src/function/table/system/duckdb_settings.cpp +4 -3
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +13 -12
- package/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +17 -16
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +12 -11
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +4 -4
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +7 -7
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +11 -9
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +23 -24
- package/src/duckdb/src/function/table/system/test_all_types.cpp +6 -6
- package/src/duckdb/src/function/table/system/test_vector_types.cpp +6 -6
- package/src/duckdb/src/function/table/table_scan.cpp +87 -92
- package/src/duckdb/src/function/table/unnest.cpp +10 -10
- package/src/duckdb/src/function/table/version/pragma_version.cpp +6 -4
- package/src/duckdb/src/function/table_function.cpp +11 -11
- package/src/duckdb/src/function/table_macro_function.cpp +3 -3
- package/src/duckdb/src/function/udf_function.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +144 -84
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +4 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/collate_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +24 -20
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +6 -7
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +33 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +6 -6
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +7 -6
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +4 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +24 -19
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +10 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +4 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +6 -6
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +42 -10
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry_map.hpp +38 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +25 -24
- package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +6 -3
- package/src/duckdb/src/include/duckdb/catalog/default/default_functions.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/default/default_types.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/default/default_views.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/dependency.hpp +4 -5
- package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +6 -4
- package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +10 -9
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +9 -8
- package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +2 -1
- package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +10 -4
- package/src/duckdb/src/include/duckdb/common/adbc/adbc-init.hpp +37 -0
- package/src/duckdb/src/include/duckdb/common/adbc/adbc.h +1088 -0
- package/src/duckdb/src/include/duckdb/common/adbc/adbc.hpp +85 -0
- package/src/duckdb/src/include/duckdb/common/adbc/driver_manager.h +84 -0
- package/src/duckdb/src/include/duckdb/common/algorithm.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +2 -1
- 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 -2
- package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +147 -0
- package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +8 -2
- package/src/duckdb/src/include/duckdb/common/case_insensitive_map.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/common.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/compressed_file_system.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/constants.hpp +9 -29
- package/src/duckdb/src/include/duckdb/common/crypto/md5.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +958 -0
- package/src/duckdb/src/include/duckdb/common/enums/aggregate_handling.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/debug_initialize.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +2 -3
- package/src/duckdb/src/include/duckdb/{function/scalar/uuid_functions.hpp → common/enums/file_glob_options.hpp} +5 -5
- package/src/duckdb/src/include/duckdb/common/enums/join_type.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/enums/joinref_type.hpp +7 -4
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/on_entry_not_found.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/enums/operator_result_type.hpp +16 -4
- package/src/duckdb/src/include/duckdb/common/enums/order_preservation_type.hpp +24 -0
- package/src/duckdb/src/include/duckdb/common/enums/order_type.hpp +10 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +5 -0
- package/src/duckdb/src/include/duckdb/common/enums/set_operation_type.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/exception.hpp +81 -9
- package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +8 -3
- package/src/duckdb/src/include/duckdb/common/fast_mem.hpp +528 -0
- package/src/duckdb/src/include/duckdb/common/field_writer.hpp +12 -4
- package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +34 -0
- package/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp +4 -1
- package/src/duckdb/src/include/duckdb/common/helper.hpp +70 -9
- package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +16 -6
- package/src/duckdb/src/include/duckdb/common/{http_stats.hpp → http_state.hpp} +18 -4
- package/src/duckdb/src/include/duckdb/common/hugeint.hpp +63 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +200 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +72 -0
- package/src/duckdb/src/include/duckdb/common/operator/comparison_operators.hpp +45 -149
- package/src/duckdb/src/include/duckdb/common/operator/multiply.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/optional_idx.hpp +45 -0
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +76 -0
- package/src/duckdb/src/include/duckdb/common/perfect_map_set.hpp +34 -0
- package/src/duckdb/src/include/duckdb/common/preserved_error.hpp +6 -1
- package/src/duckdb/src/include/duckdb/common/progress_bar/progress_bar.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/queue.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/radix.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +83 -27
- package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/reference_map.hpp +38 -0
- package/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp +21 -9
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +93 -0
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +92 -0
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_deserializer.hpp +4 -2
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +9 -2
- package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +377 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +248 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +109 -0
- package/src/duckdb/src/include/duckdb/common/serializer.hpp +13 -0
- package/src/duckdb/src/include/duckdb/common/set.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/shared_ptr.hpp +11 -0
- package/src/duckdb/src/include/duckdb/common/sort/comparators.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +198 -0
- package/src/duckdb/src/include/duckdb/common/sort/sort.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/sort/sorted_block.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +39 -0
- package/src/duckdb/src/include/duckdb/common/typedefs.hpp +31 -0
- package/src/duckdb/src/include/duckdb/common/types/arrow_aux_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/types/batched_data_collection.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/bit.hpp +7 -6
- package/src/duckdb/src/include/duckdb/common/types/{column_data_allocator.hpp → column/column_data_allocator.hpp} +4 -4
- package/src/duckdb/src/include/duckdb/common/types/{column_data_collection.hpp → column/column_data_collection.hpp} +4 -4
- package/src/duckdb/src/include/duckdb/common/types/{column_data_collection_iterators.hpp → column/column_data_collection_iterators.hpp} +2 -2
- package/src/duckdb/src/include/duckdb/common/types/{column_data_collection_segment.hpp → column/column_data_collection_segment.hpp} +3 -3
- package/src/duckdb/src/include/duckdb/common/types/{column_data_consumer.hpp → column/column_data_consumer.hpp} +8 -4
- package/src/duckdb/src/include/duckdb/common/types/{column_data_scan_states.hpp → column/column_data_scan_states.hpp} +1 -1
- package/src/duckdb/src/include/duckdb/common/types/{partitioned_column_data.hpp → column/partitioned_column_data.hpp} +16 -8
- package/src/duckdb/src/include/duckdb/common/types/conflict_manager.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/types/interval.hpp +39 -3
- package/src/duckdb/src/include/duckdb/common/types/list_segment.hpp +62 -0
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +140 -0
- package/src/duckdb/src/include/duckdb/common/types/{row_data_collection.hpp → row/row_data_collection.hpp} +4 -3
- package/src/duckdb/src/include/duckdb/common/types/{row_data_collection_scanner.hpp → row/row_data_collection_scanner.hpp} +2 -2
- package/src/duckdb/src/include/duckdb/common/types/{row_layout.hpp → row/row_layout.hpp} +3 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_allocator.hpp +116 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +239 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_iterator.hpp +64 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_layout.hpp +113 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +124 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_states.hpp +74 -0
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +79 -7
- package/src/duckdb/src/include/duckdb/common/types/time.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +7 -1
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +20 -53
- package/src/duckdb/src/include/duckdb/common/types/value_map.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +14 -2
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +22 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +47 -63
- package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +17 -66
- package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +61 -0
- package/src/duckdb/src/include/duckdb/common/vector.hpp +92 -2
- package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +2 -2
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/corr.hpp +3 -4
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/covar.hpp +1 -1
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/stddev.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +124 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +229 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +85 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +41 -0
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_count.hpp +3 -4
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_slope.hpp +2 -2
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +97 -0
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/sum_helpers.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/core_functions.hpp +22 -0
- package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +33 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +52 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +58 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +544 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +61 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +142 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +220 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +98 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +394 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +70 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +49 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +474 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +40 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +43 -0
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +70 -47
- package/src/duckdb/src/include/duckdb/execution/base_aggregate_hashtable.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/execution_context.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +17 -8
- package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +56 -59
- package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +29 -24
- package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +114 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +26 -20
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +63 -39
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +36 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +98 -116
- package/src/duckdb/src/include/duckdb/execution/index/art/node16.hpp +48 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +52 -35
- package/src/duckdb/src/include/duckdb/execution/index/art/node4.hpp +46 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +57 -35
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +57 -50
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix_segment.hpp +40 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/swizzleable_pointer.hpp +38 -31
- package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +41 -67
- package/src/duckdb/src/include/duckdb/execution/nested_loop_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/aggregate_object.hpp +15 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/distinct_aggregate_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/grouped_aggregate_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +20 -13
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +13 -5
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +5 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +12 -7
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +11 -7
- package/src/duckdb/src/include/duckdb/execution/operator/filter/physical_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +6 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +9 -5
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +10 -5
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +10 -5
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +6 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reset.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +6 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_limit.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_sample.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_transaction.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +9 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/outer_join_marker.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +91 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +5 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +14 -9
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +11 -6
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +5 -6
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +5 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_index_join.hpp +9 -7
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +11 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +5 -8
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +5 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +7 -6
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +13 -5
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +12 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +16 -11
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/buffered_csv_reader.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_buffer.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_file_handle.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +22 -16
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/parallel_csv_reader.hpp +5 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +81 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +14 -9
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +16 -7
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +9 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +10 -5
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_fixed_batch_copy.hpp +72 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +22 -12
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +9 -4
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_pivot.hpp +38 -0
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_projection.hpp +8 -0
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_tableinout_function.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_unnest.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +12 -7
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_positional_scan.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +7 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +9 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_table.hpp +10 -5
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +13 -5
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +11 -6
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_union.hpp +5 -1
- package/src/duckdb/src/include/duckdb/execution/partitionable_hashtable.hpp +10 -6
- package/src/duckdb/src/include/duckdb/execution/perfect_aggregate_hashtable.hpp +4 -0
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +44 -74
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +170 -0
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/radix_partitioned_hashtable.hpp +6 -6
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +55 -5
- package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +0 -85
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +11 -7
- package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -8
- package/src/duckdb/src/include/duckdb/function/cast/bound_cast_data.hpp +84 -0
- package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +42 -65
- package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +56 -4
- package/src/duckdb/src/include/duckdb/function/function.hpp +22 -4
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +3 -6
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/function_set.hpp +7 -2
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +20 -3
- package/src/duckdb/src/include/duckdb/function/pragma_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -32
- package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +138 -0
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +33 -106
- package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +0 -24
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +81 -1
- package/src/duckdb/src/include/duckdb/function/scalar/{strftime.hpp → strftime_format.hpp} +4 -0
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +3 -91
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +14 -2
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +5 -2
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +18 -3
- package/src/duckdb/src/include/duckdb/function/table/range.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +44 -7
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +5 -4
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +58 -16
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +6 -3
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/capi/cast/utils.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +14 -2
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +6 -3
- package/src/duckdb/src/include/duckdb/main/config.hpp +15 -8
- package/src/duckdb/src/include/duckdb/main/connection_manager.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/database.hpp +1 -2
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +9 -4
- package/src/duckdb/src/include/duckdb/main/database_path_and_type.hpp +24 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +5 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +48 -0
- package/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +10 -9
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +19 -5
- package/src/duckdb/src/include/duckdb/main/relation/explain_relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/relation/setop_relation.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/settings.hpp +39 -0
- package/src/duckdb/src/include/duckdb/optimizer/cse_optimizer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/expression_rewriter.hpp +3 -3
- package/src/duckdb/src/include/duckdb/optimizer/filter_combiner.hpp +9 -9
- package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +2 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +16 -16
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +8 -8
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +23 -15
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_relation.hpp +9 -10
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +18 -11
- package/src/duckdb/src/include/duckdb/optimizer/matcher/expression_matcher.hpp +11 -11
- package/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp +8 -8
- package/src/duckdb/src/include/duckdb/optimizer/rule/arithmetic_simplification.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/case_simplification.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/comparison_simplification.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/conjunction_simplification.hpp +2 -2
- package/src/duckdb/src/include/duckdb/optimizer/rule/constant_folding.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/date_part_simplification.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/distributivity.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/empty_needle_removal.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/enum_comparison.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/equal_or_null_simplification.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/in_clause_simplification.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/like_optimizations.hpp +2 -2
- package/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/optimizer/rule/move_constants.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/ordered_aggregate_optimizer.hpp +24 -0
- package/src/duckdb/src/include/duckdb/optimizer/rule/regex_optimizations.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parallel/concurrentqueue.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parallel/event.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +63 -0
- package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +5 -5
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +34 -20
- package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +53 -9
- package/src/duckdb/src/include/duckdb/parallel/task.hpp +21 -2
- package/src/duckdb/src/include/duckdb/parallel/task_counter.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/base_expression.hpp +19 -1
- package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/constraint.hpp +18 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +8 -0
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +7 -2
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +7 -2
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +14 -2
- package/src/duckdb/src/include/duckdb/parser/expression_map.hpp +19 -6
- package/src/duckdb/src/include/duckdb/parser/expression_util.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/keyword_helper.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +10 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +7 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_database_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +4 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +6 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +13 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/show_select_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +4 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_expression.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/parser.hpp +1 -7
- package/src/duckdb/src/include/duckdb/parser/parser_options.hpp +23 -0
- package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +4 -2
- package/src/duckdb/src/include/duckdb/parser/query_node/list.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/recursive_cte_node.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/select_node.hpp +8 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/set_operation_node.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/query_node.hpp +29 -1
- package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +24 -1
- package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +20 -1
- package/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/create_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/delete_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +7 -1
- package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +9 -1
- package/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/show_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/update_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +30 -2
- package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +23 -1
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +33 -42
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +16 -17
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +41 -35
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +19 -1
- package/src/duckdb/src/include/duckdb/planner/bound_query_node.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +8 -1
- package/src/duckdb/src/include/duckdb/planner/bound_tableref.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_check_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_foreign_key_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_not_null_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_unique_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +7 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/aggregate_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +66 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/check_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/constant_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +4 -4
- package/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp +5 -5
- package/src/duckdb/src/include/duckdb/planner/expression_binder/insert_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/lateral_binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +7 -4
- package/src/duckdb/src/include/duckdb/planner/expression_binder/qualify_binder.hpp +4 -4
- package/src/duckdb/src/include/duckdb/planner/expression_binder/relation_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/returning_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/select_binder.hpp +9 -38
- package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/update_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/where_binder.hpp +4 -4
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +17 -13
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_asof_join.hpp +27 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +8 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +6 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +15 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +37 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +10 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unconditional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_function_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/pragma_handler.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_recursive_cte_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_select_node.hpp +12 -3
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_set_operation_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/list.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/table_binding.hpp +6 -5
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_basetableref.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_cteref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_dummytableref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_expressionlistref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_joinref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +43 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pos_join_ref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_subqueryref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_table_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +7 -0
- package/src/duckdb/src/include/duckdb/storage/block_manager.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +16 -9
- package/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp +80 -0
- package/src/duckdb/src/include/duckdb/storage/buffer/temporary_file_information.hpp +12 -0
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +47 -185
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/chimp128.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/chimp_utils.hpp +0 -97
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_compress.hpp +4 -8
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/algorithm/patas.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_compress.hpp +4 -8
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +0 -2
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +7 -4
- package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/index.hpp +33 -34
- package/src/duckdb/src/include/duckdb/storage/meta_block_reader.hpp +7 -0
- package/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +46 -0
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +26 -4
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +11 -5
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +157 -0
- package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +2 -0
- package/src/duckdb/src/include/duckdb/storage/statistics/node_statistics.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats.hpp +9 -52
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +62 -0
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +48 -2
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +29 -16
- package/src/duckdb/src/include/duckdb/storage/table/column_data_checkpointer.hpp +5 -3
- package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +7 -7
- package/src/duckdb/src/include/duckdb/storage/table/column_segment_tree.hpp +18 -0
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/persistent_table_data.hpp +4 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +39 -44
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +22 -6
- package/src/duckdb/src/include/duckdb/storage/table/row_group_segment_tree.hpp +35 -0
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +19 -29
- package/src/duckdb/src/include/duckdb/storage/table/segment_base.hpp +7 -7
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +303 -26
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +3 -7
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +4 -7
- package/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp +1 -2
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +21 -21
- package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +8 -3
- package/src/duckdb/src/include/duckdb/transaction/commit_state.hpp +6 -6
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +3 -3
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +43 -64
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +6 -5
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +12 -0
- package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/verification/deserialized_statement_verifier_v2.hpp +26 -0
- package/src/duckdb/src/include/duckdb/verification/no_operator_caching_verifier.hpp +25 -0
- package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +6 -0
- package/src/duckdb/src/include/duckdb.h +48 -1
- package/src/duckdb/src/main/appender.cpp +9 -9
- package/src/duckdb/src/main/attached_database.cpp +23 -16
- package/src/duckdb/src/main/capi/appender-c.cpp +1 -1
- package/src/duckdb/src/main/capi/cast/from_decimal-c.cpp +1 -1
- package/src/duckdb/src/main/capi/duckdb-c.cpp +1 -1
- package/src/duckdb/src/main/capi/helper-c.cpp +7 -0
- package/src/duckdb/src/main/capi/pending-c.cpp +4 -4
- package/src/duckdb/src/main/capi/replacement_scan-c.cpp +4 -4
- package/src/duckdb/src/main/capi/result-c.cpp +3 -3
- package/src/duckdb/src/main/capi/table_function-c.cpp +53 -29
- package/src/duckdb/src/main/capi/threading-c.cpp +1 -1
- package/src/duckdb/src/main/client_context.cpp +98 -97
- package/src/duckdb/src/main/client_data.cpp +11 -10
- package/src/duckdb/src/main/client_verify.cpp +7 -2
- package/src/duckdb/src/main/config.cpp +38 -1
- package/src/duckdb/src/main/connection.cpp +3 -3
- package/src/duckdb/src/main/database.cpp +80 -85
- package/src/duckdb/src/main/database_manager.cpp +17 -16
- package/src/duckdb/src/main/database_path_and_type.cpp +23 -0
- package/src/duckdb/src/main/extension/extension_helper.cpp +19 -3
- package/src/duckdb/src/main/extension/extension_install.cpp +18 -2
- package/src/duckdb/src/main/extension/extension_load.cpp +97 -44
- package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
- package/src/duckdb/src/main/materialized_query_result.cpp +2 -2
- package/src/duckdb/src/main/pending_query_result.cpp +1 -1
- package/src/duckdb/src/main/prepared_statement.cpp +5 -1
- package/src/duckdb/src/main/query_profiler.cpp +48 -44
- package/src/duckdb/src/main/query_result.cpp +14 -1
- package/src/duckdb/src/main/relation/aggregate_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/create_table_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/create_view_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/cross_product_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/delete_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/explain_relation.cpp +4 -4
- package/src/duckdb/src/main/relation/filter_relation.cpp +4 -4
- package/src/duckdb/src/main/relation/insert_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/join_relation.cpp +5 -4
- package/src/duckdb/src/main/relation/limit_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/order_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/projection_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/query_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/read_csv_relation.cpp +4 -2
- package/src/duckdb/src/main/relation/setop_relation.cpp +4 -5
- package/src/duckdb/src/main/relation/table_function_relation.cpp +11 -11
- package/src/duckdb/src/main/relation/table_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/update_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/value_relation.cpp +4 -4
- package/src/duckdb/src/main/relation/view_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/write_csv_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/write_parquet_relation.cpp +1 -1
- package/src/duckdb/src/main/relation.cpp +8 -7
- package/src/duckdb/src/main/settings/settings.cpp +108 -22
- package/src/duckdb/src/main/stream_query_result.cpp +5 -5
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +4 -3
- package/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp +3 -3
- package/src/duckdb/src/optimizer/cse_optimizer.cpp +16 -15
- package/src/duckdb/src/optimizer/deliminator.cpp +28 -27
- package/src/duckdb/src/optimizer/expression_heuristics.cpp +11 -11
- package/src/duckdb/src/optimizer/expression_rewriter.cpp +10 -10
- package/src/duckdb/src/optimizer/filter_combiner.cpp +139 -138
- package/src/duckdb/src/optimizer/filter_pullup.cpp +6 -4
- package/src/duckdb/src/optimizer/filter_pushdown.cpp +17 -11
- package/src/duckdb/src/optimizer/in_clause_rewriter.cpp +12 -12
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +102 -111
- package/src/duckdb/src/optimizer/join_order/join_node.cpp +8 -11
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +224 -213
- package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +30 -30
- package/src/duckdb/src/optimizer/join_order/query_graph.cpp +37 -38
- package/src/duckdb/src/optimizer/matcher/expression_matcher.cpp +28 -26
- package/src/duckdb/src/optimizer/optimizer.cpp +15 -14
- package/src/duckdb/src/optimizer/pullup/pullup_filter.cpp +1 -1
- package/src/duckdb/src/optimizer/pullup/pullup_from_left.cpp +2 -2
- package/src/duckdb/src/optimizer/pullup/pullup_projection.cpp +3 -3
- package/src/duckdb/src/optimizer/pullup/pullup_set_operation.cpp +3 -3
- package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +36 -8
- package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +1 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_filter.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_get.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +9 -6
- package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +11 -18
- package/src/duckdb/src/optimizer/pushdown/pushdown_limit.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_mark_join.cpp +5 -5
- package/src/duckdb/src/optimizer/pushdown/pushdown_projection.cpp +4 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +8 -8
- package/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp +2 -2
- package/src/duckdb/src/optimizer/regex_range_filter.cpp +9 -9
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +17 -12
- package/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp +31 -30
- package/src/duckdb/src/optimizer/rule/case_simplification.cpp +10 -10
- package/src/duckdb/src/optimizer/rule/comparison_simplification.cpp +22 -23
- package/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp +17 -16
- package/src/duckdb/src/optimizer/rule/constant_folding.cpp +9 -9
- package/src/duckdb/src/optimizer/rule/date_part_simplification.cpp +8 -8
- package/src/duckdb/src/optimizer/rule/distributivity.cpp +23 -23
- package/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +14 -15
- package/src/duckdb/src/optimizer/rule/enum_comparison.cpp +15 -16
- package/src/duckdb/src/optimizer/rule/equal_or_null_simplification.cpp +35 -38
- package/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +16 -17
- package/src/duckdb/src/optimizer/rule/like_optimizations.cpp +22 -22
- package/src/duckdb/src/optimizer/rule/move_constants.cpp +46 -40
- package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +30 -0
- package/src/duckdb/src/optimizer/rule/regex_optimizations.cpp +25 -17
- package/src/duckdb/src/optimizer/statistics/expression/propagate_and_compress.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics/expression/propagate_between.cpp +6 -6
- package/src/duckdb/src/optimizer/statistics/expression/propagate_comparison.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +4 -4
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +12 -11
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +5 -4
- package/src/duckdb/src/optimizer/statistics/operator/propagate_limit.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics_propagator.cpp +33 -21
- package/src/duckdb/src/optimizer/topn_optimizer.cpp +3 -3
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +16 -16
- package/src/duckdb/src/parallel/event.cpp +1 -1
- package/src/duckdb/src/parallel/executor.cpp +98 -56
- package/src/duckdb/src/parallel/executor_task.cpp +11 -0
- package/src/duckdb/src/parallel/interrupt.cpp +57 -0
- package/src/duckdb/src/parallel/meta_pipeline.cpp +8 -15
- package/src/duckdb/src/parallel/pipeline.cpp +116 -41
- package/src/duckdb/src/parallel/pipeline_executor.cpp +267 -88
- package/src/duckdb/src/parallel/pipeline_initialize_event.cpp +2 -2
- package/src/duckdb/src/parallel/task_scheduler.cpp +62 -27
- package/src/duckdb/src/parser/base_expression.cpp +6 -0
- package/src/duckdb/src/parser/column_definition.cpp +6 -6
- package/src/duckdb/src/parser/common_table_expression_info.cpp +19 -0
- package/src/duckdb/src/parser/constraints/check_constraint.cpp +2 -2
- package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +2 -2
- package/src/duckdb/src/parser/constraints/not_null_constraint.cpp +2 -2
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +4 -4
- package/src/duckdb/src/parser/expression/between_expression.cpp +19 -2
- package/src/duckdb/src/parser/expression/case_expression.cpp +30 -2
- package/src/duckdb/src/parser/expression/cast_expression.cpp +19 -2
- package/src/duckdb/src/parser/expression/collate_expression.cpp +18 -2
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +19 -7
- package/src/duckdb/src/parser/expression/comparison_expression.cpp +18 -2
- package/src/duckdb/src/parser/expression/conjunction_expression.cpp +20 -3
- package/src/duckdb/src/parser/expression/constant_expression.cpp +17 -3
- package/src/duckdb/src/parser/expression/default_expression.cpp +9 -2
- package/src/duckdb/src/parser/expression/function_expression.cpp +42 -6
- package/src/duckdb/src/parser/expression/lambda_expression.cpp +18 -2
- package/src/duckdb/src/parser/expression/operator_expression.cpp +17 -2
- package/src/duckdb/src/parser/expression/parameter_expression.cpp +17 -2
- package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +16 -2
- package/src/duckdb/src/parser/expression/star_expression.cpp +30 -8
- package/src/duckdb/src/parser/expression/subquery_expression.cpp +22 -2
- package/src/duckdb/src/parser/expression/window_expression.cpp +72 -2
- package/src/duckdb/src/parser/expression_util.cpp +6 -6
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +35 -36
- package/src/duckdb/src/parser/parsed_data/create_aggregate_function_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_pragma_function_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/create_scalar_function_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/create_table_function_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +4 -4
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +5 -5
- package/src/duckdb/src/parser/parsed_data/sample_options.cpp +24 -12
- package/src/duckdb/src/parser/parsed_expression.cpp +72 -0
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +26 -20
- package/src/duckdb/src/parser/parser.cpp +12 -12
- package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +27 -6
- package/src/duckdb/src/parser/query_node/select_node.cpp +44 -13
- package/src/duckdb/src/parser/query_node/set_operation_node.cpp +23 -6
- package/src/duckdb/src/parser/query_node.cpp +54 -4
- package/src/duckdb/src/parser/result_modifier.cpp +97 -8
- package/src/duckdb/src/parser/statement/copy_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/drop_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/extension_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/insert_statement.cpp +16 -7
- package/src/duckdb/src/parser/statement/pragma_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/select_statement.cpp +15 -3
- package/src/duckdb/src/parser/statement/show_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/transaction_statement.cpp +2 -2
- package/src/duckdb/src/parser/statement/vacuum_statement.cpp +1 -1
- package/src/duckdb/src/parser/tableref/basetableref.cpp +23 -2
- package/src/duckdb/src/parser/tableref/emptytableref.cpp +6 -2
- package/src/duckdb/src/parser/tableref/expressionlistref.cpp +19 -2
- package/src/duckdb/src/parser/tableref/joinref.cpp +33 -4
- package/src/duckdb/src/parser/tableref/pivotref.cpp +88 -11
- package/src/duckdb/src/parser/tableref/subqueryref.cpp +17 -2
- package/src/duckdb/src/parser/tableref/table_function.cpp +19 -2
- package/src/duckdb/src/parser/tableref.cpp +47 -1
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +8 -8
- package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +16 -5
- package/src/duckdb/src/parser/transform/expression/transform_bool_expr.cpp +6 -6
- package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +39 -0
- package/src/duckdb/src/parser/transform/expression/transform_case.cpp +3 -3
- package/src/duckdb/src/parser/transform/expression/transform_cast.cpp +2 -2
- package/src/duckdb/src/parser/transform/expression/transform_coalesce.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +19 -4
- package/src/duckdb/src/parser/transform/expression/transform_constant.cpp +7 -7
- package/src/duckdb/src/parser/transform/expression/transform_expression.cpp +5 -2
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +111 -121
- package/src/duckdb/src/parser/transform/expression/transform_grouping_function.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_interval.cpp +5 -5
- package/src/duckdb/src/parser/transform/expression/transform_lambda.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +29 -25
- package/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +11 -11
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +5 -5
- package/src/duckdb/src/parser/transform/helpers/transform_groupby.cpp +11 -4
- package/src/duckdb/src/parser/transform/helpers/transform_orderby.cpp +0 -7
- package/src/duckdb/src/parser/transform/helpers/transform_sample.cpp +1 -1
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +3 -2
- package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +5 -4
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +15 -11
- package/src/duckdb/src/parser/transform/statement/transform_attach.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_call.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_database.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +5 -8
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +4 -4
- package/src/duckdb/src/parser/transform/statement/transform_create_schema.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_create_sequence.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +2 -3
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +4 -6
- package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_detach.cpp +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_explain.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_export.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_import.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +7 -9
- package/src/duckdb/src/parser/transform/statement/transform_load.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +91 -38
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +7 -7
- package/src/duckdb/src/parser/transform/statement/transform_prepare.cpp +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +8 -9
- package/src/duckdb/src/parser/transform/statement/transform_select.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +57 -54
- package/src/duckdb/src/parser/transform/statement/transform_set.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +5 -5
- package/src/duckdb/src/parser/transform/statement/transform_show_select.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_transaction.cpp +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_upsert.cpp +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_use.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_vacuum.cpp +1 -1
- package/src/duckdb/src/parser/transform/tableref/transform_base_tableref.cpp +1 -1
- package/src/duckdb/src/parser/transform/tableref/transform_from.cpp +3 -3
- package/src/duckdb/src/parser/transform/tableref/transform_join.cpp +9 -2
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +26 -7
- package/src/duckdb/src/parser/transform/tableref/transform_subquery.cpp +2 -2
- package/src/duckdb/src/parser/transform/tableref/transform_table_function.cpp +1 -1
- package/src/duckdb/src/parser/transformer.cpp +54 -12
- package/src/duckdb/src/planner/bind_context.cpp +89 -105
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +38 -39
- package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +21 -21
- package/src/duckdb/src/planner/binder/expression/bind_case_expression.cpp +10 -10
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +7 -7
- package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +7 -7
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +68 -18
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +22 -22
- package/src/duckdb/src/planner/binder/expression/bind_conjunction_expression.cpp +3 -4
- package/src/duckdb/src/planner/binder/expression/bind_constant_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +62 -51
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +14 -13
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +11 -11
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +35 -22
- package/src/duckdb/src/planner/binder/expression/bind_parameter_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +176 -0
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +13 -9
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +167 -28
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +35 -43
- package/src/duckdb/src/planner/binder/query_node/bind_recursive_cte_node.cpp +1 -1
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +135 -137
- package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +18 -18
- package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +5 -5
- package/src/duckdb/src/planner/binder/query_node/plan_query_node.cpp +17 -6
- package/src/duckdb/src/planner/binder/query_node/plan_recursive_cte_node.cpp +4 -5
- package/src/duckdb/src/planner/binder/query_node/plan_select_node.cpp +28 -24
- package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +6 -7
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +34 -36
- package/src/duckdb/src/planner/binder/statement/bind_attach.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_call.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +38 -25
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +113 -111
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +37 -30
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +10 -10
- package/src/duckdb/src/planner/binder/statement/bind_detach.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +5 -5
- package/src/duckdb/src/planner/binder/statement/bind_execute.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_explain.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +30 -31
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +52 -44
- package/src/duckdb/src/planner/binder/statement/bind_load.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +5 -5
- package/src/duckdb/src/planner/binder/statement/bind_prepare.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_set.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_show.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +7 -6
- package/src/duckdb/src/planner/binder/statement/bind_summarize.cpp +28 -28
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +29 -27
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +10 -9
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +40 -37
- package/src/duckdb/src/planner/binder/tableref/bind_emptytableref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_expressionlistref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +36 -27
- package/src/duckdb/src/planner/binder/tableref/bind_named_parameters.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +324 -98
- package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +7 -7
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +49 -31
- package/src/duckdb/src/planner/binder/tableref/plan_cteref.cpp +2 -1
- package/src/duckdb/src/planner/binder/tableref/plan_dummytableref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/plan_expressionlistref.cpp +3 -3
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +78 -30
- package/src/duckdb/src/planner/binder/tableref/plan_pivotref.cpp +13 -0
- package/src/duckdb/src/planner/binder.cpp +86 -96
- package/src/duckdb/src/planner/bound_result_modifier.cpp +26 -0
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +20 -13
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +9 -9
- package/src/duckdb/src/planner/expression/bound_case_expression.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +8 -9
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +21 -7
- package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +5 -6
- package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_expression.cpp +15 -2
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -8
- package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +12 -6
- package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +20 -21
- package/src/duckdb/src/planner/expression.cpp +2 -1
- package/src/duckdb/src/planner/expression_binder/aggregate_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +4 -4
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +153 -0
- package/src/duckdb/src/planner/expression_binder/check_binder.cpp +7 -7
- package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/constant_binder.cpp +13 -3
- package/src/duckdb/src/planner/expression_binder/group_binder.cpp +6 -6
- package/src/duckdb/src/planner/expression_binder/having_binder.cpp +11 -8
- package/src/duckdb/src/planner/expression_binder/index_binder.cpp +6 -5
- package/src/duckdb/src/planner/expression_binder/insert_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +6 -6
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +8 -8
- package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +9 -8
- package/src/duckdb/src/planner/expression_binder/relation_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/returning_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/select_binder.cpp +1 -132
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +10 -6
- package/src/duckdb/src/planner/expression_binder/update_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/where_binder.cpp +6 -5
- package/src/duckdb/src/planner/expression_binder.cpp +50 -51
- package/src/duckdb/src/planner/expression_iterator.cpp +34 -27
- package/src/duckdb/src/planner/filter/conjunction_filter.cpp +2 -2
- package/src/duckdb/src/planner/filter/constant_filter.cpp +1 -1
- package/src/duckdb/src/planner/filter/null_filter.cpp +2 -2
- package/src/duckdb/src/planner/joinside.cpp +5 -5
- package/src/duckdb/src/planner/logical_operator.cpp +10 -2
- package/src/duckdb/src/planner/logical_operator_visitor.cpp +32 -26
- package/src/duckdb/src/planner/operator/logical_aggregate.cpp +15 -3
- package/src/duckdb/src/planner/operator/logical_any_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_asof_join.cpp +14 -0
- package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +13 -2
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +5 -5
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +6 -9
- package/src/duckdb/src/planner/operator/logical_create.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +4 -4
- package/src/duckdb/src/planner/operator/logical_create_table.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_cross_product.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_cteref.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_delete.cpp +20 -8
- package/src/duckdb/src/planner/operator/logical_delim_get.cpp +13 -2
- package/src/duckdb/src/planner/operator/logical_delim_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +6 -1
- package/src/duckdb/src/planner/operator/logical_dummy_scan.cpp +13 -2
- package/src/duckdb/src/planner/operator/logical_expression_get.cpp +13 -2
- package/src/duckdb/src/planner/operator/logical_filter.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_get.cpp +12 -6
- package/src/duckdb/src/planner/operator/logical_insert.cpp +19 -14
- package/src/duckdb/src/planner/operator/logical_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_limit.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_limit_percent.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_order.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +46 -0
- package/src/duckdb/src/planner/operator/logical_positional_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_projection.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_reset.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_sample.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_set.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_set_operation.cpp +11 -0
- package/src/duckdb/src/planner/operator/logical_simple.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_top_n.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_unnest.cpp +13 -2
- package/src/duckdb/src/planner/operator/logical_update.cpp +19 -12
- package/src/duckdb/src/planner/operator/logical_window.cpp +12 -1
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +6 -28
- package/src/duckdb/src/planner/planner.cpp +2 -1
- package/src/duckdb/src/planner/pragma_handler.cpp +12 -11
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +64 -60
- package/src/duckdb/src/planner/subquery/rewrite_correlated_expressions.cpp +5 -6
- package/src/duckdb/src/planner/table_binding.cpp +18 -17
- package/src/duckdb/src/planner/table_filter.cpp +2 -2
- package/src/duckdb/src/storage/arena_allocator.cpp +34 -2
- package/src/duckdb/src/storage/buffer/block_handle.cpp +129 -0
- package/src/duckdb/src/storage/buffer/block_manager.cpp +82 -0
- package/src/duckdb/src/storage/buffer/buffer_handle.cpp +1 -0
- package/src/duckdb/src/storage/buffer/buffer_pool.cpp +136 -0
- package/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp +35 -0
- package/src/duckdb/src/storage/buffer_manager.cpp +35 -1077
- package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +4 -12
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +9 -3
- package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +2 -2
- package/src/duckdb/src/storage/checkpoint_manager.cpp +84 -76
- package/src/duckdb/src/storage/compression/bitpacking.cpp +9 -10
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +12 -13
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +6 -5
- package/src/duckdb/src/storage/compression/fsst.cpp +15 -17
- package/src/duckdb/src/storage/compression/numeric_constant.cpp +3 -3
- package/src/duckdb/src/storage/compression/rle.cpp +8 -9
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +7 -7
- package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +4 -4
- package/src/duckdb/src/storage/data_table.cpp +59 -52
- package/src/duckdb/src/storage/index.cpp +32 -10
- package/src/duckdb/src/storage/local_storage.cpp +134 -191
- package/src/duckdb/src/storage/meta_block_reader.cpp +23 -0
- package/src/duckdb/src/storage/meta_block_writer.cpp +4 -0
- package/src/duckdb/src/storage/optimistic_data_writer.cpp +96 -0
- package/src/duckdb/src/storage/partial_block_manager.cpp +83 -12
- package/src/duckdb/src/storage/single_file_block_manager.cpp +19 -10
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +800 -0
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +3 -0
- package/src/duckdb/src/storage/statistics/column_statistics.cpp +2 -3
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +7 -3
- package/src/duckdb/src/storage/statistics/list_stats.cpp +6 -2
- package/src/duckdb/src/storage/statistics/numeric_stats.cpp +145 -83
- package/src/duckdb/src/storage/statistics/numeric_stats_union.cpp +65 -0
- package/src/duckdb/src/storage/statistics/string_stats.cpp +2 -2
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +3 -1
- package/src/duckdb/src/storage/storage_info.cpp +1 -1
- package/src/duckdb/src/storage/storage_lock.cpp +2 -2
- package/src/duckdb/src/storage/storage_manager.cpp +25 -21
- package/src/duckdb/src/storage/table/chunk_info.cpp +2 -2
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +96 -73
- package/src/duckdb/src/storage/table/column_data.cpp +118 -93
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +32 -18
- package/src/duckdb/src/storage/table/column_segment.cpp +52 -66
- package/src/duckdb/src/storage/table/list_column_data.cpp +20 -27
- package/src/duckdb/src/storage/table/persistent_table_data.cpp +2 -1
- package/src/duckdb/src/storage/table/row_group.cpp +220 -152
- package/src/duckdb/src/storage/table/row_group_collection.cpp +150 -98
- package/src/duckdb/src/storage/table/scan_state.cpp +46 -34
- package/src/duckdb/src/storage/table/standard_column_data.cpp +13 -18
- package/src/duckdb/src/storage/table/struct_column_data.cpp +22 -34
- package/src/duckdb/src/storage/table/table_statistics.cpp +1 -1
- package/src/duckdb/src/storage/table/update_segment.cpp +22 -40
- package/src/duckdb/src/storage/table/validity_column_data.cpp +2 -6
- package/src/duckdb/src/storage/table_index_list.cpp +3 -3
- package/src/duckdb/src/storage/wal_replay.cpp +38 -37
- package/src/duckdb/src/storage/write_ahead_log.cpp +47 -47
- package/src/duckdb/src/transaction/cleanup_state.cpp +17 -11
- package/src/duckdb/src/transaction/commit_state.cpp +72 -69
- package/src/duckdb/src/transaction/duck_transaction.cpp +9 -10
- package/src/duckdb/src/transaction/duck_transaction_manager.cpp +4 -4
- package/src/duckdb/src/transaction/meta_transaction.cpp +13 -13
- package/src/duckdb/src/transaction/rollback_state.cpp +2 -2
- package/src/duckdb/src/transaction/transaction.cpp +1 -1
- package/src/duckdb/src/transaction/transaction_context.cpp +2 -2
- package/src/duckdb/src/transaction/undo_buffer.cpp +10 -1
- package/src/duckdb/src/verification/copied_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +4 -4
- package/src/duckdb/src/verification/deserialized_statement_verifier_v2.cpp +20 -0
- package/src/duckdb/src/verification/external_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/no_operator_caching_verifier.cpp +13 -0
- package/src/duckdb/src/verification/parsed_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/prepared_statement_verifier.cpp +7 -7
- package/src/duckdb/src/verification/statement_verifier.cpp +10 -3
- package/src/duckdb/src/verification/unoptimized_statement_verifier.cpp +1 -1
- package/src/duckdb/third_party/fmt/format.cc +0 -5
- package/src/duckdb/third_party/fmt/include/fmt/core.h +10 -12
- package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +2 -33
- package/src/duckdb/third_party/fmt/include/fmt/format.h +61 -24
- package/src/duckdb/third_party/fmt/include/fmt/printf.h +15 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +32 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +3 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/primnodes.hpp +3 -3
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +949 -965
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +2 -11
- package/src/duckdb/third_party/libpg_query/include/postgres_parser.hpp +3 -2
- package/src/duckdb/third_party/libpg_query/postgres_parser.cpp +5 -6
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +18482 -17953
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +503 -493
- package/src/duckdb/third_party/parquet/parquet_types.cpp +32 -32
- package/src/duckdb/third_party/parquet/parquet_types.h +34 -32
- package/src/duckdb/third_party/re2/re2/re2.cc +9 -0
- package/src/duckdb/third_party/re2/re2/re2.h +2 -0
- package/src/duckdb/third_party/thrift/thrift/TToString.h +3 -3
- package/src/duckdb/third_party/thrift/thrift/protocol/TProtocol.h +1 -1
- package/src/duckdb/third_party/thrift/thrift/protocol/TProtocolDecorator.h +2 -1
- package/src/duckdb/third_party/thrift/thrift/protocol/TVirtualProtocol.h +5 -4
- package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +1 -0
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +6 -6
- package/src/duckdb/ub_extension_json_json_functions.cpp +2 -0
- package/src/duckdb/ub_src_common.cpp +6 -0
- package/src/duckdb/ub_src_common_adbc.cpp +4 -0
- package/src/duckdb/ub_src_common_enums.cpp +2 -0
- package/src/duckdb/ub_src_common_serializer.cpp +4 -0
- package/src/duckdb/ub_src_common_sort.cpp +2 -0
- package/src/duckdb/ub_src_common_types.cpp +1 -15
- package/src/duckdb/ub_src_common_types_column.cpp +10 -0
- package/src/duckdb/ub_src_common_types_row.cpp +20 -0
- package/src/duckdb/ub_src_core_functions.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp +8 -0
- package/src/duckdb/ub_src_core_functions_aggregate_distributive.cpp +24 -0
- package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +8 -0
- package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_aggregate_regression.cpp +14 -0
- package/src/duckdb/ub_src_core_functions_scalar_bit.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_blob.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_date.cpp +22 -0
- package/src/duckdb/ub_src_core_functions_scalar_enum.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +16 -0
- package/src/duckdb/ub_src_core_functions_scalar_list.cpp +14 -0
- package/src/duckdb/ub_src_core_functions_scalar_map.cpp +14 -0
- package/src/duckdb/ub_src_core_functions_scalar_math.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_operators.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_random.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +46 -0
- package/src/duckdb/ub_src_core_functions_scalar_struct.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_union.cpp +6 -0
- package/src/duckdb/ub_src_execution_index_art.cpp +7 -1
- package/src/duckdb/ub_src_execution_operator_join.cpp +2 -0
- package/src/duckdb/ub_src_execution_operator_persistent.cpp +4 -0
- package/src/duckdb/ub_src_execution_operator_projection.cpp +2 -0
- package/src/duckdb/ub_src_execution_physical_plan.cpp +4 -0
- package/src/duckdb/ub_src_function_aggregate.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_distributive.cpp +0 -24
- package/src/duckdb/ub_src_function_scalar.cpp +2 -8
- package/src/duckdb/ub_src_function_scalar_generic.cpp +0 -12
- package/src/duckdb/ub_src_function_scalar_list.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_operators.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_string.cpp +0 -38
- package/src/duckdb/ub_src_function_scalar_string_regexp.cpp +4 -0
- package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -4
- package/src/duckdb/ub_src_function_scalar_system.cpp +0 -2
- package/src/duckdb/ub_src_function_table.cpp +2 -0
- package/src/duckdb/ub_src_main.cpp +2 -0
- package/src/duckdb/ub_src_main_extension.cpp +2 -0
- package/src/duckdb/ub_src_optimizer_rule.cpp +2 -0
- package/src/duckdb/ub_src_parallel.cpp +2 -0
- package/src/duckdb/ub_src_parser.cpp +2 -0
- package/src/duckdb/ub_src_parser_transform_expression.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_expression.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_tableref.cpp +2 -0
- package/src/duckdb/ub_src_planner_expression_binder.cpp +2 -0
- package/src/duckdb/ub_src_planner_operator.cpp +4 -0
- package/src/duckdb/ub_src_storage.cpp +4 -0
- package/src/duckdb/ub_src_storage_buffer.cpp +8 -0
- package/src/duckdb/ub_src_storage_statistics.cpp +2 -0
- package/src/duckdb/ub_src_storage_table.cpp +0 -2
- package/src/duckdb_node.hpp +15 -10
- package/src/statement.cpp +31 -27
- package/src/utils.cpp +27 -2
- package/test/extension.test.ts +44 -26
- package/test/syntax_error.test.ts +3 -1
- package/test/udf.test.ts +9 -0
- package/filelist.cache +0 -0
- package/src/duckdb/extension/parquet/include/generated_column_reader.hpp +0 -55
- package/src/duckdb/src/function/aggregate/algebraic/corr.cpp +0 -14
- package/src/duckdb/src/function/aggregate/algebraic/covar.cpp +0 -25
- package/src/duckdb/src/function/aggregate/algebraic/stddev.cpp +0 -54
- package/src/duckdb/src/function/aggregate/algebraic_functions.cpp +0 -21
- package/src/duckdb/src/function/aggregate/holistic_functions.cpp +0 -12
- package/src/duckdb/src/function/aggregate/nested/list.cpp +0 -956
- package/src/duckdb/src/function/aggregate/nested_functions.cpp +0 -10
- package/src/duckdb/src/function/aggregate/regression_functions.cpp +0 -21
- package/src/duckdb/src/function/scalar/date_functions.cpp +0 -22
- package/src/duckdb/src/function/scalar/enum_functions.cpp +0 -13
- package/src/duckdb/src/function/scalar/map/map_extract.cpp +0 -95
- package/src/duckdb/src/function/scalar/math_functions.cpp +0 -46
- package/src/duckdb/src/function/scalar/trigonometrics_functions.cpp +0 -18
- package/src/duckdb/src/include/duckdb/common/single_thread_ptr.hpp +0 -183
- package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +0 -56
- package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +0 -33
- package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +0 -26
- package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +0 -53
- package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +0 -32
- package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +0 -24
- package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +0 -73
- package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +0 -37
- package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +0 -125
- package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +0 -49
- package/src/duckdb/src/storage/table/segment_tree.cpp +0 -179
- package/src/duckdb/ub_src_function_aggregate_algebraic.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_holistic.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_nested.cpp +0 -4
- package/src/duckdb/ub_src_function_aggregate_regression.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_bit.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_blob.cpp +0 -4
- package/src/duckdb/ub_src_function_scalar_date.cpp +0 -22
- package/src/duckdb/ub_src_function_scalar_enum.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_map.cpp +0 -12
- package/src/duckdb/ub_src_function_scalar_math.cpp +0 -6
- package/src/duckdb/ub_src_function_scalar_union.cpp +0 -6
@@ -7,6 +7,7 @@
|
|
7
7
|
#include "duckdb/planner/operator/list.hpp"
|
8
8
|
|
9
9
|
#include <algorithm>
|
10
|
+
#include <cmath>
|
10
11
|
|
11
12
|
namespace std {
|
12
13
|
|
@@ -14,7 +15,7 @@ namespace std {
|
|
14
15
|
template <>
|
15
16
|
struct hash<duckdb::JoinNode> {
|
16
17
|
inline string operator()(const duckdb::JoinNode &join_node) const {
|
17
|
-
return join_node.set
|
18
|
+
return join_node.set.ToString();
|
18
19
|
}
|
19
20
|
};
|
20
21
|
} // namespace std
|
@@ -35,7 +36,7 @@ static bool Disjoint(unordered_set<T> &a, unordered_set<T> &b) {
|
|
35
36
|
//! Extract the set of relations referred to inside an expression
|
36
37
|
bool JoinOrderOptimizer::ExtractBindings(Expression &expression, unordered_set<idx_t> &bindings) {
|
37
38
|
if (expression.type == ExpressionType::BOUND_COLUMN_REF) {
|
38
|
-
auto &colref = (
|
39
|
+
auto &colref = expression.Cast<BoundColumnRefExpression>();
|
39
40
|
D_ASSERT(colref.depth == 0);
|
40
41
|
D_ASSERT(colref.binding.table_index != DConstants::INVALID_INDEX);
|
41
42
|
// map the base table index to the relation index used by the JoinOrderOptimizer
|
@@ -65,7 +66,7 @@ void JoinOrderOptimizer::GetColumnBinding(Expression &expression, ColumnBinding
|
|
65
66
|
if (expression.type == ExpressionType::BOUND_COLUMN_REF) {
|
66
67
|
// Here you have a filter on a single column in a table. Return a binding for the column
|
67
68
|
// being filtered on so the filter estimator knows what HLL count to pull
|
68
|
-
auto &colref = (
|
69
|
+
auto &colref = expression.Cast<BoundColumnRefExpression>();
|
69
70
|
D_ASSERT(colref.depth == 0);
|
70
71
|
D_ASSERT(colref.binding.table_index != DConstants::INVALID_INDEX);
|
71
72
|
// map the base table index to the relation index used by the JoinOrderOptimizer
|
@@ -81,25 +82,27 @@ static unique_ptr<LogicalOperator> PushFilter(unique_ptr<LogicalOperator> node,
|
|
81
82
|
// first check if we have any filter to push it into
|
82
83
|
if (node->type != LogicalOperatorType::LOGICAL_FILTER) {
|
83
84
|
// we don't, we need to create one
|
84
|
-
auto filter =
|
85
|
+
auto filter = make_uniq<LogicalFilter>();
|
85
86
|
filter->children.push_back(std::move(node));
|
86
87
|
node = std::move(filter);
|
87
88
|
}
|
88
89
|
// push the filter into the LogicalFilter
|
89
90
|
D_ASSERT(node->type == LogicalOperatorType::LOGICAL_FILTER);
|
90
|
-
auto filter =
|
91
|
-
filter
|
91
|
+
auto &filter = node->Cast<LogicalFilter>();
|
92
|
+
filter.expressions.push_back(std::move(expr));
|
92
93
|
return node;
|
93
94
|
}
|
94
95
|
|
95
|
-
bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op,
|
96
|
-
LogicalOperator
|
96
|
+
bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op,
|
97
|
+
vector<reference<LogicalOperator>> &filter_operators,
|
98
|
+
optional_ptr<LogicalOperator> parent) {
|
97
99
|
LogicalOperator *op = &input_op;
|
98
|
-
while (op->children.size() == 1 &&
|
99
|
-
|
100
|
+
while (op->children.size() == 1 &&
|
101
|
+
(op->type != LogicalOperatorType::LOGICAL_PROJECTION &&
|
102
|
+
op->type != LogicalOperatorType::LOGICAL_EXPRESSION_GET && op->type != LogicalOperatorType::LOGICAL_GET)) {
|
100
103
|
if (op->type == LogicalOperatorType::LOGICAL_FILTER) {
|
101
104
|
// extract join conditions from filter
|
102
|
-
filter_operators.push_back(op);
|
105
|
+
filter_operators.push_back(*op);
|
103
106
|
}
|
104
107
|
if (op->type == LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY ||
|
105
108
|
op->type == LogicalOperatorType::LOGICAL_WINDOW) {
|
@@ -113,16 +116,16 @@ bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op, vector<
|
|
113
116
|
bool non_reorderable_operation = false;
|
114
117
|
if (op->type == LogicalOperatorType::LOGICAL_UNION || op->type == LogicalOperatorType::LOGICAL_EXCEPT ||
|
115
118
|
op->type == LogicalOperatorType::LOGICAL_INTERSECT || op->type == LogicalOperatorType::LOGICAL_DELIM_JOIN ||
|
116
|
-
op->type == LogicalOperatorType::LOGICAL_ANY_JOIN) {
|
119
|
+
op->type == LogicalOperatorType::LOGICAL_ANY_JOIN || op->type == LogicalOperatorType::LOGICAL_ASOF_JOIN) {
|
117
120
|
// set operation, optimize separately in children
|
118
121
|
non_reorderable_operation = true;
|
119
122
|
}
|
120
123
|
|
121
124
|
if (op->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN) {
|
122
|
-
auto &join = (
|
125
|
+
auto &join = op->Cast<LogicalComparisonJoin>();
|
123
126
|
if (join.join_type == JoinType::INNER) {
|
124
127
|
// extract join conditions from inner join
|
125
|
-
filter_operators.push_back(op);
|
128
|
+
filter_operators.push_back(*op);
|
126
129
|
} else {
|
127
130
|
// non-inner join, not reorderable yet
|
128
131
|
non_reorderable_operation = true;
|
@@ -138,7 +141,7 @@ bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op, vector<
|
|
138
141
|
std::swap(join.children[0], join.children[1]);
|
139
142
|
for (auto &cond : join.conditions) {
|
140
143
|
std::swap(cond.left, cond.right);
|
141
|
-
cond.comparison =
|
144
|
+
cond.comparison = FlipComparisonExpression(cond.comparison);
|
142
145
|
}
|
143
146
|
}
|
144
147
|
}
|
@@ -156,7 +159,7 @@ bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op, vector<
|
|
156
159
|
vector<column_binding_map_t<ColumnBinding>> child_binding_maps;
|
157
160
|
idx_t child_bindings_it = 0;
|
158
161
|
for (auto &child : op->children) {
|
159
|
-
child_binding_maps.emplace_back(
|
162
|
+
child_binding_maps.emplace_back();
|
160
163
|
JoinOrderOptimizer optimizer(context);
|
161
164
|
child = optimizer.Optimize(std::move(child));
|
162
165
|
// save the relation bindings from the optimized child. These later all get added to the
|
@@ -172,7 +175,7 @@ bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op, vector<
|
|
172
175
|
unordered_set<idx_t> bindings;
|
173
176
|
LogicalJoin::GetTableReferences(*op, bindings);
|
174
177
|
// now create the relation that refers to all these bindings
|
175
|
-
auto relation =
|
178
|
+
auto relation = make_uniq<SingleJoinRelation>(input_op, parent);
|
176
179
|
auto relation_id = relations.size();
|
177
180
|
// Add binding information from the nonreorderable join to this relation.
|
178
181
|
for (idx_t it : bindings) {
|
@@ -184,6 +187,7 @@ bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op, vector<
|
|
184
187
|
}
|
185
188
|
|
186
189
|
switch (op->type) {
|
190
|
+
case LogicalOperatorType::LOGICAL_ASOF_JOIN:
|
187
191
|
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
|
188
192
|
case LogicalOperatorType::LOGICAL_CROSS_PRODUCT: {
|
189
193
|
// inner join or cross product
|
@@ -191,53 +195,51 @@ bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op, vector<
|
|
191
195
|
bool can_reorder_right = ExtractJoinRelations(*op->children[1], filter_operators, op);
|
192
196
|
return can_reorder_left && can_reorder_right;
|
193
197
|
}
|
194
|
-
case LogicalOperatorType::LOGICAL_GET: {
|
195
|
-
// base table scan, add to set of relations
|
196
|
-
auto get = (LogicalGet *)op;
|
197
|
-
auto relation = make_unique<SingleJoinRelation>(&input_op, parent);
|
198
|
-
idx_t relation_id = relations.size();
|
199
|
-
//! make sure the optimizer has knowledge of the exact column bindings as well.
|
200
|
-
auto table_index = get->table_index;
|
201
|
-
relation_mapping[table_index] = relation_id;
|
202
|
-
cardinality_estimator.AddRelationColumnMapping(get, relation_id);
|
203
|
-
relations.push_back(std::move(relation));
|
204
|
-
return true;
|
205
|
-
}
|
206
198
|
case LogicalOperatorType::LOGICAL_EXPRESSION_GET: {
|
207
199
|
// base table scan, add to set of relations
|
208
|
-
auto get = (
|
209
|
-
auto relation =
|
200
|
+
auto &get = op->Cast<LogicalExpressionGet>();
|
201
|
+
auto relation = make_uniq<SingleJoinRelation>(input_op, parent);
|
210
202
|
//! make sure the optimizer has knowledge of the exact column bindings as well.
|
211
|
-
relation_mapping[get
|
203
|
+
relation_mapping[get.table_index] = relations.size();
|
212
204
|
relations.push_back(std::move(relation));
|
213
205
|
return true;
|
214
206
|
}
|
215
207
|
case LogicalOperatorType::LOGICAL_DUMMY_SCAN: {
|
216
208
|
// table function call, add to set of relations
|
217
|
-
auto dummy_scan = (
|
218
|
-
auto relation =
|
219
|
-
relation_mapping[dummy_scan
|
209
|
+
auto &dummy_scan = op->Cast<LogicalDummyScan>();
|
210
|
+
auto relation = make_uniq<SingleJoinRelation>(input_op, parent);
|
211
|
+
relation_mapping[dummy_scan.table_index] = relations.size();
|
220
212
|
relations.push_back(std::move(relation));
|
221
213
|
return true;
|
222
214
|
}
|
215
|
+
case LogicalOperatorType::LOGICAL_GET:
|
223
216
|
case LogicalOperatorType::LOGICAL_PROJECTION: {
|
224
|
-
auto
|
217
|
+
auto table_index = op->GetTableIndex()[0];
|
218
|
+
auto relation = make_uniq<SingleJoinRelation>(input_op, parent);
|
219
|
+
auto relation_id = relations.size();
|
220
|
+
|
221
|
+
// If the children are empty, operator can't ge a logical get.
|
222
|
+
if (op->children.empty() && op->type == LogicalOperatorType::LOGICAL_GET) {
|
223
|
+
auto &get = op->Cast<LogicalGet>();
|
224
|
+
cardinality_estimator.AddRelationColumnMapping(get, relation_id);
|
225
|
+
relation_mapping[table_index] = relation_id;
|
226
|
+
relations.push_back(std::move(relation));
|
227
|
+
return true;
|
228
|
+
}
|
229
|
+
|
225
230
|
// we run the join order optimizer within the subquery as well
|
226
231
|
JoinOrderOptimizer optimizer(context);
|
227
232
|
op->children[0] = optimizer.Optimize(std::move(op->children[0]));
|
228
|
-
// projection, add to the set of relations
|
229
|
-
auto relation = make_unique<SingleJoinRelation>(&input_op, parent);
|
230
|
-
auto relation_id = relations.size();
|
231
233
|
// push one child column binding map back.
|
232
234
|
vector<column_binding_map_t<ColumnBinding>> child_binding_maps;
|
233
|
-
child_binding_maps.emplace_back(
|
235
|
+
child_binding_maps.emplace_back();
|
234
236
|
optimizer.cardinality_estimator.CopyRelationMap(child_binding_maps.at(0));
|
235
|
-
// This logical projection may sit on top of a logical comparison join that has been pushed down
|
237
|
+
// This logical projection/get may sit on top of a logical comparison join that has been pushed down
|
236
238
|
// we want to copy the binding info of both tables
|
237
|
-
relation_mapping[
|
239
|
+
relation_mapping[table_index] = relation_id;
|
238
240
|
for (auto &binding_info : child_binding_maps.at(0)) {
|
239
241
|
cardinality_estimator.AddRelationToColumnMapping(
|
240
|
-
ColumnBinding(
|
242
|
+
ColumnBinding(table_index, binding_info.first.column_index), binding_info.second);
|
241
243
|
cardinality_estimator.AddColumnToRelationMap(binding_info.second.table_index,
|
242
244
|
binding_info.second.column_index);
|
243
245
|
}
|
@@ -250,26 +252,26 @@ bool JoinOrderOptimizer::ExtractJoinRelations(LogicalOperator &input_op, vector<
|
|
250
252
|
}
|
251
253
|
|
252
254
|
//! Update the exclusion set with all entries in the subgraph
|
253
|
-
static void UpdateExclusionSet(JoinRelationSet
|
254
|
-
for (idx_t i = 0; i < node
|
255
|
-
exclusion_set.insert(node
|
255
|
+
static void UpdateExclusionSet(JoinRelationSet &node, unordered_set<idx_t> &exclusion_set) {
|
256
|
+
for (idx_t i = 0; i < node.count; i++) {
|
257
|
+
exclusion_set.insert(node.relations[i]);
|
256
258
|
}
|
257
259
|
}
|
258
260
|
|
259
261
|
//! Create a new JoinTree node by joining together two previous JoinTree nodes
|
260
|
-
unique_ptr<JoinNode> JoinOrderOptimizer::CreateJoinTree(JoinRelationSet
|
261
|
-
const vector<NeighborInfo
|
262
|
-
JoinNode
|
262
|
+
unique_ptr<JoinNode> JoinOrderOptimizer::CreateJoinTree(JoinRelationSet &set,
|
263
|
+
const vector<reference<NeighborInfo>> &possible_connections,
|
264
|
+
JoinNode &left, JoinNode &right) {
|
263
265
|
// for the hash join we want the right side (build side) to have the smallest cardinality
|
264
266
|
// also just a heuristic but for now...
|
265
267
|
// FIXME: we should probably actually benchmark that as well
|
266
268
|
// FIXME: should consider different join algorithms, should we pick a join algorithm here as well? (probably)
|
267
269
|
double expected_cardinality;
|
268
|
-
NeighborInfo
|
269
|
-
auto plan = plans.find(set);
|
270
|
+
optional_ptr<NeighborInfo> best_connection;
|
271
|
+
auto plan = plans.find(&set);
|
270
272
|
// if we have already calculated an expected cardinality for this set,
|
271
273
|
// just re-use that cardinality
|
272
|
-
if (left
|
274
|
+
if (left.GetCardinality<double>() < right.GetCardinality<double>()) {
|
273
275
|
return CreateJoinTree(set, possible_connections, right, left);
|
274
276
|
}
|
275
277
|
if (plan != plans.end()) {
|
@@ -277,66 +279,67 @@ unique_ptr<JoinNode> JoinOrderOptimizer::CreateJoinTree(JoinRelationSet *set,
|
|
277
279
|
throw InternalException("No plan: internal error in join order optimizer");
|
278
280
|
}
|
279
281
|
expected_cardinality = plan->second->GetCardinality<double>();
|
280
|
-
best_connection = possible_connections.back();
|
282
|
+
best_connection = &possible_connections.back().get();
|
281
283
|
} else if (possible_connections.empty()) {
|
282
284
|
// cross product
|
283
285
|
expected_cardinality = cardinality_estimator.EstimateCrossProduct(left, right);
|
284
286
|
} else {
|
285
287
|
// normal join, expect foreign key join
|
286
288
|
expected_cardinality = cardinality_estimator.EstimateCardinalityWithSet(set);
|
287
|
-
best_connection = possible_connections.back();
|
289
|
+
best_connection = &possible_connections.back().get();
|
288
290
|
}
|
289
291
|
|
290
292
|
auto cost = CardinalityEstimator::ComputeCost(left, right, expected_cardinality);
|
291
|
-
auto result =
|
293
|
+
auto result = make_uniq<JoinNode>(set, best_connection, left, right, expected_cardinality, cost);
|
292
294
|
D_ASSERT(cost >= expected_cardinality);
|
293
295
|
return result;
|
294
296
|
}
|
295
297
|
|
296
|
-
bool JoinOrderOptimizer::NodeInFullPlan(JoinNode
|
297
|
-
return join_nodes_in_full_plan.find(node
|
298
|
+
bool JoinOrderOptimizer::NodeInFullPlan(JoinNode &node) {
|
299
|
+
return join_nodes_in_full_plan.find(node.set.ToString()) != join_nodes_in_full_plan.end();
|
298
300
|
}
|
299
301
|
|
300
|
-
void JoinOrderOptimizer::UpdateJoinNodesInFullPlan(JoinNode
|
301
|
-
if (
|
302
|
-
return;
|
303
|
-
}
|
304
|
-
if (node->set->count == relations.size()) {
|
302
|
+
void JoinOrderOptimizer::UpdateJoinNodesInFullPlan(JoinNode &node) {
|
303
|
+
if (node.set.count == relations.size()) {
|
305
304
|
join_nodes_in_full_plan.clear();
|
306
305
|
}
|
307
|
-
if (node
|
308
|
-
join_nodes_in_full_plan.insert(node
|
306
|
+
if (node.set.count < relations.size()) {
|
307
|
+
join_nodes_in_full_plan.insert(node.set.ToString());
|
308
|
+
}
|
309
|
+
if (node.left) {
|
310
|
+
UpdateJoinNodesInFullPlan(*node.left);
|
311
|
+
}
|
312
|
+
if (node.right) {
|
313
|
+
UpdateJoinNodesInFullPlan(*node.right);
|
309
314
|
}
|
310
|
-
UpdateJoinNodesInFullPlan(node->left);
|
311
|
-
UpdateJoinNodesInFullPlan(node->right);
|
312
315
|
}
|
313
316
|
|
314
|
-
JoinNode
|
315
|
-
const vector<NeighborInfo
|
317
|
+
JoinNode &JoinOrderOptimizer::EmitPair(JoinRelationSet &left, JoinRelationSet &right,
|
318
|
+
const vector<reference<NeighborInfo>> &info) {
|
316
319
|
// get the left and right join plans
|
317
|
-
auto &left_plan = plans[left];
|
318
|
-
auto &right_plan = plans[right];
|
320
|
+
auto &left_plan = plans[&left];
|
321
|
+
auto &right_plan = plans[&right];
|
319
322
|
if (!left_plan || !right_plan) {
|
320
323
|
throw InternalException("No left or right plan: internal error in join order optimizer");
|
321
324
|
}
|
322
|
-
auto new_set = set_manager.Union(left, right);
|
325
|
+
auto &new_set = set_manager.Union(left, right);
|
323
326
|
// create the join tree based on combining the two plans
|
324
|
-
auto new_plan = CreateJoinTree(new_set, info, left_plan
|
327
|
+
auto new_plan = CreateJoinTree(new_set, info, *left_plan, *right_plan);
|
325
328
|
// check if this plan is the optimal plan we found for this set of relations
|
326
|
-
auto entry = plans.find(new_set);
|
329
|
+
auto entry = plans.find(&new_set);
|
327
330
|
if (entry == plans.end() || new_plan->GetCost() < entry->second->GetCost()) {
|
328
331
|
// the plan is the optimal plan, move it into the dynamic programming tree
|
329
|
-
auto result = new_plan
|
332
|
+
auto &result = *new_plan;
|
330
333
|
|
331
334
|
//! make sure plans are symmetric for cardinality estimation
|
332
335
|
if (entry != plans.end()) {
|
333
|
-
cardinality_estimator.VerifySymmetry(result, entry->second
|
336
|
+
cardinality_estimator.VerifySymmetry(result, *entry->second);
|
334
337
|
}
|
335
338
|
if (full_plan_found &&
|
336
|
-
join_nodes_in_full_plan.find(new_plan->set
|
339
|
+
join_nodes_in_full_plan.find(new_plan->set.ToString()) != join_nodes_in_full_plan.end()) {
|
337
340
|
must_update_full_plan = true;
|
338
341
|
}
|
339
|
-
if (new_set
|
342
|
+
if (new_set.count == relations.size()) {
|
340
343
|
full_plan_found = true;
|
341
344
|
// If we find a full plan, we need to keep track of which nodes are in the full plan.
|
342
345
|
// It's possible the DP algorithm updates one of these nodes, then goes on to solve
|
@@ -352,14 +355,14 @@ JoinNode *JoinOrderOptimizer::EmitPair(JoinRelationSet *left, JoinRelationSet *r
|
|
352
355
|
}
|
353
356
|
|
354
357
|
D_ASSERT(new_plan);
|
355
|
-
plans[new_set] = std::move(new_plan);
|
358
|
+
plans[&new_set] = std::move(new_plan);
|
356
359
|
return result;
|
357
360
|
}
|
358
|
-
return entry->second
|
361
|
+
return *entry->second;
|
359
362
|
}
|
360
363
|
|
361
|
-
bool JoinOrderOptimizer::TryEmitPair(JoinRelationSet
|
362
|
-
const vector<NeighborInfo
|
364
|
+
bool JoinOrderOptimizer::TryEmitPair(JoinRelationSet &left, JoinRelationSet &right,
|
365
|
+
const vector<reference<NeighborInfo>> &info) {
|
363
366
|
pairs++;
|
364
367
|
// If a full plan is created, it's possible a node in the plan gets updated. When this happens, make sure you keep
|
365
368
|
// emitting pairs until you emit another final plan. Another final plan is guaranteed to be produced because of
|
@@ -374,13 +377,13 @@ bool JoinOrderOptimizer::TryEmitPair(JoinRelationSet *left, JoinRelationSet *rig
|
|
374
377
|
return true;
|
375
378
|
}
|
376
379
|
|
377
|
-
bool JoinOrderOptimizer::EmitCSG(JoinRelationSet
|
378
|
-
if (node
|
380
|
+
bool JoinOrderOptimizer::EmitCSG(JoinRelationSet &node) {
|
381
|
+
if (node.count == relations.size()) {
|
379
382
|
return true;
|
380
383
|
}
|
381
384
|
// create the exclusion set as everything inside the subgraph AND anything with members BELOW it
|
382
385
|
unordered_set<idx_t> exclusion_set;
|
383
|
-
for (idx_t i = 0; i < node
|
386
|
+
for (idx_t i = 0; i < node.relations[0]; i++) {
|
384
387
|
exclusion_set.insert(i);
|
385
388
|
}
|
386
389
|
UpdateExclusionSet(node, exclusion_set);
|
@@ -398,7 +401,7 @@ bool JoinOrderOptimizer::EmitCSG(JoinRelationSet *node) {
|
|
398
401
|
for (auto neighbor : neighbors) {
|
399
402
|
// since the GetNeighbors only returns the smallest element in a list, the entry might not be connected to
|
400
403
|
// (only!) this neighbor, hence we have to do a connectedness check before we can emit it
|
401
|
-
auto neighbor_relation = set_manager.GetJoinRelation(neighbor);
|
404
|
+
auto &neighbor_relation = set_manager.GetJoinRelation(neighbor);
|
402
405
|
auto connections = query_graph.GetConnections(node, neighbor_relation);
|
403
406
|
if (!connections.empty()) {
|
404
407
|
if (!TryEmitPair(node, neighbor_relation, connections)) {
|
@@ -412,20 +415,20 @@ bool JoinOrderOptimizer::EmitCSG(JoinRelationSet *node) {
|
|
412
415
|
return true;
|
413
416
|
}
|
414
417
|
|
415
|
-
bool JoinOrderOptimizer::EnumerateCmpRecursive(JoinRelationSet
|
418
|
+
bool JoinOrderOptimizer::EnumerateCmpRecursive(JoinRelationSet &left, JoinRelationSet &right,
|
416
419
|
unordered_set<idx_t> exclusion_set) {
|
417
420
|
// get the neighbors of the second relation under the exclusion set
|
418
421
|
auto neighbors = query_graph.GetNeighbors(right, exclusion_set);
|
419
422
|
if (neighbors.empty()) {
|
420
423
|
return true;
|
421
424
|
}
|
422
|
-
vector<JoinRelationSet
|
423
|
-
union_sets.
|
425
|
+
vector<reference<JoinRelationSet>> union_sets;
|
426
|
+
union_sets.reserve(neighbors.size());
|
424
427
|
for (idx_t i = 0; i < neighbors.size(); i++) {
|
425
|
-
auto neighbor = set_manager.GetJoinRelation(neighbors[i]);
|
428
|
+
auto &neighbor = set_manager.GetJoinRelation(neighbors[i]);
|
426
429
|
// emit the combinations of this node and its neighbors
|
427
|
-
auto combined_set = set_manager.Union(right, neighbor);
|
428
|
-
if (combined_set
|
430
|
+
auto &combined_set = set_manager.Union(right, neighbor);
|
431
|
+
if (combined_set.count > right.count && plans.find(&combined_set) != plans.end()) {
|
429
432
|
auto connections = query_graph.GetConnections(left, combined_set);
|
430
433
|
if (!connections.empty()) {
|
431
434
|
if (!TryEmitPair(left, combined_set, connections)) {
|
@@ -433,7 +436,7 @@ bool JoinOrderOptimizer::EnumerateCmpRecursive(JoinRelationSet *left, JoinRelati
|
|
433
436
|
}
|
434
437
|
}
|
435
438
|
}
|
436
|
-
union_sets
|
439
|
+
union_sets.push_back(combined_set);
|
437
440
|
}
|
438
441
|
// recursively enumerate the sets
|
439
442
|
unordered_set<idx_t> new_exclusion_set = exclusion_set;
|
@@ -447,24 +450,24 @@ bool JoinOrderOptimizer::EnumerateCmpRecursive(JoinRelationSet *left, JoinRelati
|
|
447
450
|
return true;
|
448
451
|
}
|
449
452
|
|
450
|
-
bool JoinOrderOptimizer::EnumerateCSGRecursive(JoinRelationSet
|
453
|
+
bool JoinOrderOptimizer::EnumerateCSGRecursive(JoinRelationSet &node, unordered_set<idx_t> &exclusion_set) {
|
451
454
|
// find neighbors of S under the exclusion set
|
452
455
|
auto neighbors = query_graph.GetNeighbors(node, exclusion_set);
|
453
456
|
if (neighbors.empty()) {
|
454
457
|
return true;
|
455
458
|
}
|
456
|
-
vector<JoinRelationSet
|
457
|
-
union_sets.
|
459
|
+
vector<reference<JoinRelationSet>> union_sets;
|
460
|
+
union_sets.reserve(neighbors.size());
|
458
461
|
for (idx_t i = 0; i < neighbors.size(); i++) {
|
459
|
-
auto neighbor = set_manager.GetJoinRelation(neighbors[i]);
|
462
|
+
auto &neighbor = set_manager.GetJoinRelation(neighbors[i]);
|
460
463
|
// emit the combinations of this node and its neighbors
|
461
|
-
auto new_set = set_manager.Union(node, neighbor);
|
462
|
-
if (new_set
|
464
|
+
auto &new_set = set_manager.Union(node, neighbor);
|
465
|
+
if (new_set.count > node.count && plans.find(&new_set) != plans.end()) {
|
463
466
|
if (!EmitCSG(new_set)) {
|
464
467
|
return false;
|
465
468
|
}
|
466
469
|
}
|
467
|
-
union_sets
|
470
|
+
union_sets.push_back(new_set);
|
468
471
|
}
|
469
472
|
// recursively enumerate the sets
|
470
473
|
unordered_set<idx_t> new_exclusion_set = exclusion_set;
|
@@ -486,7 +489,7 @@ bool JoinOrderOptimizer::SolveJoinOrderExactly() {
|
|
486
489
|
// we enumerate over all the possible pairs in the neighborhood
|
487
490
|
for (idx_t i = relations.size(); i > 0; i--) {
|
488
491
|
// for every node in the set, we consider it as the start node once
|
489
|
-
auto start_node = set_manager.GetJoinRelation(i - 1);
|
492
|
+
auto &start_node = set_manager.GetJoinRelation(i - 1);
|
490
493
|
// emit the start node
|
491
494
|
if (!EmitCSG(start_node)) {
|
492
495
|
return false;
|
@@ -529,8 +532,7 @@ static vector<unordered_set<idx_t>> AddSuperSets(vector<unordered_set<idx_t>> cu
|
|
529
532
|
// works by first creating all sets with cardinality 1
|
530
533
|
// then iterates over each previously created group of subsets and will only add a neighbor if the neighbor
|
531
534
|
// is greater than all relations in the set.
|
532
|
-
static vector<unordered_set<idx_t>> GetAllNeighborSets(
|
533
|
-
vector<idx_t> neighbors) {
|
535
|
+
static vector<unordered_set<idx_t>> GetAllNeighborSets(unordered_set<idx_t> &exclusion_set, vector<idx_t> neighbors) {
|
534
536
|
vector<unordered_set<idx_t>> ret;
|
535
537
|
sort(neighbors.begin(), neighbors.end());
|
536
538
|
vector<unordered_set<idx_t>> added;
|
@@ -562,25 +564,25 @@ static vector<unordered_set<idx_t>> GetAllNeighborSets(JoinRelationSet *new_set,
|
|
562
564
|
return ret;
|
563
565
|
}
|
564
566
|
|
565
|
-
void JoinOrderOptimizer::UpdateDPTree(JoinNode
|
567
|
+
void JoinOrderOptimizer::UpdateDPTree(JoinNode &new_plan) {
|
566
568
|
if (!NodeInFullPlan(new_plan)) {
|
567
569
|
// if the new node is not in the full plan, feel free to return
|
568
570
|
// because you won't be updating the full plan.
|
569
571
|
return;
|
570
572
|
}
|
571
|
-
auto new_set = new_plan
|
573
|
+
auto &new_set = new_plan.set;
|
572
574
|
// now update every plan that uses this plan
|
573
575
|
unordered_set<idx_t> exclusion_set;
|
574
|
-
for (idx_t i = 0; i < new_set
|
575
|
-
exclusion_set.insert(new_set
|
576
|
+
for (idx_t i = 0; i < new_set.count; i++) {
|
577
|
+
exclusion_set.insert(new_set.relations[i]);
|
576
578
|
}
|
577
579
|
auto neighbors = query_graph.GetNeighbors(new_set, exclusion_set);
|
578
|
-
auto all_neighbors = GetAllNeighborSets(
|
580
|
+
auto all_neighbors = GetAllNeighborSets(exclusion_set, neighbors);
|
579
581
|
for (auto neighbor : all_neighbors) {
|
580
|
-
auto neighbor_relation = set_manager.GetJoinRelation(neighbor);
|
581
|
-
auto combined_set = set_manager.Union(new_set, neighbor_relation);
|
582
|
+
auto &neighbor_relation = set_manager.GetJoinRelation(neighbor);
|
583
|
+
auto &combined_set = set_manager.Union(new_set, neighbor_relation);
|
582
584
|
|
583
|
-
auto combined_set_plan = plans.find(combined_set);
|
585
|
+
auto combined_set_plan = plans.find(&combined_set);
|
584
586
|
if (combined_set_plan == plans.end()) {
|
585
587
|
continue;
|
586
588
|
}
|
@@ -589,14 +591,14 @@ void JoinOrderOptimizer::UpdateDPTree(JoinNode *new_plan) {
|
|
589
591
|
auto connections = query_graph.GetConnections(new_set, neighbor_relation);
|
590
592
|
// recurse and update up the tree if the combined set produces a plan with a lower cost
|
591
593
|
// only recurse on neighbor relations that have plans.
|
592
|
-
auto right_plan = plans.find(neighbor_relation);
|
594
|
+
auto right_plan = plans.find(&neighbor_relation);
|
593
595
|
if (right_plan == plans.end()) {
|
594
596
|
continue;
|
595
597
|
}
|
596
|
-
auto updated_plan = EmitPair(new_set, neighbor_relation, connections);
|
598
|
+
auto &updated_plan = EmitPair(new_set, neighbor_relation, connections);
|
597
599
|
// <= because the child node has already been replaced. You need to
|
598
600
|
// replace the parent node as well in this case
|
599
|
-
if (updated_plan
|
601
|
+
if (updated_plan.GetCost() < combined_set_plan_cost) {
|
600
602
|
UpdateDPTree(updated_plan);
|
601
603
|
}
|
602
604
|
}
|
@@ -606,7 +608,7 @@ void JoinOrderOptimizer::SolveJoinOrderApproximately() {
|
|
606
608
|
// at this point, we exited the dynamic programming but did not compute the final join order because it took too
|
607
609
|
// long instead, we use a greedy heuristic to obtain a join ordering now we use Greedy Operator Ordering to
|
608
610
|
// construct the result tree first we start out with all the base relations (the to-be-joined relations)
|
609
|
-
vector<JoinRelationSet
|
611
|
+
vector<reference<JoinRelationSet>> join_relations; // T in the paper
|
610
612
|
for (idx_t i = 0; i < relations.size(); i++) {
|
611
613
|
join_relations.push_back(set_manager.GetJoinRelation(i));
|
612
614
|
}
|
@@ -615,7 +617,7 @@ void JoinOrderOptimizer::SolveJoinOrderApproximately() {
|
|
615
617
|
// smallest cost. This is O(r^2) per step, and every step will reduce the total amount of relations to-be-joined
|
616
618
|
// by 1, so the total cost is O(r^3) in the amount of relations
|
617
619
|
idx_t best_left = 0, best_right = 0;
|
618
|
-
JoinNode
|
620
|
+
optional_ptr<JoinNode> best_connection;
|
619
621
|
for (idx_t i = 0; i < join_relations.size(); i++) {
|
620
622
|
auto left = join_relations[i];
|
621
623
|
for (idx_t j = i + 1; j < join_relations.size(); j++) {
|
@@ -624,7 +626,7 @@ void JoinOrderOptimizer::SolveJoinOrderApproximately() {
|
|
624
626
|
auto connection = query_graph.GetConnections(left, right);
|
625
627
|
if (!connection.empty()) {
|
626
628
|
// we can check the cost of this connection
|
627
|
-
auto node = EmitPair(left, right, connection);
|
629
|
+
auto &node = EmitPair(left, right, connection);
|
628
630
|
|
629
631
|
// update the DP tree in case a plan created by the DP algorithm uses the node
|
630
632
|
// that was potentially just updated by EmitPair. You will get a use-after-free
|
@@ -632,9 +634,9 @@ void JoinOrderOptimizer::SolveJoinOrderApproximately() {
|
|
632
634
|
// if node in FullPath, then updateDP tree.
|
633
635
|
UpdateDPTree(node);
|
634
636
|
|
635
|
-
if (!best_connection || node
|
637
|
+
if (!best_connection || node.GetCost() < best_connection->GetCost()) {
|
636
638
|
// best pair found so far
|
637
|
-
best_connection = node;
|
639
|
+
best_connection = &node;
|
638
640
|
best_left = i;
|
639
641
|
best_right = j;
|
640
642
|
}
|
@@ -644,11 +646,11 @@ void JoinOrderOptimizer::SolveJoinOrderApproximately() {
|
|
644
646
|
if (!best_connection) {
|
645
647
|
// could not find a connection, but we were not done with finding a completed plan
|
646
648
|
// we have to add a cross product; we add it between the two smallest relations
|
647
|
-
JoinNode
|
649
|
+
optional_ptr<JoinNode> smallest_plans[2];
|
648
650
|
idx_t smallest_index[2];
|
649
651
|
for (idx_t i = 0; i < join_relations.size(); i++) {
|
650
652
|
// get the plan for this relation
|
651
|
-
auto current_plan = plans[join_relations[i]].get();
|
653
|
+
auto current_plan = plans[&join_relations[i].get()].get();
|
652
654
|
// check if the cardinality is smaller than the smallest two found so far
|
653
655
|
for (idx_t j = 0; j < 2; j++) {
|
654
656
|
if (!smallest_plans[j] ||
|
@@ -664,19 +666,19 @@ void JoinOrderOptimizer::SolveJoinOrderApproximately() {
|
|
664
666
|
}
|
665
667
|
D_ASSERT(smallest_plans[0] && smallest_plans[1]);
|
666
668
|
D_ASSERT(smallest_index[0] != smallest_index[1]);
|
667
|
-
auto left = smallest_plans[0]->set;
|
668
|
-
auto right = smallest_plans[1]->set;
|
669
|
+
auto &left = smallest_plans[0]->set;
|
670
|
+
auto &right = smallest_plans[1]->set;
|
669
671
|
// create a cross product edge (i.e. edge with empty filter) between these two sets in the query graph
|
670
672
|
query_graph.CreateEdge(left, right, nullptr);
|
671
673
|
// now emit the pair and continue with the algorithm
|
672
674
|
auto connections = query_graph.GetConnections(left, right);
|
673
675
|
D_ASSERT(!connections.empty());
|
674
676
|
|
675
|
-
best_connection = EmitPair(left, right, connections);
|
677
|
+
best_connection = &EmitPair(left, right, connections);
|
676
678
|
best_left = smallest_index[0];
|
677
679
|
best_right = smallest_index[1];
|
678
680
|
|
679
|
-
UpdateDPTree(best_connection);
|
681
|
+
UpdateDPTree(*best_connection);
|
680
682
|
// the code below assumes best_right > best_left
|
681
683
|
if (best_left > best_right) {
|
682
684
|
std::swap(best_left, best_right);
|
@@ -706,10 +708,10 @@ void JoinOrderOptimizer::GenerateCrossProducts() {
|
|
706
708
|
// generate a set of cross products to combine the currently available plans into a full join plan
|
707
709
|
// we create edges between every relation with a high cost
|
708
710
|
for (idx_t i = 0; i < relations.size(); i++) {
|
709
|
-
auto left = set_manager.GetJoinRelation(i);
|
711
|
+
auto &left = set_manager.GetJoinRelation(i);
|
710
712
|
for (idx_t j = 0; j < relations.size(); j++) {
|
711
713
|
if (i != j) {
|
712
|
-
auto right = set_manager.GetJoinRelation(j);
|
714
|
+
auto &right = set_manager.GetJoinRelation(j);
|
713
715
|
query_graph.CreateEdge(left, right, nullptr);
|
714
716
|
query_graph.CreateEdge(right, left, nullptr);
|
715
717
|
}
|
@@ -720,7 +722,7 @@ void JoinOrderOptimizer::GenerateCrossProducts() {
|
|
720
722
|
static unique_ptr<LogicalOperator> ExtractJoinRelation(SingleJoinRelation &rel) {
|
721
723
|
auto &children = rel.parent->children;
|
722
724
|
for (idx_t i = 0; i < children.size(); i++) {
|
723
|
-
if (children[i].get() == rel.op) {
|
725
|
+
if (children[i].get() == &rel.op) {
|
724
726
|
// found it! take ownership of it from the parent
|
725
727
|
auto result = std::move(children[i]);
|
726
728
|
children.erase(children.begin() + i);
|
@@ -730,64 +732,66 @@ static unique_ptr<LogicalOperator> ExtractJoinRelation(SingleJoinRelation &rel)
|
|
730
732
|
throw Exception("Could not find relation in parent node (?)");
|
731
733
|
}
|
732
734
|
|
733
|
-
|
734
|
-
|
735
|
-
JoinRelationSet
|
736
|
-
JoinRelationSet
|
735
|
+
GenerateJoinRelation JoinOrderOptimizer::GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted_relations,
|
736
|
+
JoinNode &node) {
|
737
|
+
optional_ptr<JoinRelationSet> left_node;
|
738
|
+
optional_ptr<JoinRelationSet> right_node;
|
739
|
+
optional_ptr<JoinRelationSet> result_relation;
|
737
740
|
unique_ptr<LogicalOperator> result_operator;
|
738
|
-
if (node
|
741
|
+
if (node.left && node.right && node.info) {
|
739
742
|
// generate the left and right children
|
740
|
-
auto left = GenerateJoins(extracted_relations, node
|
741
|
-
auto right = GenerateJoins(extracted_relations, node
|
743
|
+
auto left = GenerateJoins(extracted_relations, *node.left);
|
744
|
+
auto right = GenerateJoins(extracted_relations, *node.right);
|
742
745
|
|
743
|
-
if (node
|
746
|
+
if (node.info->filters.empty()) {
|
744
747
|
// no filters, create a cross product
|
745
|
-
result_operator = LogicalCrossProduct::Create(std::move(left.
|
748
|
+
result_operator = LogicalCrossProduct::Create(std::move(left.op), std::move(right.op));
|
746
749
|
} else {
|
747
750
|
// we have filters, create a join node
|
748
|
-
auto join =
|
749
|
-
join->children.push_back(std::move(left.
|
750
|
-
join->children.push_back(std::move(right.
|
751
|
+
auto join = make_uniq<LogicalComparisonJoin>(JoinType::INNER);
|
752
|
+
join->children.push_back(std::move(left.op));
|
753
|
+
join->children.push_back(std::move(right.op));
|
751
754
|
// set the join conditions from the join node
|
752
|
-
for (auto &
|
755
|
+
for (auto &filter_ref : node.info->filters) {
|
756
|
+
auto &f = filter_ref.get();
|
753
757
|
// extract the filter from the operator it originally belonged to
|
754
|
-
D_ASSERT(filters[f
|
755
|
-
auto condition = std::move(filters[f
|
758
|
+
D_ASSERT(filters[f.filter_index]);
|
759
|
+
auto condition = std::move(filters[f.filter_index]);
|
756
760
|
// now create the actual join condition
|
757
|
-
D_ASSERT((JoinRelationSet::IsSubset(left.
|
758
|
-
JoinRelationSet::IsSubset(right.
|
759
|
-
(JoinRelationSet::IsSubset(left.
|
760
|
-
JoinRelationSet::IsSubset(right.
|
761
|
+
D_ASSERT((JoinRelationSet::IsSubset(left.set, *f.left_set) &&
|
762
|
+
JoinRelationSet::IsSubset(right.set, *f.right_set)) ||
|
763
|
+
(JoinRelationSet::IsSubset(left.set, *f.right_set) &&
|
764
|
+
JoinRelationSet::IsSubset(right.set, *f.left_set)));
|
761
765
|
JoinCondition cond;
|
762
766
|
D_ASSERT(condition->GetExpressionClass() == ExpressionClass::BOUND_COMPARISON);
|
763
|
-
auto &comparison = (
|
767
|
+
auto &comparison = condition->Cast<BoundComparisonExpression>();
|
764
768
|
// we need to figure out which side is which by looking at the relations available to us
|
765
|
-
bool invert = !JoinRelationSet::IsSubset(left.
|
769
|
+
bool invert = !JoinRelationSet::IsSubset(left.set, *f.left_set);
|
766
770
|
cond.left = !invert ? std::move(comparison.left) : std::move(comparison.right);
|
767
771
|
cond.right = !invert ? std::move(comparison.right) : std::move(comparison.left);
|
768
772
|
cond.comparison = condition->type;
|
769
773
|
|
770
774
|
if (invert) {
|
771
775
|
// reverse comparison expression if we reverse the order of the children
|
772
|
-
cond.comparison =
|
776
|
+
cond.comparison = FlipComparisonExpression(cond.comparison);
|
773
777
|
}
|
774
778
|
join->conditions.push_back(std::move(cond));
|
775
779
|
}
|
776
780
|
D_ASSERT(!join->conditions.empty());
|
777
781
|
result_operator = std::move(join);
|
778
782
|
}
|
779
|
-
left_node = left.
|
780
|
-
right_node = right.
|
781
|
-
right_node = right.
|
782
|
-
result_relation = set_manager.Union(left_node, right_node);
|
783
|
+
left_node = &left.set;
|
784
|
+
right_node = &right.set;
|
785
|
+
right_node = &right.set;
|
786
|
+
result_relation = &set_manager.Union(*left_node, *right_node);
|
783
787
|
} else {
|
784
788
|
// base node, get the entry from the list of extracted relations
|
785
|
-
D_ASSERT(node
|
786
|
-
D_ASSERT(extracted_relations[node
|
787
|
-
result_relation = node
|
788
|
-
result_operator = std::move(extracted_relations[node
|
789
|
+
D_ASSERT(node.set.count == 1);
|
790
|
+
D_ASSERT(extracted_relations[node.set.relations[0]]);
|
791
|
+
result_relation = &node.set;
|
792
|
+
result_operator = std::move(extracted_relations[node.set.relations[0]]);
|
789
793
|
}
|
790
|
-
result_operator->estimated_props = node
|
794
|
+
result_operator->estimated_props = node.estimated_props->Copy();
|
791
795
|
result_operator->estimated_cardinality = result_operator->estimated_props->GetCardinality<idx_t>();
|
792
796
|
result_operator->has_estimated_cardinality = true;
|
793
797
|
if (result_operator->type == LogicalOperatorType::LOGICAL_FILTER &&
|
@@ -795,7 +799,7 @@ JoinOrderOptimizer::GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted
|
|
795
799
|
// FILTER on top of GET, add estimated properties to both
|
796
800
|
auto &filter_props = *result_operator->estimated_props;
|
797
801
|
auto &child_operator = *result_operator->children[0];
|
798
|
-
child_operator.estimated_props =
|
802
|
+
child_operator.estimated_props = make_uniq<EstimatedProperties>(
|
799
803
|
filter_props.GetCardinality<double>() / CardinalityEstimator::DEFAULT_SELECTIVITY, filter_props.GetCost());
|
800
804
|
child_operator.estimated_cardinality = child_operator.estimated_props->GetCardinality<idx_t>();
|
801
805
|
child_operator.has_estimated_cardinality = true;
|
@@ -805,16 +809,16 @@ JoinOrderOptimizer::GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted
|
|
805
809
|
// hence we should push it here
|
806
810
|
for (auto &filter_info : filter_infos) {
|
807
811
|
// check if the filter has already been extracted
|
808
|
-
auto info = filter_info
|
809
|
-
if (filters[info
|
812
|
+
auto &info = *filter_info;
|
813
|
+
if (filters[info.filter_index]) {
|
810
814
|
// now check if the filter is a subset of the current relation
|
811
815
|
// note that infos with an empty relation set are a special case and we do not push them down
|
812
|
-
if (info
|
813
|
-
auto filter = std::move(filters[info
|
816
|
+
if (info.set.count > 0 && JoinRelationSet::IsSubset(*result_relation, info.set)) {
|
817
|
+
auto filter = std::move(filters[info.filter_index]);
|
814
818
|
// if it is, we can push the filter
|
815
819
|
// we can push it either into a join or as a filter
|
816
820
|
// check if we are in a join or in a base table
|
817
|
-
if (!left_node || !info
|
821
|
+
if (!left_node || !info.left_set) {
|
818
822
|
// base table or non-comparison expression, push it as a filter
|
819
823
|
result_operator = PushFilter(std::move(result_operator), std::move(filter));
|
820
824
|
continue;
|
@@ -823,11 +827,11 @@ JoinOrderOptimizer::GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted
|
|
823
827
|
// check if the nodes can be split up into left/right
|
824
828
|
bool found_subset = false;
|
825
829
|
bool invert = false;
|
826
|
-
if (JoinRelationSet::IsSubset(left_node, info
|
827
|
-
JoinRelationSet::IsSubset(right_node, info
|
830
|
+
if (JoinRelationSet::IsSubset(*left_node, *info.left_set) &&
|
831
|
+
JoinRelationSet::IsSubset(*right_node, *info.right_set)) {
|
828
832
|
found_subset = true;
|
829
|
-
} else if (JoinRelationSet::IsSubset(right_node, info
|
830
|
-
JoinRelationSet::IsSubset(left_node, info
|
833
|
+
} else if (JoinRelationSet::IsSubset(*right_node, *info.left_set) &&
|
834
|
+
JoinRelationSet::IsSubset(*left_node, *info.right_set)) {
|
831
835
|
invert = true;
|
832
836
|
found_subset = true;
|
833
837
|
}
|
@@ -839,14 +843,14 @@ JoinOrderOptimizer::GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted
|
|
839
843
|
// create the join condition
|
840
844
|
JoinCondition cond;
|
841
845
|
D_ASSERT(filter->GetExpressionClass() == ExpressionClass::BOUND_COMPARISON);
|
842
|
-
auto &comparison = (
|
846
|
+
auto &comparison = filter->Cast<BoundComparisonExpression>();
|
843
847
|
// we need to figure out which side is which by looking at the relations available to us
|
844
848
|
cond.left = !invert ? std::move(comparison.left) : std::move(comparison.right);
|
845
849
|
cond.right = !invert ? std::move(comparison.right) : std::move(comparison.left);
|
846
850
|
cond.comparison = comparison.type;
|
847
851
|
if (invert) {
|
848
852
|
// reverse comparison expression if we reverse the order of the children
|
849
|
-
cond.comparison =
|
853
|
+
cond.comparison = FlipComparisonExpression(comparison.type);
|
850
854
|
}
|
851
855
|
// now find the join to push it into
|
852
856
|
auto node = result_operator.get();
|
@@ -855,7 +859,7 @@ JoinOrderOptimizer::GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted
|
|
855
859
|
}
|
856
860
|
if (node->type == LogicalOperatorType::LOGICAL_CROSS_PRODUCT) {
|
857
861
|
// turn into comparison join
|
858
|
-
auto comp_join =
|
862
|
+
auto comp_join = make_uniq<LogicalComparisonJoin>(JoinType::INNER);
|
859
863
|
comp_join->children.push_back(std::move(node->children[0]));
|
860
864
|
comp_join->children.push_back(std::move(node->children[1]));
|
861
865
|
comp_join->conditions.push_back(std::move(cond));
|
@@ -866,25 +870,28 @@ JoinOrderOptimizer::GenerateJoins(vector<unique_ptr<LogicalOperator>> &extracted
|
|
866
870
|
result_operator->children[0] = std::move(comp_join);
|
867
871
|
}
|
868
872
|
} else {
|
869
|
-
D_ASSERT(node->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN
|
870
|
-
|
873
|
+
D_ASSERT(node->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN ||
|
874
|
+
node->type == LogicalOperatorType::LOGICAL_ASOF_JOIN);
|
875
|
+
auto &comp_join = node->Cast<LogicalComparisonJoin>();
|
871
876
|
comp_join.conditions.push_back(std::move(cond));
|
872
877
|
}
|
873
878
|
}
|
874
879
|
}
|
875
880
|
}
|
876
|
-
return
|
881
|
+
return GenerateJoinRelation(*result_relation, std::move(result_operator));
|
877
882
|
}
|
878
883
|
|
879
|
-
unique_ptr<LogicalOperator> JoinOrderOptimizer::RewritePlan(unique_ptr<LogicalOperator> plan, JoinNode
|
884
|
+
unique_ptr<LogicalOperator> JoinOrderOptimizer::RewritePlan(unique_ptr<LogicalOperator> plan, JoinNode &node) {
|
880
885
|
// now we have to rewrite the plan
|
881
886
|
bool root_is_join = plan->children.size() > 1;
|
882
887
|
|
883
888
|
// first we will extract all relations from the main plan
|
884
889
|
vector<unique_ptr<LogicalOperator>> extracted_relations;
|
890
|
+
extracted_relations.reserve(relations.size());
|
885
891
|
for (auto &relation : relations) {
|
886
892
|
extracted_relations.push_back(ExtractJoinRelation(*relation));
|
887
893
|
}
|
894
|
+
|
888
895
|
// now we generate the actual joins
|
889
896
|
auto join_tree = GenerateJoins(extracted_relations, node);
|
890
897
|
// perform the final pushdown of remaining filters
|
@@ -892,27 +899,28 @@ unique_ptr<LogicalOperator> JoinOrderOptimizer::RewritePlan(unique_ptr<LogicalOp
|
|
892
899
|
// check if the filter has already been extracted
|
893
900
|
if (filter) {
|
894
901
|
// if not we need to push it
|
895
|
-
join_tree.
|
902
|
+
join_tree.op = PushFilter(std::move(join_tree.op), std::move(filter));
|
896
903
|
}
|
897
904
|
}
|
898
905
|
|
899
906
|
// find the first join in the relation to know where to place this node
|
900
907
|
if (root_is_join) {
|
901
908
|
// first node is the join, return it immediately
|
902
|
-
return std::move(join_tree.
|
909
|
+
return std::move(join_tree.op);
|
903
910
|
}
|
904
911
|
D_ASSERT(plan->children.size() == 1);
|
905
912
|
// have to move up through the relations
|
906
913
|
auto op = plan.get();
|
907
914
|
auto parent = plan.get();
|
908
915
|
while (op->type != LogicalOperatorType::LOGICAL_CROSS_PRODUCT &&
|
909
|
-
op->type != LogicalOperatorType::LOGICAL_COMPARISON_JOIN
|
916
|
+
op->type != LogicalOperatorType::LOGICAL_COMPARISON_JOIN &&
|
917
|
+
op->type != LogicalOperatorType::LOGICAL_ASOF_JOIN) {
|
910
918
|
D_ASSERT(op->children.size() == 1);
|
911
919
|
parent = op;
|
912
920
|
op = op->children[0].get();
|
913
921
|
}
|
914
922
|
// have to replace at this node
|
915
|
-
parent->children[0] = std::move(join_tree.
|
923
|
+
parent->children[0] = std::move(join_tree.op);
|
916
924
|
return plan;
|
917
925
|
}
|
918
926
|
|
@@ -928,7 +936,7 @@ unique_ptr<LogicalOperator> JoinOrderOptimizer::Optimize(unique_ptr<LogicalOpera
|
|
928
936
|
// group by and this filter cannot be reordered
|
929
937
|
// extract a list of all relations that have to be joined together
|
930
938
|
// and a list of all conditions that is applied to them
|
931
|
-
vector<LogicalOperator
|
939
|
+
vector<reference<LogicalOperator>> filter_operators;
|
932
940
|
if (!ExtractJoinRelations(*op, filter_operators)) {
|
933
941
|
// do not support reordering this type of plan
|
934
942
|
return plan;
|
@@ -940,62 +948,65 @@ unique_ptr<LogicalOperator> JoinOrderOptimizer::Optimize(unique_ptr<LogicalOpera
|
|
940
948
|
// now that we know we are going to perform join ordering we actually extract the filters, eliminating duplicate
|
941
949
|
// filters in the process
|
942
950
|
expression_set_t filter_set;
|
943
|
-
for (auto &
|
944
|
-
|
945
|
-
|
951
|
+
for (auto &filter_op : filter_operators) {
|
952
|
+
auto &f_op = filter_op.get();
|
953
|
+
if (f_op.type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN ||
|
954
|
+
f_op.type == LogicalOperatorType::LOGICAL_ASOF_JOIN) {
|
955
|
+
auto &join = f_op.Cast<LogicalComparisonJoin>();
|
946
956
|
D_ASSERT(join.join_type == JoinType::INNER);
|
947
957
|
D_ASSERT(join.expressions.empty());
|
948
958
|
for (auto &cond : join.conditions) {
|
949
|
-
auto comparison =
|
950
|
-
|
951
|
-
if (filter_set.find(comparison
|
952
|
-
filter_set.insert(comparison
|
959
|
+
auto comparison =
|
960
|
+
make_uniq<BoundComparisonExpression>(cond.comparison, std::move(cond.left), std::move(cond.right));
|
961
|
+
if (filter_set.find(*comparison) == filter_set.end()) {
|
962
|
+
filter_set.insert(*comparison);
|
953
963
|
filters.push_back(std::move(comparison));
|
954
964
|
}
|
955
965
|
}
|
956
966
|
join.conditions.clear();
|
957
967
|
} else {
|
958
|
-
for (auto &expression : f_op
|
959
|
-
if (filter_set.find(expression
|
960
|
-
filter_set.insert(expression
|
968
|
+
for (auto &expression : f_op.expressions) {
|
969
|
+
if (filter_set.find(*expression) == filter_set.end()) {
|
970
|
+
filter_set.insert(*expression);
|
961
971
|
filters.push_back(std::move(expression));
|
962
972
|
}
|
963
973
|
}
|
964
|
-
f_op
|
974
|
+
f_op.expressions.clear();
|
965
975
|
}
|
966
976
|
}
|
967
977
|
// create potential edges from the comparisons
|
968
978
|
for (idx_t i = 0; i < filters.size(); i++) {
|
969
979
|
auto &filter = filters[i];
|
970
|
-
auto info = make_unique<FilterInfo>();
|
971
|
-
auto filter_info = info.get();
|
972
|
-
filter_infos.push_back(std::move(info));
|
973
980
|
// first extract the relation set for the entire filter
|
974
981
|
unordered_set<idx_t> bindings;
|
975
982
|
ExtractBindings(*filter, bindings);
|
976
|
-
|
977
|
-
|
983
|
+
auto &set = set_manager.GetJoinRelation(bindings);
|
984
|
+
|
985
|
+
auto info = make_uniq<FilterInfo>(set, i);
|
986
|
+
auto filter_info = info.get();
|
987
|
+
filter_infos.push_back(std::move(info));
|
988
|
+
|
978
989
|
// now check if it can be used as a join predicate
|
979
990
|
if (filter->GetExpressionClass() == ExpressionClass::BOUND_COMPARISON) {
|
980
|
-
auto comparison =
|
991
|
+
auto &comparison = filter->Cast<BoundComparisonExpression>();
|
981
992
|
// extract the bindings that are required for the left and right side of the comparison
|
982
993
|
unordered_set<idx_t> left_bindings, right_bindings;
|
983
|
-
ExtractBindings(*comparison
|
984
|
-
ExtractBindings(*comparison
|
985
|
-
GetColumnBinding(*comparison
|
986
|
-
GetColumnBinding(*comparison
|
994
|
+
ExtractBindings(*comparison.left, left_bindings);
|
995
|
+
ExtractBindings(*comparison.right, right_bindings);
|
996
|
+
GetColumnBinding(*comparison.left, filter_info->left_binding);
|
997
|
+
GetColumnBinding(*comparison.right, filter_info->right_binding);
|
987
998
|
if (!left_bindings.empty() && !right_bindings.empty()) {
|
988
999
|
// both the left and the right side have bindings
|
989
1000
|
// first create the relation sets, if they do not exist
|
990
|
-
filter_info->left_set = set_manager.GetJoinRelation(left_bindings);
|
991
|
-
filter_info->right_set = set_manager.GetJoinRelation(right_bindings);
|
1001
|
+
filter_info->left_set = &set_manager.GetJoinRelation(left_bindings);
|
1002
|
+
filter_info->right_set = &set_manager.GetJoinRelation(right_bindings);
|
992
1003
|
// we can only create a meaningful edge if the sets are not exactly the same
|
993
1004
|
if (filter_info->left_set != filter_info->right_set) {
|
994
1005
|
// check if the sets are disjoint
|
995
1006
|
if (Disjoint(left_bindings, right_bindings)) {
|
996
1007
|
// they are disjoint, we only need to create one set of edges in the join graph
|
997
|
-
query_graph.CreateEdge(filter_info->left_set, filter_info->right_set, filter_info);
|
998
|
-
query_graph.CreateEdge(filter_info->right_set, filter_info->left_set, filter_info);
|
1008
|
+
query_graph.CreateEdge(*filter_info->left_set, *filter_info->right_set, filter_info);
|
1009
|
+
query_graph.CreateEdge(*filter_info->right_set, *filter_info->left_set, filter_info);
|
999
1010
|
} else {
|
1000
1011
|
continue;
|
1001
1012
|
}
|
@@ -1011,15 +1022,15 @@ unique_ptr<LogicalOperator> JoinOrderOptimizer::Optimize(unique_ptr<LogicalOpera
|
|
1011
1022
|
vector<NodeOp> nodes_ops;
|
1012
1023
|
for (idx_t i = 0; i < relations.size(); i++) {
|
1013
1024
|
auto &rel = *relations[i];
|
1014
|
-
auto node = set_manager.GetJoinRelation(i);
|
1015
|
-
nodes_ops.emplace_back(
|
1025
|
+
auto &node = set_manager.GetJoinRelation(i);
|
1026
|
+
nodes_ops.emplace_back(make_uniq<JoinNode>(node, 0), rel.op);
|
1016
1027
|
}
|
1017
1028
|
|
1018
|
-
cardinality_estimator.InitCardinalityEstimatorProps(
|
1029
|
+
cardinality_estimator.InitCardinalityEstimatorProps(nodes_ops, filter_infos);
|
1019
1030
|
|
1020
1031
|
for (auto &node_op : nodes_ops) {
|
1021
1032
|
D_ASSERT(node_op.node);
|
1022
|
-
plans[node_op.node->set] = std::move(node_op.node);
|
1033
|
+
plans[&node_op.node->set] = std::move(node_op.node);
|
1023
1034
|
}
|
1024
1035
|
// now we perform the actual dynamic programming to compute the final result
|
1025
1036
|
SolveJoinOrder();
|
@@ -1029,8 +1040,8 @@ unique_ptr<LogicalOperator> JoinOrderOptimizer::Optimize(unique_ptr<LogicalOpera
|
|
1029
1040
|
for (idx_t i = 0; i < relations.size(); i++) {
|
1030
1041
|
bindings.insert(i);
|
1031
1042
|
}
|
1032
|
-
auto total_relation = set_manager.GetJoinRelation(bindings);
|
1033
|
-
auto final_plan = plans.find(total_relation);
|
1043
|
+
auto &total_relation = set_manager.GetJoinRelation(bindings);
|
1044
|
+
auto final_plan = plans.find(&total_relation);
|
1034
1045
|
if (final_plan == plans.end()) {
|
1035
1046
|
// could not find the final plan
|
1036
1047
|
// this should only happen in case the sets are actually disjunct
|
@@ -1043,11 +1054,11 @@ unique_ptr<LogicalOperator> JoinOrderOptimizer::Optimize(unique_ptr<LogicalOpera
|
|
1043
1054
|
//! solve the join order again
|
1044
1055
|
SolveJoinOrder();
|
1045
1056
|
// now we can obtain the final plan!
|
1046
|
-
final_plan = plans.find(total_relation);
|
1057
|
+
final_plan = plans.find(&total_relation);
|
1047
1058
|
D_ASSERT(final_plan != plans.end());
|
1048
1059
|
}
|
1049
1060
|
// now perform the actual reordering
|
1050
|
-
return RewritePlan(std::move(plan), final_plan->second
|
1061
|
+
return RewritePlan(std::move(plan), *final_plan->second);
|
1051
1062
|
}
|
1052
1063
|
|
1053
1064
|
} // namespace duckdb
|