duckdb 0.8.1-dev65.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +8 -8
- package/package.json +3 -1
- package/src/duckdb/extension/icu/icu-datepart.cpp +2 -2
- package/src/duckdb/extension/icu/icu-extension.cpp +1 -1
- package/src/duckdb/extension/icu/icu-makedate.cpp +5 -4
- package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/nfsubs.cpp +0 -2
- package/src/duckdb/extension/json/buffered_json_reader.cpp +23 -14
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +6 -6
- package/src/duckdb/extension/json/include/json_common.hpp +13 -3
- package/src/duckdb/extension/json/include/json_executors.hpp +1 -1
- package/src/duckdb/extension/json/include/json_scan.hpp +5 -2
- package/src/duckdb/extension/json/json_functions/json_contains.cpp +5 -0
- package/src/duckdb/extension/json/json_functions/json_create.cpp +16 -16
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +3 -3
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +5 -3
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +12 -12
- package/src/duckdb/extension/json/json_functions/read_json.cpp +2 -1
- package/src/duckdb/extension/json/json_functions.cpp +6 -3
- package/src/duckdb/extension/json/json_scan.cpp +43 -27
- package/src/duckdb/extension/parquet/column_reader.cpp +57 -52
- package/src/duckdb/extension/parquet/column_writer.cpp +57 -45
- package/src/duckdb/extension/parquet/include/cast_column_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/include/column_reader.hpp +5 -4
- package/src/duckdb/extension/parquet/include/column_writer.hpp +24 -0
- package/src/duckdb/extension/parquet/include/decode_utils.hpp +6 -0
- package/src/duckdb/extension/parquet/include/list_column_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/include/parquet_dbp_decoder.hpp +4 -4
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +4 -5
- package/src/duckdb/extension/parquet/include/resizable_buffer.hpp +4 -4
- package/src/duckdb/extension/parquet/include/row_number_column_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/include/struct_column_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/parquet-extension.cpp +27 -2
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +1 -1
- package/src/duckdb/extension/parquet/parquet_reader.cpp +18 -18
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +23 -26
- package/src/duckdb/extension/parquet/parquet_timestamp.cpp +2 -2
- package/src/duckdb/extension/parquet/parquet_writer.cpp +3 -3
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +3 -3
- package/src/duckdb/src/catalog/catalog.cpp +5 -17
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +7 -1
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +121 -0
- package/src/duckdb/src/catalog/catalog_search_path.cpp +49 -12
- package/src/duckdb/src/catalog/catalog_set.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_types.cpp +9 -84
- package/src/duckdb/src/catalog/dependency_manager.cpp +2 -2
- package/src/duckdb/src/common/adbc/adbc.cpp +118 -12
- package/src/duckdb/src/common/adbc/driver_manager.cpp +0 -20
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +12 -12
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +11 -12
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +11 -10
- package/src/duckdb/src/common/checksum.cpp +1 -1
- package/src/duckdb/src/common/compressed_file_system.cpp +6 -6
- package/src/duckdb/src/common/crypto/md5.cpp +9 -9
- package/src/duckdb/src/common/exception.cpp +4 -1
- package/src/duckdb/src/common/exception_format_value.cpp +24 -15
- package/src/duckdb/src/common/field_writer.cpp +1 -1
- package/src/duckdb/src/common/fsst.cpp +11 -6
- package/src/duckdb/src/common/gzip_file_system.cpp +8 -8
- package/src/duckdb/src/common/hive_partitioning.cpp +1 -1
- package/src/duckdb/src/common/local_file_system.cpp +11 -11
- package/src/duckdb/src/common/multi_file_reader.cpp +3 -0
- package/src/duckdb/src/common/operator/cast_operators.cpp +1 -1
- package/src/duckdb/src/common/pipe_file_system.cpp +2 -2
- package/src/duckdb/src/common/radix_partitioning.cpp +2 -2
- package/src/duckdb/src/common/random_engine.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_heap_gather.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_heap_scatter.cpp +5 -5
- package/src/duckdb/src/common/row_operations/row_match.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_radix_scatter.cpp +2 -2
- package/src/duckdb/src/common/row_operations/row_scatter.cpp +4 -4
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +1 -1
- package/src/duckdb/src/common/serializer/binary_serializer.cpp +3 -3
- package/src/duckdb/src/common/serializer.cpp +1 -1
- package/src/duckdb/src/common/sort/comparators.cpp +1 -1
- package/src/duckdb/src/common/sort/merge_sorter.cpp +7 -2
- package/src/duckdb/src/common/sort/partition_state.cpp +2 -2
- package/src/duckdb/src/common/types/bit.cpp +5 -5
- package/src/duckdb/src/common/types/blob.cpp +8 -8
- package/src/duckdb/src/common/types/column/column_data_allocator.cpp +4 -4
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +3 -3
- package/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +1 -1
- package/src/duckdb/src/common/types/column/partitioned_column_data.cpp +2 -2
- package/src/duckdb/src/common/types/hash.cpp +2 -2
- package/src/duckdb/src/common/types/hyperloglog.cpp +22 -21
- package/src/duckdb/src/common/types/list_segment.cpp +77 -49
- package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +1 -1
- package/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +5 -4
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +5 -3
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +61 -24
- package/src/duckdb/src/common/types/string_heap.cpp +1 -1
- package/src/duckdb/src/common/types/time.cpp +2 -8
- package/src/duckdb/src/common/types/timestamp.cpp +37 -1
- package/src/duckdb/src/common/types/value.cpp +3 -2
- package/src/duckdb/src/common/types/vector.cpp +98 -101
- package/src/duckdb/src/common/types/vector_cache.cpp +6 -6
- package/src/duckdb/src/common/types/vector_constants.cpp +2 -1
- package/src/duckdb/src/common/types.cpp +48 -33
- package/src/duckdb/src/common/vector_operations/boolean_operators.cpp +2 -2
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +12 -12
- package/src/duckdb/src/common/vector_operations/vector_hash.cpp +13 -11
- package/src/duckdb/src/common/vector_operations/vector_storage.cpp +1 -1
- package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +30 -33
- package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +0 -4
- package/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp +33 -36
- package/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp +53 -66
- package/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp +48 -48
- package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +44 -44
- package/src/duckdb/src/core_functions/aggregate/distributive/bool.cpp +32 -32
- package/src/duckdb/src/core_functions/aggregate/distributive/entropy.cpp +34 -34
- package/src/duckdb/src/core_functions/aggregate/distributive/kurtosis.cpp +30 -31
- package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +91 -103
- package/src/duckdb/src/core_functions/aggregate/distributive/product.cpp +17 -17
- package/src/duckdb/src/core_functions/aggregate/distributive/skew.cpp +25 -27
- package/src/duckdb/src/core_functions/aggregate/distributive/string_agg.cpp +37 -38
- package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +22 -22
- package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +49 -85
- package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +49 -51
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +116 -134
- package/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +63 -100
- package/src/duckdb/src/core_functions/aggregate/nested/histogram.cpp +24 -26
- package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +22 -23
- package/src/duckdb/src/core_functions/aggregate/regression/regr_avg.cpp +16 -18
- package/src/duckdb/src/core_functions/aggregate/regression/regr_intercept.cpp +22 -25
- package/src/duckdb/src/core_functions/aggregate/regression/regr_r2.cpp +19 -24
- package/src/duckdb/src/core_functions/aggregate/regression/regr_sxx_syy.cpp +18 -23
- package/src/duckdb/src/core_functions/aggregate/regression/regr_sxy.cpp +14 -18
- package/src/duckdb/src/core_functions/function_list.cpp +1 -0
- package/src/duckdb/src/core_functions/scalar/blob/base64.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +46 -46
- package/src/duckdb/src/core_functions/scalar/date/make_date.cpp +3 -0
- package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/generic/current_setting.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/generic/least.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/generic/stats.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +14 -0
- package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +4 -4
- package/src/duckdb/src/core_functions/scalar/list/flatten.cpp +2 -4
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +26 -9
- package/src/duckdb/src/core_functions/scalar/list/list_lambdas.cpp +7 -9
- package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/map/cardinality.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/map/map.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/map/map_concat.cpp +4 -1
- package/src/duckdb/src/core_functions/scalar/map/map_extract.cpp +5 -9
- package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +6 -6
- package/src/duckdb/src/core_functions/scalar/string/starts_with.cpp +3 -2
- package/src/duckdb/src/core_functions/scalar/string/string_split.cpp +4 -4
- package/src/duckdb/src/core_functions/scalar/string/trim.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/union/union_extract.cpp +1 -1
- package/src/duckdb/src/execution/adaptive_filter.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_case.cpp +10 -10
- package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +7 -7
- package/src/duckdb/src/execution/expression_executor.cpp +28 -28
- package/src/duckdb/src/execution/index/art/art.cpp +110 -39
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +23 -5
- package/src/duckdb/src/execution/index/art/leaf.cpp +11 -11
- package/src/duckdb/src/execution/index/art/leaf_segment.cpp +10 -0
- package/src/duckdb/src/execution/index/art/node.cpp +48 -35
- package/src/duckdb/src/execution/index/art/node16.cpp +3 -0
- package/src/duckdb/src/execution/index/art/node256.cpp +1 -0
- package/src/duckdb/src/execution/index/art/node4.cpp +3 -0
- package/src/duckdb/src/execution/index/art/node48.cpp +2 -0
- package/src/duckdb/src/execution/index/art/prefix.cpp +2 -0
- package/src/duckdb/src/execution/join_hashtable.cpp +6 -4
- package/src/duckdb/src/execution/nested_loop_join/nested_loop_join_inner.cpp +4 -4
- package/src/duckdb/src/execution/nested_loop_join/nested_loop_join_mark.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +4 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +26 -9
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +5 -2
- package/src/duckdb/src/execution/operator/helper/physical_set.cpp +5 -1
- package/src/duckdb/src/execution/operator/join/outer_join_marker.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +4 -4
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +3 -6
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +2 -3
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +1 -1
- package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +2 -2
- package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +1 -1
- package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +1 -0
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +10 -5
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +2 -1
- package/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp +1 -1
- package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +0 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +29 -3
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +1 -1
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan_generator.cpp +2 -2
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +1 -1
- package/src/duckdb/src/execution/reservoir_sample.cpp +20 -6
- package/src/duckdb/src/execution/window_segment_tree.cpp +8 -6
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +159 -21
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +68 -75
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +14 -14
- package/src/duckdb/src/function/cast/cast_function_set.cpp +1 -1
- package/src/duckdb/src/function/cast/decimal_cast.cpp +1 -1
- package/src/duckdb/src/function/cast/enum_casts.cpp +2 -2
- package/src/duckdb/src/function/cast/list_casts.cpp +2 -4
- package/src/duckdb/src/function/cast/string_cast.cpp +11 -11
- package/src/duckdb/src/function/cast/union_casts.cpp +2 -2
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +3 -2
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +33 -23
- package/src/duckdb/src/function/scalar/generic/constant_or_null.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/list_concat.cpp +2 -2
- package/src/duckdb/src/function/scalar/list/list_extract.cpp +4 -4
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +3 -4
- package/src/duckdb/src/function/scalar/string/concat.cpp +8 -7
- package/src/duckdb/src/function/scalar/string/contains.cpp +4 -4
- package/src/duckdb/src/function/scalar/string/like.cpp +5 -5
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +4 -4
- package/src/duckdb/src/function/scalar/string/regexp/regexp_util.cpp +6 -2
- package/src/duckdb/src/function/scalar/string/regexp.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/strip_accents.cpp +1 -1
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +1 -1
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +27 -25
- package/src/duckdb/src/function/scalar_function.cpp +3 -3
- package/src/duckdb/src/function/table/arrow.cpp +6 -6
- package/src/duckdb/src/function/table/arrow_conversion.cpp +67 -61
- package/src/duckdb/src/function/table/checkpoint.cpp +4 -1
- package/src/duckdb/src/function/table/copy_csv.cpp +11 -7
- package/src/duckdb/src/function/table/glob.cpp +1 -1
- package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +1 -1
- package/src/duckdb/src/function/table/range.cpp +4 -4
- package/src/duckdb/src/function/table/read_csv.cpp +19 -21
- package/src/duckdb/src/function/table/repeat.cpp +5 -2
- package/src/duckdb/src/function/table/repeat_row.cpp +10 -3
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +1 -1
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +4 -4
- package/src/duckdb/src/function/table/system/test_vector_types.cpp +82 -26
- package/src/duckdb/src/function/table/table_scan.cpp +4 -4
- package/src/duckdb/src/function/table/unnest.cpp +1 -1
- package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +2 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +11 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_search_path.hpp +8 -2
- package/src/duckdb/src/include/duckdb/catalog/default/builtin_types/types.hpp +97 -0
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +15 -4
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_buffer.hpp +7 -2
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_converter.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_options.hpp +8 -1
- package/src/duckdb/src/include/duckdb/common/arrow/result_arrow_wrapper.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +16 -22
- package/src/duckdb/src/include/duckdb/common/crypto/md5.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/exception.hpp +5 -2
- package/src/duckdb/src/include/duckdb/common/field_writer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +11 -0
- package/src/duckdb/src/include/duckdb/common/fsst.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/radix.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +4 -1
- package/src/duckdb/src/include/duckdb/common/serializer.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/typedefs.hpp +30 -0
- package/src/duckdb/src/include/duckdb/common/types/column/partitioned_column_data.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +6 -2
- package/src/duckdb/src/include/duckdb/common/types/null_value.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +10 -10
- package/src/duckdb/src/include/duckdb/common/types/time.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +4 -14
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +9 -0
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +18 -6
- package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +112 -76
- package/src/duckdb/src/include/duckdb/common/vector_operations/binary_executor.hpp +16 -15
- package/src/duckdb/src/include/duckdb/common/vector_operations/generic_executor.hpp +11 -11
- package/src/duckdb/src/include/duckdb/common/vector_operations/ternary_executor.hpp +23 -19
- package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +3 -3
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/corr.hpp +20 -24
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/covar.hpp +36 -39
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/stddev.hpp +57 -53
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_count.hpp +8 -9
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_slope.hpp +16 -18
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +7 -8
- package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +9 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +2 -6
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +16 -36
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +14 -2
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +13 -7
- package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +13 -3
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +5 -2
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +12 -12
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +9 -30
- package/src/duckdb/src/include/duckdb/function/aggregate_state.hpp +95 -0
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +13 -2
- package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/compression_function.hpp +44 -0
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/function.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +4 -2
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +4 -3
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +9 -8
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +4 -1
- package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/capi/cast/utils.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +5 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +142 -136
- package/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/pending_query_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +23 -0
- package/src/duckdb/src/include/duckdb/main/relation.hpp +12 -0
- package/src/duckdb/src/include/duckdb/main/settings.hpp +19 -0
- package/src/duckdb/src/include/duckdb/main/stream_query_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +2 -2
- package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +12 -3
- package/src/duckdb/src/include/duckdb/parser/base_expression.hpp +6 -12
- package/src/duckdb/src/include/duckdb/parser/constraint.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression_map.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_expression.hpp +5 -1
- package/src/duckdb/src/include/duckdb/parser/parser.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/query_node.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +36 -5
- package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +7 -4
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +4 -3
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +106 -92
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/bound_query_node.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +37 -1
- package/src/duckdb/src/include/duckdb/planner/bound_tableref.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +5 -7
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/filter/constant_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/filter/null_filter.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +7 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/table_binding.hpp +26 -0
- package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/byte_reader.hpp +4 -0
- 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 +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_analyze.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_compress.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +13 -13
- package/src/duckdb/src/include/duckdb/storage/index.hpp +6 -4
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +0 -6
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +12 -0
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +25 -2
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +12 -0
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +22 -0
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table_storage_info.hpp +0 -2
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +2 -2
- package/src/duckdb/src/main/attached_database.cpp +8 -0
- package/src/duckdb/src/main/capi/appender-c.cpp +5 -5
- package/src/duckdb/src/main/capi/arrow-c.cpp +13 -13
- package/src/duckdb/src/main/capi/cast/from_decimal-c.cpp +1 -1
- package/src/duckdb/src/main/capi/cast/utils-c.cpp +1 -1
- package/src/duckdb/src/main/capi/config-c.cpp +3 -6
- package/src/duckdb/src/main/capi/data_chunk-c.cpp +17 -17
- package/src/duckdb/src/main/capi/duckdb-c.cpp +4 -4
- package/src/duckdb/src/main/capi/duckdb_value-c.cpp +4 -4
- package/src/duckdb/src/main/capi/logical_types-c.cpp +22 -21
- package/src/duckdb/src/main/capi/pending-c.cpp +6 -6
- package/src/duckdb/src/main/capi/prepared-c.cpp +10 -10
- package/src/duckdb/src/main/capi/replacement_scan-c.cpp +6 -6
- package/src/duckdb/src/main/capi/result-c.cpp +23 -23
- package/src/duckdb/src/main/capi/table_function-c.cpp +1 -1
- package/src/duckdb/src/main/client_context.cpp +7 -6
- package/src/duckdb/src/main/config.cpp +2 -0
- package/src/duckdb/src/main/database.cpp +1 -0
- package/src/duckdb/src/main/database_manager.cpp +22 -1
- package/src/duckdb/src/main/error_manager.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +1 -1
- package/src/duckdb/src/main/query_result.cpp +6 -2
- package/src/duckdb/src/main/relation/create_table_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/create_view_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/delete_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/explain_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/insert_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/update_relation.cpp +1 -1
- 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 +1 -1
- package/src/duckdb/src/main/settings/settings.cpp +41 -6
- package/src/duckdb/src/optimizer/deliminator.cpp +12 -12
- package/src/duckdb/src/optimizer/filter_combiner.cpp +3 -3
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +10 -10
- package/src/duckdb/src/optimizer/matcher/expression_matcher.cpp +1 -1
- package/src/duckdb/src/optimizer/pullup/pullup_projection.cpp +2 -2
- package/src/duckdb/src/optimizer/regex_range_filter.cpp +2 -4
- package/src/duckdb/src/optimizer/rule/distributivity.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +6 -6
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +2 -2
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +27 -16
- package/src/duckdb/src/parallel/executor.cpp +39 -15
- package/src/duckdb/src/parallel/meta_pipeline.cpp +17 -3
- package/src/duckdb/src/parser/base_expression.cpp +2 -5
- package/src/duckdb/src/parser/column_definition.cpp +5 -8
- package/src/duckdb/src/parser/expression/between_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/case_expression.cpp +6 -6
- package/src/duckdb/src/parser/expression/cast_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/collate_expression.cpp +3 -3
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/comparison_expression.cpp +3 -3
- package/src/duckdb/src/parser/expression/conjunction_expression.cpp +2 -2
- package/src/duckdb/src/parser/expression/constant_expression.cpp +2 -2
- package/src/duckdb/src/parser/expression/function_expression.cpp +10 -14
- package/src/duckdb/src/parser/expression/lambda_expression.cpp +2 -2
- package/src/duckdb/src/parser/expression/operator_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/parameter_expression.cpp +2 -2
- package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +3 -3
- package/src/duckdb/src/parser/expression/star_expression.cpp +9 -9
- package/src/duckdb/src/parser/expression/subquery_expression.cpp +5 -5
- package/src/duckdb/src/parser/expression/window_expression.cpp +13 -24
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +0 -3
- package/src/duckdb/src/parser/parsed_expression.cpp +34 -18
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +4 -4
- package/src/duckdb/src/parser/parser.cpp +98 -38
- package/src/duckdb/src/parser/query_node/select_node.cpp +6 -13
- package/src/duckdb/src/parser/query_node.cpp +7 -6
- package/src/duckdb/src/parser/result_modifier.cpp +25 -18
- package/src/duckdb/src/parser/statement/select_statement.cpp +3 -3
- package/src/duckdb/src/parser/tableref/basetableref.cpp +4 -4
- package/src/duckdb/src/parser/tableref/emptytableref.cpp +1 -1
- package/src/duckdb/src/parser/tableref/expressionlistref.cpp +5 -5
- package/src/duckdb/src/parser/tableref/joinref.cpp +6 -6
- package/src/duckdb/src/parser/tableref/pivotref.cpp +10 -15
- package/src/duckdb/src/parser/tableref/subqueryref.cpp +3 -3
- package/src/duckdb/src/parser/tableref/table_function.cpp +3 -3
- package/src/duckdb/src/parser/tableref.cpp +12 -3
- package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +7 -7
- package/src/duckdb/src/parser/transform/expression/transform_bool_expr.cpp +4 -4
- package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +4 -4
- package/src/duckdb/src/parser/transform/expression/transform_case.cpp +8 -10
- package/src/duckdb/src/parser/transform/expression/transform_cast.cpp +7 -9
- package/src/duckdb/src/parser/transform/expression/transform_coalesce.cpp +3 -5
- package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +22 -22
- package/src/duckdb/src/parser/transform/expression/transform_constant.cpp +2 -2
- package/src/duckdb/src/parser/transform/expression/transform_expression.cpp +42 -44
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +70 -75
- package/src/duckdb/src/parser/transform/expression/transform_grouping_function.cpp +4 -4
- package/src/duckdb/src/parser/transform/expression/transform_interval.cpp +7 -7
- package/src/duckdb/src/parser/transform/expression/transform_is_null.cpp +4 -5
- package/src/duckdb/src/parser/transform/expression/transform_lambda.cpp +5 -6
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +31 -29
- package/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp +13 -14
- package/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp +4 -4
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +9 -10
- package/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +0 -2
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +28 -32
- package/src/duckdb/src/parser/transform/helpers/transform_groupby.cpp +18 -18
- package/src/duckdb/src/parser/transform/helpers/transform_sample.cpp +3 -3
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +27 -26
- package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +11 -14
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +14 -16
- package/src/duckdb/src/parser/transform/statement/transform_attach.cpp +8 -9
- package/src/duckdb/src/parser/transform/statement/transform_call.cpp +2 -5
- package/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +4 -6
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +22 -23
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +14 -18
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +13 -15
- package/src/duckdb/src/parser/transform/statement/transform_create_schema.cpp +8 -10
- package/src/duckdb/src/parser/transform/statement/transform_create_sequence.cpp +8 -10
- package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +26 -28
- package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +8 -10
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +12 -15
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +13 -18
- package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +11 -13
- package/src/duckdb/src/parser/transform/statement/transform_detach.cpp +3 -4
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +20 -25
- package/src/duckdb/src/parser/transform/statement/transform_explain.cpp +5 -7
- package/src/duckdb/src/parser/transform/statement/transform_export.cpp +5 -6
- package/src/duckdb/src/parser/transform/statement/transform_import.cpp +2 -3
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +21 -24
- package/src/duckdb/src/parser/transform/statement/transform_load.cpp +4 -5
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +7 -7
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +7 -9
- package/src/duckdb/src/parser/transform/statement/transform_prepare.cpp +11 -19
- package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +12 -14
- package/src/duckdb/src/parser/transform/statement/transform_select.cpp +12 -9
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +34 -34
- package/src/duckdb/src/parser/transform/statement/transform_set.cpp +18 -19
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +5 -7
- package/src/duckdb/src/parser/transform/statement/transform_show_select.cpp +4 -5
- package/src/duckdb/src/parser/transform/statement/transform_transaction.cpp +3 -5
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +10 -13
- package/src/duckdb/src/parser/transform/statement/transform_upsert.cpp +4 -4
- package/src/duckdb/src/parser/transform/statement/transform_use.cpp +2 -3
- package/src/duckdb/src/parser/transform/statement/transform_vacuum.cpp +6 -10
- package/src/duckdb/src/parser/transform/tableref/transform_base_tableref.cpp +18 -18
- package/src/duckdb/src/parser/transform/tableref/transform_from.cpp +5 -5
- package/src/duckdb/src/parser/transform/tableref/transform_join.cpp +11 -11
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +30 -27
- package/src/duckdb/src/parser/transform/tableref/transform_subquery.cpp +5 -5
- package/src/duckdb/src/parser/transform/tableref/transform_table_function.cpp +13 -12
- package/src/duckdb/src/parser/transform/tableref/transform_tableref.cpp +8 -8
- package/src/duckdb/src/parser/transformer.cpp +45 -47
- package/src/duckdb/src/planner/bind_context.cpp +9 -10
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +1 -3
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_positional_reference_expression.cpp +8 -3
- package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +6 -3
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +39 -23
- package/src/duckdb/src/planner/binder/query_node/plan_query_node.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +1 -28
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +18 -1
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +0 -25
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +2 -114
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +7 -2
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +7 -2
- package/src/duckdb/src/planner/binder.cpp +1 -1
- package/src/duckdb/src/planner/bound_result_modifier.cpp +30 -11
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +11 -10
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_case_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_default_expression.cpp +7 -1
- package/src/duckdb/src/planner/expression/bound_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +3 -4
- package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +4 -5
- package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +3 -4
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_subquery_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +8 -21
- package/src/duckdb/src/planner/expression.cpp +18 -0
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder.cpp +3 -2
- package/src/duckdb/src/planner/expression_iterator.cpp +2 -2
- 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/logical_operator.cpp +3 -4
- package/src/duckdb/src/planner/logical_operator_visitor.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +5 -4
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +14 -2
- package/src/duckdb/src/planner/planner.cpp +5 -15
- package/src/duckdb/src/planner/table_filter.cpp +1 -1
- package/src/duckdb/src/storage/arena_allocator.cpp +2 -2
- package/src/duckdb/src/storage/buffer/block_handle.cpp +1 -1
- package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +2 -2
- package/src/duckdb/src/storage/checkpoint_manager.cpp +3 -3
- package/src/duckdb/src/storage/compression/bitpacking.cpp +8 -8
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +36 -36
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +11 -11
- package/src/duckdb/src/storage/compression/fsst.cpp +34 -34
- package/src/duckdb/src/storage/compression/rle.cpp +8 -8
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +13 -13
- package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +11 -11
- package/src/duckdb/src/storage/data_table.cpp +12 -10
- package/src/duckdb/src/storage/index.cpp +13 -0
- package/src/duckdb/src/storage/single_file_block_manager.cpp +3 -3
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +3 -3
- package/src/duckdb/src/storage/statistics/list_stats.cpp +1 -1
- package/src/duckdb/src/storage/statistics/numeric_stats.cpp +1 -1
- package/src/duckdb/src/storage/statistics/string_stats.cpp +15 -14
- package/src/duckdb/src/storage/storage_manager.cpp +6 -0
- package/src/duckdb/src/storage/table/chunk_info.cpp +2 -2
- package/src/duckdb/src/storage/table/column_data.cpp +7 -3
- package/src/duckdb/src/storage/table/column_segment.cpp +3 -3
- package/src/duckdb/src/storage/table/list_column_data.cpp +8 -7
- package/src/duckdb/src/storage/table/row_group.cpp +8 -7
- package/src/duckdb/src/storage/table/row_group_collection.cpp +6 -3
- package/src/duckdb/src/storage/table/standard_column_data.cpp +5 -4
- package/src/duckdb/src/storage/table/struct_column_data.cpp +4 -3
- package/src/duckdb/src/storage/table/update_segment.cpp +12 -12
- package/src/duckdb/src/storage/wal_replay.cpp +5 -6
- package/src/duckdb/src/transaction/cleanup_state.cpp +3 -3
- package/src/duckdb/src/transaction/commit_state.cpp +8 -8
- package/src/duckdb/src/transaction/duck_transaction.cpp +9 -7
- package/src/duckdb/src/transaction/duck_transaction_manager.cpp +16 -16
- package/src/duckdb/src/transaction/rollback_state.cpp +3 -3
- package/src/duckdb/src/verification/prepared_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/statement_verifier.cpp +3 -4
- package/src/duckdb/third_party/hyperloglog/hyperloglog.hpp +2 -2
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +0 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +0 -14
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +12828 -12956
- package/src/duckdb/third_party/pcg/pcg_extras.hpp +1 -1
- package/src/duckdb/third_party/zstd/compress/zstd_compress.cpp +3 -0
- package/src/duckdb/third_party/zstd/include/zstd/compress/zstd_cwksp.h +4 -0
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +5 -5
- package/src/duckdb/ub_src_parser_transform_statement.cpp +0 -2
- package/test/extension.test.ts +11 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_database_info.hpp +0 -46
- package/src/duckdb/src/parser/transform/statement/transform_create_database.cpp +0 -28
@@ -7,6 +7,7 @@
|
|
7
7
|
#include "duckdb/parser/parsed_expression_iterator.hpp"
|
8
8
|
#include "duckdb/common/serializer/format_serializer.hpp"
|
9
9
|
#include "duckdb/common/serializer/format_deserializer.hpp"
|
10
|
+
#include "duckdb/parser/expression_util.hpp"
|
10
11
|
|
11
12
|
namespace duckdb {
|
12
13
|
|
@@ -48,46 +49,46 @@ bool ParsedExpression::HasSubquery() const {
|
|
48
49
|
return has_subquery;
|
49
50
|
}
|
50
51
|
|
51
|
-
bool ParsedExpression::Equals(const BaseExpression
|
52
|
+
bool ParsedExpression::Equals(const BaseExpression &other) const {
|
52
53
|
if (!BaseExpression::Equals(other)) {
|
53
54
|
return false;
|
54
55
|
}
|
55
56
|
switch (expression_class) {
|
56
57
|
case ExpressionClass::BETWEEN:
|
57
|
-
return BetweenExpression::Equal((
|
58
|
+
return BetweenExpression::Equal(Cast<BetweenExpression>(), other.Cast<BetweenExpression>());
|
58
59
|
case ExpressionClass::CASE:
|
59
|
-
return CaseExpression::Equal((
|
60
|
+
return CaseExpression::Equal(Cast<CaseExpression>(), other.Cast<CaseExpression>());
|
60
61
|
case ExpressionClass::CAST:
|
61
|
-
return CastExpression::Equal((
|
62
|
+
return CastExpression::Equal(Cast<CastExpression>(), other.Cast<CastExpression>());
|
62
63
|
case ExpressionClass::COLLATE:
|
63
|
-
return CollateExpression::Equal((
|
64
|
+
return CollateExpression::Equal(Cast<CollateExpression>(), other.Cast<CollateExpression>());
|
64
65
|
case ExpressionClass::COLUMN_REF:
|
65
|
-
return ColumnRefExpression::Equal((
|
66
|
+
return ColumnRefExpression::Equal(Cast<ColumnRefExpression>(), other.Cast<ColumnRefExpression>());
|
66
67
|
case ExpressionClass::COMPARISON:
|
67
|
-
return ComparisonExpression::Equal((
|
68
|
+
return ComparisonExpression::Equal(Cast<ComparisonExpression>(), other.Cast<ComparisonExpression>());
|
68
69
|
case ExpressionClass::CONJUNCTION:
|
69
|
-
return ConjunctionExpression::Equal((
|
70
|
+
return ConjunctionExpression::Equal(Cast<ConjunctionExpression>(), other.Cast<ConjunctionExpression>());
|
70
71
|
case ExpressionClass::CONSTANT:
|
71
|
-
return ConstantExpression::Equal((
|
72
|
+
return ConstantExpression::Equal(Cast<ConstantExpression>(), other.Cast<ConstantExpression>());
|
72
73
|
case ExpressionClass::DEFAULT:
|
73
74
|
return true;
|
74
75
|
case ExpressionClass::FUNCTION:
|
75
|
-
return FunctionExpression::Equal((
|
76
|
+
return FunctionExpression::Equal(Cast<FunctionExpression>(), other.Cast<FunctionExpression>());
|
76
77
|
case ExpressionClass::LAMBDA:
|
77
|
-
return LambdaExpression::Equal((
|
78
|
+
return LambdaExpression::Equal(Cast<LambdaExpression>(), other.Cast<LambdaExpression>());
|
78
79
|
case ExpressionClass::OPERATOR:
|
79
|
-
return OperatorExpression::Equal((
|
80
|
+
return OperatorExpression::Equal(Cast<OperatorExpression>(), other.Cast<OperatorExpression>());
|
80
81
|
case ExpressionClass::PARAMETER:
|
81
|
-
return ParameterExpression::Equal((
|
82
|
+
return ParameterExpression::Equal(Cast<ParameterExpression>(), other.Cast<ParameterExpression>());
|
82
83
|
case ExpressionClass::POSITIONAL_REFERENCE:
|
83
|
-
return PositionalReferenceExpression::Equal((
|
84
|
-
(
|
84
|
+
return PositionalReferenceExpression::Equal(Cast<PositionalReferenceExpression>(),
|
85
|
+
other.Cast<PositionalReferenceExpression>());
|
85
86
|
case ExpressionClass::STAR:
|
86
|
-
return StarExpression::Equal((
|
87
|
+
return StarExpression::Equal(Cast<StarExpression>(), other.Cast<StarExpression>());
|
87
88
|
case ExpressionClass::SUBQUERY:
|
88
|
-
return SubqueryExpression::Equal((
|
89
|
+
return SubqueryExpression::Equal(Cast<SubqueryExpression>(), other.Cast<SubqueryExpression>());
|
89
90
|
case ExpressionClass::WINDOW:
|
90
|
-
return WindowExpression::Equal((
|
91
|
+
return WindowExpression::Equal(Cast<WindowExpression>(), other.Cast<WindowExpression>());
|
91
92
|
default:
|
92
93
|
throw SerializationException("Unsupported type for expression comparison!");
|
93
94
|
}
|
@@ -246,4 +247,19 @@ unique_ptr<ParsedExpression> ParsedExpression::Deserialize(Deserializer &source)
|
|
246
247
|
return result;
|
247
248
|
}
|
248
249
|
|
250
|
+
bool ParsedExpression::Equals(const unique_ptr<ParsedExpression> &left, const unique_ptr<ParsedExpression> &right) {
|
251
|
+
if (left.get() == right.get()) {
|
252
|
+
return true;
|
253
|
+
}
|
254
|
+
if (!left || !right) {
|
255
|
+
return false;
|
256
|
+
}
|
257
|
+
return left->Equals(*right);
|
258
|
+
}
|
259
|
+
|
260
|
+
bool ParsedExpression::ListEquals(const vector<unique_ptr<ParsedExpression>> &left,
|
261
|
+
const vector<unique_ptr<ParsedExpression>> &right) {
|
262
|
+
return ExpressionUtil::ListEquals(left, right);
|
263
|
+
}
|
264
|
+
|
249
265
|
} // namespace duckdb
|
@@ -158,7 +158,7 @@ void ParsedExpressionIterator::EnumerateQueryNodeModifiers(
|
|
158
158
|
for (auto &modifier : node.modifiers) {
|
159
159
|
switch (modifier->type) {
|
160
160
|
case ResultModifierType::LIMIT_MODIFIER: {
|
161
|
-
auto &limit_modifier = (
|
161
|
+
auto &limit_modifier = modifier->Cast<LimitModifier>();
|
162
162
|
if (limit_modifier.limit) {
|
163
163
|
callback(limit_modifier.limit);
|
164
164
|
}
|
@@ -168,7 +168,7 @@ void ParsedExpressionIterator::EnumerateQueryNodeModifiers(
|
|
168
168
|
} break;
|
169
169
|
|
170
170
|
case ResultModifierType::LIMIT_PERCENT_MODIFIER: {
|
171
|
-
auto &limit_modifier = (
|
171
|
+
auto &limit_modifier = modifier->Cast<LimitPercentModifier>();
|
172
172
|
if (limit_modifier.limit) {
|
173
173
|
callback(limit_modifier.limit);
|
174
174
|
}
|
@@ -178,14 +178,14 @@ void ParsedExpressionIterator::EnumerateQueryNodeModifiers(
|
|
178
178
|
} break;
|
179
179
|
|
180
180
|
case ResultModifierType::ORDER_MODIFIER: {
|
181
|
-
auto &order_modifier = (
|
181
|
+
auto &order_modifier = modifier->Cast<OrderModifier>();
|
182
182
|
for (auto &order : order_modifier.orders) {
|
183
183
|
callback(order.expression);
|
184
184
|
}
|
185
185
|
} break;
|
186
186
|
|
187
187
|
case ResultModifierType::DISTINCT_MODIFIER: {
|
188
|
-
auto &distinct_modifier = (
|
188
|
+
auto &distinct_modifier = modifier->Cast<DistinctModifier>();
|
189
189
|
for (auto &target : distinct_modifier.distinct_on_targets) {
|
190
190
|
callback(target);
|
191
191
|
}
|
@@ -1,18 +1,17 @@
|
|
1
1
|
#include "duckdb/parser/parser.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/parser/transformer.hpp"
|
4
3
|
#include "duckdb/parser/parsed_data/create_table_info.hpp"
|
4
|
+
#include "duckdb/parser/parser_extension.hpp"
|
5
|
+
#include "duckdb/parser/query_error_context.hpp"
|
6
|
+
#include "duckdb/parser/query_node/select_node.hpp"
|
5
7
|
#include "duckdb/parser/statement/create_statement.hpp"
|
6
8
|
#include "duckdb/parser/statement/extension_statement.hpp"
|
7
9
|
#include "duckdb/parser/statement/select_statement.hpp"
|
8
10
|
#include "duckdb/parser/statement/update_statement.hpp"
|
9
|
-
#include "duckdb/parser/query_node/select_node.hpp"
|
10
11
|
#include "duckdb/parser/tableref/expressionlistref.hpp"
|
11
|
-
#include "
|
12
|
-
#include "duckdb/parser/query_error_context.hpp"
|
13
|
-
#include "duckdb/parser/parser_extension.hpp"
|
14
|
-
|
12
|
+
#include "duckdb/parser/transformer.hpp"
|
15
13
|
#include "parser/parser.hpp"
|
14
|
+
#include "postgres_parser.hpp"
|
16
15
|
|
17
16
|
namespace duckdb {
|
18
17
|
|
@@ -45,13 +44,13 @@ static bool ReplaceUnicodeSpaces(const string &query, string &new_query, vector<
|
|
45
44
|
// This function strips unicode space characters from the query and replaces them with regular spaces
|
46
45
|
// It returns true if any unicode space characters were found and stripped
|
47
46
|
// See here for a list of unicode space characters - https://jkorpela.fi/chars/spaces.html
|
48
|
-
|
47
|
+
bool Parser::StripUnicodeSpaces(const string &query_str, string &new_query) {
|
49
48
|
const idx_t NBSP_LEN = 2;
|
50
49
|
const idx_t USP_LEN = 3;
|
51
50
|
idx_t pos = 0;
|
52
51
|
unsigned char quote;
|
53
52
|
vector<UnicodeSpace> unicode_spaces;
|
54
|
-
auto query = (
|
53
|
+
auto query = const_uchar_ptr_cast(query_str.c_str());
|
55
54
|
auto qsize = query_str.size();
|
56
55
|
|
57
56
|
regular:
|
@@ -124,6 +123,29 @@ end:
|
|
124
123
|
return ReplaceUnicodeSpaces(query_str, new_query, unicode_spaces);
|
125
124
|
}
|
126
125
|
|
126
|
+
vector<string> SplitQueryStringIntoStatements(const string &query) {
|
127
|
+
// Break sql string down into sql statements using the tokenizer
|
128
|
+
vector<string> query_statements;
|
129
|
+
auto tokens = Parser::Tokenize(query);
|
130
|
+
auto next_statement_start = 0;
|
131
|
+
for (idx_t i = 1; i < tokens.size(); ++i) {
|
132
|
+
auto &t_prev = tokens[i - 1];
|
133
|
+
auto &t = tokens[i];
|
134
|
+
if (t_prev.type == SimplifiedTokenType::SIMPLIFIED_TOKEN_OPERATOR) {
|
135
|
+
// LCOV_EXCL_START
|
136
|
+
for (idx_t c = t_prev.start; c <= t.start; ++c) {
|
137
|
+
if (query.c_str()[c] == ';') {
|
138
|
+
query_statements.emplace_back(query.substr(next_statement_start, t.start - next_statement_start));
|
139
|
+
next_statement_start = tokens[i].start;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
// LCOV_EXCL_STOP
|
143
|
+
}
|
144
|
+
}
|
145
|
+
query_statements.emplace_back(query.substr(next_statement_start, query.size() - next_statement_start));
|
146
|
+
return query_statements;
|
147
|
+
}
|
148
|
+
|
127
149
|
void Parser::ParseQuery(const string &query) {
|
128
150
|
Transformer transformer(options);
|
129
151
|
string parser_error;
|
@@ -138,39 +160,77 @@ void Parser::ParseQuery(const string &query) {
|
|
138
160
|
}
|
139
161
|
{
|
140
162
|
PostgresParser::SetPreserveIdentifierCase(options.preserve_identifier_case);
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
// SQLStatements
|
151
|
-
transformer.TransformParseTree(parser.parse_tree, statements);
|
152
|
-
} else {
|
153
|
-
parser_error = QueryErrorContext::Format(query, parser.error_message, parser.error_location - 1);
|
154
|
-
}
|
155
|
-
}
|
156
|
-
if (!parser_error.empty()) {
|
157
|
-
if (options.extensions) {
|
158
|
-
for (auto &ext : *options.extensions) {
|
159
|
-
D_ASSERT(ext.parse_function);
|
160
|
-
auto result = ext.parse_function(ext.parser_info.get(), query);
|
161
|
-
if (result.type == ParserExtensionResultType::PARSE_SUCCESSFUL) {
|
162
|
-
auto statement = make_uniq<ExtensionStatement>(ext, std::move(result.parse_data));
|
163
|
-
statement->stmt_length = query.size();
|
164
|
-
statement->stmt_location = 0;
|
165
|
-
statements.push_back(std::move(statement));
|
163
|
+
bool parsing_succeed = false;
|
164
|
+
// Creating a new scope to prevent multiple PostgresParser destructors being called
|
165
|
+
// which led to some memory issues
|
166
|
+
{
|
167
|
+
PostgresParser parser;
|
168
|
+
parser.Parse(query);
|
169
|
+
if (parser.success) {
|
170
|
+
if (!parser.parse_tree) {
|
171
|
+
// empty statement
|
166
172
|
return;
|
167
173
|
}
|
168
|
-
|
169
|
-
|
174
|
+
|
175
|
+
// if it succeeded, we transform the Postgres parse tree into a list of
|
176
|
+
// SQLStatements
|
177
|
+
transformer.TransformParseTree(parser.parse_tree, statements);
|
178
|
+
parsing_succeed = true;
|
179
|
+
} else {
|
180
|
+
parser_error = QueryErrorContext::Format(query, parser.error_message, parser.error_location - 1);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
// If DuckDB fails to parse the entire sql string, break the string down into individual statements
|
184
|
+
// using ';' as the delimiter so that parser extensions can parse the statement
|
185
|
+
if (parsing_succeed) {
|
186
|
+
// no-op
|
187
|
+
// return here would require refactoring into another function. o.w. will just no-op in order to run wrap up
|
188
|
+
// code at the end of this function
|
189
|
+
} else if (!options.extensions || options.extensions->empty()) {
|
190
|
+
throw ParserException(parser_error);
|
191
|
+
} else {
|
192
|
+
// split sql string into statements and re-parse using extension
|
193
|
+
auto query_statements = SplitQueryStringIntoStatements(query);
|
194
|
+
for (auto const &query_statement : query_statements) {
|
195
|
+
PostgresParser another_parser;
|
196
|
+
another_parser.Parse(query_statement);
|
197
|
+
// LCOV_EXCL_START
|
198
|
+
// first see if DuckDB can parse this individual query statement
|
199
|
+
if (another_parser.success) {
|
200
|
+
if (!another_parser.parse_tree) {
|
201
|
+
// empty statement
|
202
|
+
continue;
|
203
|
+
}
|
204
|
+
transformer.TransformParseTree(another_parser.parse_tree, statements);
|
205
|
+
} else {
|
206
|
+
// let extensions parse the statement which DuckDB failed to parse
|
207
|
+
bool parsed_single_statement = false;
|
208
|
+
for (auto &ext : *options.extensions) {
|
209
|
+
D_ASSERT(!parsed_single_statement);
|
210
|
+
D_ASSERT(ext.parse_function);
|
211
|
+
auto result = ext.parse_function(ext.parser_info.get(), query_statement);
|
212
|
+
if (result.type == ParserExtensionResultType::PARSE_SUCCESSFUL) {
|
213
|
+
auto statement = make_uniq<ExtensionStatement>(ext, std::move(result.parse_data));
|
214
|
+
statement->stmt_length = query_statement.size();
|
215
|
+
statement->stmt_location = 0;
|
216
|
+
statements.push_back(std::move(statement));
|
217
|
+
parsed_single_statement = true;
|
218
|
+
break;
|
219
|
+
} else if (result.type == ParserExtensionResultType::DISPLAY_EXTENSION_ERROR) {
|
220
|
+
throw ParserException(result.error);
|
221
|
+
} else {
|
222
|
+
// We move to the next one!
|
223
|
+
}
|
224
|
+
}
|
225
|
+
if (!parsed_single_statement) {
|
226
|
+
parser_error = QueryErrorContext::Format(query, another_parser.error_message,
|
227
|
+
another_parser.error_location - 1);
|
228
|
+
throw ParserException(parser_error);
|
229
|
+
}
|
170
230
|
}
|
231
|
+
// LCOV_EXCL_STOP
|
171
232
|
}
|
172
233
|
}
|
173
|
-
throw ParserException(parser_error);
|
174
234
|
}
|
175
235
|
if (!statements.empty()) {
|
176
236
|
auto &last_statement = statements.back();
|
@@ -288,7 +348,7 @@ vector<OrderByNode> Parser::ParseOrderList(const string &select_list, ParserOpti
|
|
288
348
|
select_node.modifiers.size() != 1) {
|
289
349
|
throw ParserException("Expected a single ORDER clause");
|
290
350
|
}
|
291
|
-
auto &order =
|
351
|
+
auto &order = select_node.modifiers[0]->Cast<OrderModifier>();
|
292
352
|
return std::move(order.orders);
|
293
353
|
}
|
294
354
|
|
@@ -341,7 +401,7 @@ ColumnList Parser::ParseColumnList(const string &column_list, ParserOptions opti
|
|
341
401
|
if (create.info->type != CatalogType::TABLE_ENTRY) {
|
342
402
|
throw InternalException("Expected a single CREATE TABLE statement");
|
343
403
|
}
|
344
|
-
auto &info =
|
404
|
+
auto &info = create.info->Cast<CreateTableInfo>();
|
345
405
|
return std::move(info.columns);
|
346
406
|
}
|
347
407
|
|
@@ -19,7 +19,7 @@ string SelectNode::ToString() const {
|
|
19
19
|
// search for a distinct modifier
|
20
20
|
for (idx_t modifier_idx = 0; modifier_idx < modifiers.size(); modifier_idx++) {
|
21
21
|
if (modifiers[modifier_idx]->type == ResultModifierType::DISTINCT_MODIFIER) {
|
22
|
-
auto &distinct_modifier =
|
22
|
+
auto &distinct_modifier = modifiers[modifier_idx]->Cast<DistinctModifier>();
|
23
23
|
result += "DISTINCT ";
|
24
24
|
if (!distinct_modifier.distinct_on_targets.empty()) {
|
25
25
|
result += "ON (";
|
@@ -120,22 +120,15 @@ bool SelectNode::Equals(const QueryNode *other_p) const {
|
|
120
120
|
return false;
|
121
121
|
}
|
122
122
|
// FROM
|
123
|
-
if (from_table) {
|
124
|
-
// we have a FROM clause, compare to the other one
|
125
|
-
if (!from_table->Equals(other.from_table.get())) {
|
126
|
-
return false;
|
127
|
-
}
|
128
|
-
} else if (other.from_table) {
|
129
|
-
// we don't have a FROM clause, if the other statement has one they are
|
130
|
-
// not equal
|
123
|
+
if (!TableRef::Equals(from_table, other.from_table)) {
|
131
124
|
return false;
|
132
125
|
}
|
133
126
|
// WHERE
|
134
|
-
if (!
|
127
|
+
if (!ParsedExpression::Equals(where_clause, other.where_clause)) {
|
135
128
|
return false;
|
136
129
|
}
|
137
130
|
// GROUP BY
|
138
|
-
if (!
|
131
|
+
if (!ParsedExpression::ListEquals(groups.group_expressions, other.groups.group_expressions)) {
|
139
132
|
return false;
|
140
133
|
}
|
141
134
|
if (groups.grouping_sets != other.groups.grouping_sets) {
|
@@ -145,11 +138,11 @@ bool SelectNode::Equals(const QueryNode *other_p) const {
|
|
145
138
|
return false;
|
146
139
|
}
|
147
140
|
// HAVING
|
148
|
-
if (!
|
141
|
+
if (!ParsedExpression::Equals(having, other.having)) {
|
149
142
|
return false;
|
150
143
|
}
|
151
144
|
// QUALIFY
|
152
|
-
if (!
|
145
|
+
if (!ParsedExpression::Equals(qualify, other.qualify)) {
|
153
146
|
return false;
|
154
147
|
}
|
155
148
|
return true;
|
@@ -82,7 +82,7 @@ string QueryNode::ResultModifiersToString() const {
|
|
82
82
|
for (idx_t modifier_idx = 0; modifier_idx < modifiers.size(); modifier_idx++) {
|
83
83
|
auto &modifier = *modifiers[modifier_idx];
|
84
84
|
if (modifier.type == ResultModifierType::ORDER_MODIFIER) {
|
85
|
-
auto &order_modifier = (
|
85
|
+
auto &order_modifier = modifier.Cast<OrderModifier>();
|
86
86
|
result += " ORDER BY ";
|
87
87
|
for (idx_t k = 0; k < order_modifier.orders.size(); k++) {
|
88
88
|
if (k > 0) {
|
@@ -91,7 +91,7 @@ string QueryNode::ResultModifiersToString() const {
|
|
91
91
|
result += order_modifier.orders[k].ToString();
|
92
92
|
}
|
93
93
|
} else if (modifier.type == ResultModifierType::LIMIT_MODIFIER) {
|
94
|
-
auto &limit_modifier = (
|
94
|
+
auto &limit_modifier = modifier.Cast<LimitModifier>();
|
95
95
|
if (limit_modifier.limit) {
|
96
96
|
result += " LIMIT " + limit_modifier.limit->ToString();
|
97
97
|
}
|
@@ -99,7 +99,7 @@ string QueryNode::ResultModifiersToString() const {
|
|
99
99
|
result += " OFFSET " + limit_modifier.offset->ToString();
|
100
100
|
}
|
101
101
|
} else if (modifier.type == ResultModifierType::LIMIT_PERCENT_MODIFIER) {
|
102
|
-
auto &limit_p_modifier = (
|
102
|
+
auto &limit_p_modifier = modifier.Cast<LimitPercentModifier>();
|
103
103
|
if (limit_p_modifier.limit) {
|
104
104
|
result += " LIMIT (" + limit_p_modifier.limit->ToString() + ") %";
|
105
105
|
}
|
@@ -121,11 +121,12 @@ bool QueryNode::Equals(const QueryNode *other) const {
|
|
121
121
|
if (other->type != this->type) {
|
122
122
|
return false;
|
123
123
|
}
|
124
|
+
|
124
125
|
if (modifiers.size() != other->modifiers.size()) {
|
125
126
|
return false;
|
126
127
|
}
|
127
128
|
for (idx_t i = 0; i < modifiers.size(); i++) {
|
128
|
-
if (!modifiers[i]->Equals(other->modifiers[i]
|
129
|
+
if (!modifiers[i]->Equals(*other->modifiers[i])) {
|
129
130
|
return false;
|
130
131
|
}
|
131
132
|
}
|
@@ -141,7 +142,7 @@ bool QueryNode::Equals(const QueryNode *other) const {
|
|
141
142
|
if (entry.second->aliases != other_entry->second->aliases) {
|
142
143
|
return false;
|
143
144
|
}
|
144
|
-
if (!entry.second->query->Equals(other_entry->second->query
|
145
|
+
if (!entry.second->query->Equals(*other_entry->second->query)) {
|
145
146
|
return false;
|
146
147
|
}
|
147
148
|
}
|
@@ -257,7 +258,7 @@ void QueryNode::AddDistinct() {
|
|
257
258
|
for (idx_t modifier_idx = modifiers.size(); modifier_idx > 0; modifier_idx--) {
|
258
259
|
auto &modifier = *modifiers[modifier_idx - 1];
|
259
260
|
if (modifier.type == ResultModifierType::DISTINCT_MODIFIER) {
|
260
|
-
auto &distinct_modifier = (
|
261
|
+
auto &distinct_modifier = modifier.Cast<DistinctModifier>();
|
261
262
|
if (distinct_modifier.distinct_on_targets.empty()) {
|
262
263
|
// we have a DISTINCT without an ON clause - this distinct does not need to be added
|
263
264
|
return;
|
@@ -6,11 +6,8 @@
|
|
6
6
|
|
7
7
|
namespace duckdb {
|
8
8
|
|
9
|
-
bool ResultModifier::Equals(const ResultModifier
|
10
|
-
|
11
|
-
return false;
|
12
|
-
}
|
13
|
-
return type == other->type;
|
9
|
+
bool ResultModifier::Equals(const ResultModifier &other) const {
|
10
|
+
return type == other.type;
|
14
11
|
}
|
15
12
|
|
16
13
|
void ResultModifier::Serialize(Serializer &serializer) const {
|
@@ -72,15 +69,15 @@ unique_ptr<ResultModifier> ResultModifier::Deserialize(Deserializer &source) {
|
|
72
69
|
return result;
|
73
70
|
}
|
74
71
|
|
75
|
-
bool LimitModifier::Equals(const ResultModifier
|
72
|
+
bool LimitModifier::Equals(const ResultModifier &other_p) const {
|
76
73
|
if (!ResultModifier::Equals(other_p)) {
|
77
74
|
return false;
|
78
75
|
}
|
79
|
-
auto &other = (
|
80
|
-
if (!
|
76
|
+
auto &other = other_p.Cast<LimitModifier>();
|
77
|
+
if (!ParsedExpression::Equals(limit, other.limit)) {
|
81
78
|
return false;
|
82
79
|
}
|
83
|
-
if (!
|
80
|
+
if (!ParsedExpression::Equals(offset, other.offset)) {
|
84
81
|
return false;
|
85
82
|
}
|
86
83
|
return true;
|
@@ -122,11 +119,11 @@ unique_ptr<ResultModifier> LimitModifier::Deserialize(FieldReader &reader) {
|
|
122
119
|
return std::move(mod);
|
123
120
|
}
|
124
121
|
|
125
|
-
bool DistinctModifier::Equals(const ResultModifier
|
122
|
+
bool DistinctModifier::Equals(const ResultModifier &other_p) const {
|
126
123
|
if (!ResultModifier::Equals(other_p)) {
|
127
124
|
return false;
|
128
125
|
}
|
129
|
-
auto &other = (
|
126
|
+
auto &other = other_p.Cast<DistinctModifier>();
|
130
127
|
if (!ExpressionUtil::ListEquals(distinct_on_targets, other.distinct_on_targets)) {
|
131
128
|
return false;
|
132
129
|
}
|
@@ -162,11 +159,11 @@ unique_ptr<ResultModifier> DistinctModifier::Deserialize(FieldReader &reader) {
|
|
162
159
|
return std::move(mod);
|
163
160
|
}
|
164
161
|
|
165
|
-
bool OrderModifier::Equals(const ResultModifier
|
162
|
+
bool OrderModifier::Equals(const ResultModifier &other_p) const {
|
166
163
|
if (!ResultModifier::Equals(other_p)) {
|
167
164
|
return false;
|
168
165
|
}
|
169
|
-
auto &other = (
|
166
|
+
auto &other = other_p.Cast<OrderModifier>();
|
170
167
|
if (orders.size() != other.orders.size()) {
|
171
168
|
return false;
|
172
169
|
}
|
@@ -174,13 +171,23 @@ bool OrderModifier::Equals(const ResultModifier *other_p) const {
|
|
174
171
|
if (orders[i].type != other.orders[i].type) {
|
175
172
|
return false;
|
176
173
|
}
|
177
|
-
if (!BaseExpression::Equals(orders[i].expression
|
174
|
+
if (!BaseExpression::Equals(*orders[i].expression, *other.orders[i].expression)) {
|
178
175
|
return false;
|
179
176
|
}
|
180
177
|
}
|
181
178
|
return true;
|
182
179
|
}
|
183
180
|
|
181
|
+
bool OrderModifier::Equals(const unique_ptr<OrderModifier> &left, const unique_ptr<OrderModifier> &right) {
|
182
|
+
if (left.get() == right.get()) {
|
183
|
+
return true;
|
184
|
+
}
|
185
|
+
if (!left || !right) {
|
186
|
+
return false;
|
187
|
+
}
|
188
|
+
return left->Equals(*right);
|
189
|
+
}
|
190
|
+
|
184
191
|
unique_ptr<ResultModifier> OrderModifier::Copy() const {
|
185
192
|
auto copy = make_uniq<OrderModifier>();
|
186
193
|
for (auto &order : orders) {
|
@@ -265,15 +272,15 @@ unique_ptr<ResultModifier> OrderModifier::Deserialize(FieldReader &reader) {
|
|
265
272
|
return std::move(mod);
|
266
273
|
}
|
267
274
|
|
268
|
-
bool LimitPercentModifier::Equals(const ResultModifier
|
275
|
+
bool LimitPercentModifier::Equals(const ResultModifier &other_p) const {
|
269
276
|
if (!ResultModifier::Equals(other_p)) {
|
270
277
|
return false;
|
271
278
|
}
|
272
|
-
auto &other = (
|
273
|
-
if (!
|
279
|
+
auto &other = other_p.Cast<LimitPercentModifier>();
|
280
|
+
if (!ParsedExpression::Equals(limit, other.limit)) {
|
274
281
|
return false;
|
275
282
|
}
|
276
|
-
if (!
|
283
|
+
if (!ParsedExpression::Equals(offset, other.offset)) {
|
277
284
|
return false;
|
278
285
|
}
|
279
286
|
return true;
|
@@ -33,11 +33,11 @@ unique_ptr<SelectStatement> SelectStatement::FormatDeserialize(FormatDeserialize
|
|
33
33
|
return result;
|
34
34
|
}
|
35
35
|
|
36
|
-
bool SelectStatement::Equals(const SQLStatement
|
37
|
-
if (type != other_p
|
36
|
+
bool SelectStatement::Equals(const SQLStatement &other_p) const {
|
37
|
+
if (type != other_p.type) {
|
38
38
|
return false;
|
39
39
|
}
|
40
|
-
auto &other = other_p
|
40
|
+
auto &other = other_p.Cast<SelectStatement>();
|
41
41
|
return node->Equals(other.node.get());
|
42
42
|
}
|
43
43
|
|
@@ -15,13 +15,13 @@ string BaseTableRef::ToString() const {
|
|
15
15
|
return BaseToString(result, column_name_alias);
|
16
16
|
}
|
17
17
|
|
18
|
-
bool BaseTableRef::Equals(const TableRef
|
18
|
+
bool BaseTableRef::Equals(const TableRef &other_p) const {
|
19
19
|
if (!TableRef::Equals(other_p)) {
|
20
20
|
return false;
|
21
21
|
}
|
22
|
-
auto other = (
|
23
|
-
return other
|
24
|
-
|
22
|
+
auto &other = other_p.Cast<BaseTableRef>();
|
23
|
+
return other.catalog_name == catalog_name && other.schema_name == schema_name && other.table_name == table_name &&
|
24
|
+
column_name_alias == other.column_name_alias;
|
25
25
|
}
|
26
26
|
|
27
27
|
void BaseTableRef::Serialize(FieldWriter &writer) const {
|
@@ -27,20 +27,20 @@ string ExpressionListRef::ToString() const {
|
|
27
27
|
return BaseToString(result, expected_names);
|
28
28
|
}
|
29
29
|
|
30
|
-
bool ExpressionListRef::Equals(const TableRef
|
30
|
+
bool ExpressionListRef::Equals(const TableRef &other_p) const {
|
31
31
|
if (!TableRef::Equals(other_p)) {
|
32
32
|
return false;
|
33
33
|
}
|
34
|
-
auto other = (
|
35
|
-
if (values.size() != other
|
34
|
+
auto &other = other_p.Cast<ExpressionListRef>();
|
35
|
+
if (values.size() != other.values.size()) {
|
36
36
|
return false;
|
37
37
|
}
|
38
38
|
for (idx_t i = 0; i < values.size(); i++) {
|
39
|
-
if (values[i].size() != other
|
39
|
+
if (values[i].size() != other.values[i].size()) {
|
40
40
|
return false;
|
41
41
|
}
|
42
42
|
for (idx_t j = 0; j < values[i].size(); j++) {
|
43
|
-
if (!values[i][j]->Equals(other
|
43
|
+
if (!values[i][j]->Equals(*other.values[i][j])) {
|
44
44
|
return false;
|
45
45
|
}
|
46
46
|
}
|
@@ -48,21 +48,21 @@ string JoinRef::ToString() const {
|
|
48
48
|
return result;
|
49
49
|
}
|
50
50
|
|
51
|
-
bool JoinRef::Equals(const TableRef
|
51
|
+
bool JoinRef::Equals(const TableRef &other_p) const {
|
52
52
|
if (!TableRef::Equals(other_p)) {
|
53
53
|
return false;
|
54
54
|
}
|
55
|
-
auto other = (
|
56
|
-
if (using_columns.size() != other
|
55
|
+
auto &other = other_p.Cast<JoinRef>();
|
56
|
+
if (using_columns.size() != other.using_columns.size()) {
|
57
57
|
return false;
|
58
58
|
}
|
59
59
|
for (idx_t i = 0; i < using_columns.size(); i++) {
|
60
|
-
if (using_columns[i] != other
|
60
|
+
if (using_columns[i] != other.using_columns[i]) {
|
61
61
|
return false;
|
62
62
|
}
|
63
63
|
}
|
64
|
-
return left->Equals(other
|
65
|
-
|
64
|
+
return left->Equals(*other.left) && right->Equals(*other.right) &&
|
65
|
+
ParsedExpression::Equals(condition, other.condition) && type == other.type;
|
66
66
|
}
|
67
67
|
|
68
68
|
unique_ptr<TableRef> JoinRef::Copy() {
|