duckdb 0.7.2-dev225.0 → 0.7.2-dev2366.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 +13 -6
- package/lib/duckdb.d.ts +55 -2
- package/lib/duckdb.js +20 -1
- package/package.json +1 -1
- package/src/connection.cpp +13 -14
- package/src/data_chunk.cpp +14 -2
- package/src/database.cpp +15 -16
- package/src/duckdb/extension/icu/icu-dateadd.cpp +2 -2
- package/src/duckdb/extension/icu/icu-datefunc.cpp +23 -11
- package/src/duckdb/extension/icu/icu-datepart.cpp +18 -18
- package/src/duckdb/extension/icu/icu-datesub.cpp +2 -2
- package/src/duckdb/extension/icu/icu-datetrunc.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +34 -31
- package/src/duckdb/extension/icu/icu-list-range.cpp +207 -0
- package/src/duckdb/extension/icu/icu-makedate.cpp +53 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +134 -46
- package/src/duckdb/extension/icu/icu-table-range.cpp +10 -10
- package/src/duckdb/extension/icu/icu-timebucket.cpp +6 -6
- package/src/duckdb/extension/icu/icu-timezone.cpp +19 -18
- 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 +92 -0
- package/src/duckdb/extension/json/include/json_executors.hpp +2 -2
- package/src/duckdb/extension/json/include/json_functions.hpp +8 -1
- package/src/duckdb/extension/json/include/json_scan.hpp +9 -10
- package/src/duckdb/extension/json/include/json_serializer.hpp +82 -0
- package/src/duckdb/extension/json/include/json_structure.hpp +1 -1
- package/src/duckdb/extension/json/json-extension.cpp +6 -0
- package/src/duckdb/extension/json/json_deserializer.cpp +306 -0
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +19 -19
- package/src/duckdb/extension/json/json_functions/json_create.cpp +28 -27
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +279 -0
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +4 -4
- package/src/duckdb/extension/json/json_functions/read_json.cpp +26 -35
- package/src/duckdb/extension/json/json_functions.cpp +37 -20
- 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 +163 -100
- 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 +26 -10
- 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 +3 -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 +113 -253
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +11 -19
- package/src/duckdb/extension/parquet/parquet_reader.cpp +120 -255
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +53 -40
- package/src/duckdb/extension/parquet/parquet_timestamp.cpp +16 -6
- package/src/duckdb/extension/parquet/parquet_writer.cpp +2 -2
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +4 -4
- package/src/duckdb/src/catalog/catalog.cpp +79 -49
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +33 -33
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +52 -75
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +5 -5
- package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +8 -8
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +8 -12
- package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +11 -5
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +6 -6
- package/src/duckdb/src/catalog/catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_set.cpp +56 -53
- package/src/duckdb/src/catalog/default/default_functions.cpp +15 -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 +46 -40
- package/src/duckdb/src/catalog/duck_catalog.cpp +37 -10
- package/src/duckdb/src/common/adbc/adbc.cpp +441 -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 +122 -53
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +5 -5
- 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/enums/expression_type.cpp +8 -222
- package/src/duckdb/src/common/enums/join_type.cpp +3 -22
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +4 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/exception.cpp +19 -1
- 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_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 +82 -14
- package/src/duckdb/src/common/multi_file_reader.cpp +373 -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 +102 -370
- 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/buffered_deserializer.cpp +4 -0
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +21 -3
- package/src/duckdb/src/common/serializer/enum_serializer.cpp +1180 -0
- 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 +644 -0
- package/src/duckdb/src/common/sort/sort_state.cpp +18 -19
- package/src/duckdb/src/common/sort/sorted_block.cpp +23 -18
- package/src/duckdb/src/common/string_util.cpp +43 -3
- 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 +212 -151
- package/src/duckdb/src/common/types/vector_buffer.cpp +3 -3
- package/src/duckdb/src/common/types/vector_cache.cpp +4 -4
- package/src/duckdb/src/common/types.cpp +314 -152
- package/src/duckdb/src/common/value_operations/comparison_operations.cpp +14 -22
- package/src/duckdb/src/common/vector.cpp +12 -0
- package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +10 -10
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +11 -10
- 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/execution/adaptive_filter.cpp +1 -1
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +331 -339
- package/src/duckdb/src/execution/column_binding_resolver.cpp +27 -11
- 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 +27 -15
- package/src/duckdb/src/execution/index/art/art_key.cpp +2 -2
- 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 +12 -12
- package/src/duckdb/src/execution/operator/aggregate/grouped_aggregate_data.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +44 -44
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +22 -23
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +13 -9
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +43 -29
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +237 -917
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +9 -9
- package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +3 -8
- package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +11 -8
- package/src/duckdb/src/execution/operator/helper/physical_limit_percent.cpp +8 -9
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +14 -10
- package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +5 -5
- package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +8 -14
- package/src/duckdb/src/execution/operator/helper/physical_streaming_limit.cpp +6 -6
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +3 -3
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +13 -11
- package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +37 -22
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +78 -31
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +7 -7
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +18 -17
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +193 -169
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +42 -38
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +29 -19
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +9 -20
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +21 -21
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +28 -33
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +6 -7
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +4 -2
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +17 -17
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +14 -14
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +55 -47
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +96 -43
- package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +17 -13
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +12 -19
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +134 -30
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +41 -36
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +31 -29
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +11 -12
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +30 -29
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +51 -49
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +15 -14
- 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 +14 -8
- package/src/duckdb/src/execution/operator/scan/physical_dummy_scan.cpp +1 -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 +26 -11
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +27 -15
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +17 -16
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +4 -4
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +26 -46
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +2 -2
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +2 -2
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +19 -23
- package/src/duckdb/src/execution/operator/set/physical_union.cpp +15 -4
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +30 -43
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +35 -39
- package/src/duckdb/src/execution/physical_operator.cpp +22 -37
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +34 -28
- package/src/duckdb/src/execution/physical_plan/plan_any_join.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_asof_join.cpp +97 -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 +119 -70
- package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +3 -3
- 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 +6 -6
- 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 +4 -4
- 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 +84 -54
- package/src/duckdb/src/execution/reservoir_sample.cpp +3 -3
- package/src/duckdb/src/execution/window_segment_tree.cpp +196 -26
- package/src/duckdb/src/function/aggregate/algebraic/avg.cpp +4 -4
- package/src/duckdb/src/function/aggregate/distributive/approx_count.cpp +1 -1
- package/src/duckdb/src/function/aggregate/distributive/arg_min_max.cpp +3 -3
- package/src/duckdb/src/function/aggregate/distributive/bitagg.cpp +3 -3
- package/src/duckdb/src/function/aggregate/distributive/bitstring_agg.cpp +35 -27
- package/src/duckdb/src/function/aggregate/distributive/bool.cpp +2 -0
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +3 -4
- package/src/duckdb/src/function/aggregate/distributive/entropy.cpp +1 -1
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +12 -10
- package/src/duckdb/src/function/aggregate/distributive/kurtosis.cpp +3 -2
- package/src/duckdb/src/function/aggregate/distributive/minmax.cpp +25 -25
- package/src/duckdb/src/function/aggregate/distributive/skew.cpp +5 -1
- package/src/duckdb/src/function/aggregate/distributive/string_agg.cpp +9 -9
- package/src/duckdb/src/function/aggregate/distributive/sum.cpp +19 -13
- package/src/duckdb/src/function/aggregate/holistic/approximate_quantile.cpp +10 -7
- package/src/duckdb/src/function/aggregate/holistic/mode.cpp +2 -2
- package/src/duckdb/src/function/aggregate/holistic/quantile.cpp +25 -10
- package/src/duckdb/src/function/aggregate/holistic/reservoir_quantile.cpp +6 -6
- package/src/duckdb/src/function/aggregate/nested/histogram.cpp +2 -2
- package/src/duckdb/src/function/aggregate/nested/list.cpp +42 -804
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +289 -98
- 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 +39 -13
- 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 -4
- package/src/duckdb/src/function/function_binder.cpp +8 -14
- 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/bit/bitstring.cpp +4 -3
- package/src/duckdb/src/function/scalar/blob/encode.cpp +1 -1
- package/src/duckdb/src/function/scalar/date/current.cpp +0 -2
- package/src/duckdb/src/function/scalar/date/date_diff.cpp +0 -1
- package/src/duckdb/src/function/scalar/date/date_part.cpp +22 -30
- package/src/duckdb/src/function/scalar/date/date_sub.cpp +0 -1
- package/src/duckdb/src/function/scalar/date/date_trunc.cpp +10 -14
- package/src/duckdb/src/function/scalar/date/strftime.cpp +136 -39
- package/src/duckdb/src/function/scalar/generic/alias.cpp +1 -1
- package/src/duckdb/src/function/scalar/generic/constant_or_null.cpp +6 -6
- package/src/duckdb/src/function/scalar/generic/current_setting.cpp +5 -5
- package/src/duckdb/src/function/scalar/generic/error.cpp +21 -0
- package/src/duckdb/src/function/scalar/generic/stats.cpp +6 -8
- package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -0
- package/src/duckdb/src/function/scalar/list/array_slice.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/contains_or_position.cpp +5 -147
- package/src/duckdb/src/function/scalar/list/flatten.cpp +7 -14
- package/src/duckdb/src/function/scalar/list/list_aggregates.cpp +12 -11
- package/src/duckdb/src/function/scalar/list/list_concat.cpp +9 -13
- package/src/duckdb/src/function/scalar/list/list_extract.cpp +6 -13
- package/src/duckdb/src/function/scalar/list/list_lambdas.cpp +13 -9
- package/src/duckdb/src/function/scalar/list/list_sort.cpp +32 -25
- package/src/duckdb/src/function/scalar/list/list_value.cpp +7 -11
- package/src/duckdb/src/function/scalar/map/cardinality.cpp +1 -1
- package/src/duckdb/src/function/scalar/map/map.cpp +48 -2
- package/src/duckdb/src/function/scalar/map/map_entries.cpp +2 -2
- package/src/duckdb/src/function/scalar/map/map_extract.cpp +69 -27
- package/src/duckdb/src/function/scalar/map/map_from_entries.cpp +1 -1
- package/src/duckdb/src/function/scalar/map/map_keys_values.cpp +1 -1
- package/src/duckdb/src/function/scalar/math/numeric.cpp +163 -22
- package/src/duckdb/src/function/scalar/math/random.cpp +3 -3
- package/src/duckdb/src/function/scalar/math/setseed.cpp +4 -4
- package/src/duckdb/src/function/scalar/math_functions.cpp +4 -0
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +50 -51
- package/src/duckdb/src/function/scalar/operators/multiply.cpp +5 -0
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +35 -35
- package/src/duckdb/src/function/scalar/string/ascii.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +4 -8
- 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/damerau_levenshtein.cpp +106 -0
- package/src/duckdb/src/function/scalar/string/hex.cpp +384 -0
- package/src/duckdb/src/function/scalar/string/instr.cpp +3 -7
- package/src/duckdb/src/function/scalar/string/jaccard.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/jaro_winkler.cpp +5 -5
- package/src/duckdb/src/function/scalar/string/length.cpp +3 -7
- package/src/duckdb/src/function/scalar/string/levenshtein.cpp +4 -4
- package/src/duckdb/src/function/scalar/string/like.cpp +16 -21
- package/src/duckdb/src/function/scalar/string/mismatches.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/nfc_normalize.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/pad.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/prefix.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/printf.cpp +5 -5
- 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/repeat.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/replace.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/reverse.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/starts_with.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/string_split.cpp +6 -6
- package/src/duckdb/src/function/scalar/string/strip_accents.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/substring.cpp +5 -9
- package/src/duckdb/src/function/scalar/string/suffix.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/translate.cpp +3 -3
- package/src/duckdb/src/function/scalar/string/trim.cpp +3 -3
- package/src/duckdb/src/function/scalar/string_functions.cpp +2 -0
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +10 -15
- package/src/duckdb/src/function/scalar/struct/struct_insert.cpp +12 -15
- package/src/duckdb/src/function/scalar/struct/struct_pack.cpp +9 -10
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +17 -19
- package/src/duckdb/src/function/scalar/union/union_extract.cpp +5 -5
- package/src/duckdb/src/function/scalar/union/union_value.cpp +2 -2
- package/src/duckdb/src/function/scalar_macro_function.cpp +4 -4
- package/src/duckdb/src/function/table/arrow.cpp +17 -14
- package/src/duckdb/src/function/table/arrow_conversion.cpp +28 -4
- package/src/duckdb/src/function/table/checkpoint.cpp +12 -8
- package/src/duckdb/src/function/table/copy_csv.cpp +23 -19
- 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 +10 -10
- package/src/duckdb/src/function/table/read_csv.cpp +318 -278
- package/src/duckdb/src/function/table/repeat.cpp +4 -4
- package/src/duckdb/src/function/table/summary.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +25 -25
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +21 -20
- 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 +5 -5
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +3 -3
- package/src/duckdb/src/function/table/system/duckdb_keywords.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +3 -3
- package/src/duckdb/src/function/table/system/duckdb_settings.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +4 -4
- package/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +2 -2
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +2 -2
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +3 -3
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +9 -7
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +22 -23
- 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 +55 -62
- 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/include/duckdb/catalog/catalog.hpp +31 -12
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +3 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +5 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +3 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +3 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +14 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry_map.hpp +38 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +5 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +4 -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 +2 -1
- 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/allocator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +1 -1
- 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/enums/aggregate_handling.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/enums/file_glob_options.hpp +20 -0
- 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/order_preservation_type.hpp +24 -0
- package/src/duckdb/src/include/duckdb/common/enums/order_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/set_operation_type.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/exception.hpp +77 -5
- package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +6 -2
- 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_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 +199 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +28 -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_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/radix.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +80 -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/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/enum_serializer.hpp +113 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +373 -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/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 +247 -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/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 +3 -1
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +43 -59
- 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 +45 -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/execution/aggregate_hashtable.hpp +69 -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 +7 -7
- 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 +4 -15
- 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/physical_hash_aggregate.hpp +12 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +12 -2
- 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 +9 -0
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +9 -3
- package/src/duckdb/src/include/duckdb/execution/operator/filter/physical_filter.hpp +3 -0
- 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 +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +8 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +8 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +4 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reset.hpp +7 -0
- 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 +7 -0
- 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 +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/outer_join_marker.hpp +2 -2
- 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_blockwise_nl_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +13 -7
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +10 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +3 -0
- 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 +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +5 -2
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +11 -1
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +10 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +15 -10
- 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 +2 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +19 -15
- 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_insert.hpp +11 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +12 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +8 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +18 -7
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +7 -0
- 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 +11 -5
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +7 -0
- 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 +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +6 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_table.hpp +9 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +7 -0
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +9 -2
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_union.hpp +5 -1
- package/src/duckdb/src/include/duckdb/execution/partitionable_hashtable.hpp +7 -3
- package/src/duckdb/src/include/duckdb/execution/perfect_aggregate_hashtable.hpp +4 -0
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +37 -70
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +150 -0
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +55 -5
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +21 -9
- 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 +22 -0
- 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/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 +4 -0
- package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +138 -0
- package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +12 -0
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +50 -3
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +81 -1
- package/src/duckdb/src/include/duckdb/function/scalar/strftime.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +10 -2
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +13 -2
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +5 -2
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +13 -2
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +41 -6
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +30 -0
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +6 -3
- package/src/duckdb/src/include/duckdb/main/capi/cast/utils.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +10 -2
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +6 -3
- package/src/duckdb/src/include/duckdb/main/config.hpp +4 -6
- package/src/duckdb/src/include/duckdb/main/connection_manager.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +4 -3
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +5 -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 +18 -4
- package/src/duckdb/src/include/duckdb/main/relation/explain_relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/settings.hpp +29 -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/meta_pipeline.hpp +5 -5
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +19 -18
- package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.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 +5 -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 +10 -0
- 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/parsed_data/alter_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +6 -0
- 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_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_type_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +2 -2
- 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/pragma_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +2 -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 +3 -0
- 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 +27 -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 +20 -1
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +25 -41
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +17 -16
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +39 -33
- 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/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 +3 -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 +65 -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 +18 -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 +3 -0
- 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 +4 -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 +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +3 -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 +3 -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 +3 -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 +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +5 -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 +36 -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 +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +9 -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 +3 -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 +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +3 -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 +11 -2
- 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/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 +49 -182
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +3 -2
- 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 +6 -10
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +3 -2
- 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 +6 -10
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +4 -3
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +7 -5
- package/src/duckdb/src/include/duckdb/storage/index.hpp +20 -6
- package/src/duckdb/src/include/duckdb/storage/meta_block_reader.hpp +7 -0
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +159 -0
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +93 -31
- package/src/duckdb/src/include/duckdb/storage/statistics/column_statistics.hpp +22 -3
- package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +8 -6
- package/src/duckdb/src/include/duckdb/storage/statistics/list_stats.hpp +41 -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 +114 -0
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +62 -0
- package/src/duckdb/src/include/duckdb/storage/statistics/segment_statistics.hpp +2 -7
- package/src/duckdb/src/include/duckdb/storage/statistics/string_stats.hpp +74 -0
- package/src/duckdb/src/include/duckdb/storage/statistics/struct_stats.hpp +42 -0
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +4 -5
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +21 -7
- 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/persistent_table_data.hpp +6 -3
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +42 -46
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +24 -8
- 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 +6 -6
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +281 -26
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +0 -4
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +5 -0
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +4 -5
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +21 -21
- package/src/duckdb/src/include/duckdb/transaction/cleanup_state.hpp +3 -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 +37 -33
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +6 -5
- 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.h +22 -1
- package/src/duckdb/src/main/appender.cpp +9 -9
- package/src/duckdb/src/main/attached_database.cpp +6 -7
- 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/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 +38 -15
- package/src/duckdb/src/main/capi/threading-c.cpp +1 -1
- package/src/duckdb/src/main/client_context.cpp +84 -85
- package/src/duckdb/src/main/client_data.cpp +11 -10
- package/src/duckdb/src/main/client_verify.cpp +2 -2
- package/src/duckdb/src/main/config.cpp +73 -1
- package/src/duckdb/src/main/connection.cpp +3 -3
- package/src/duckdb/src/main/database.cpp +29 -19
- package/src/duckdb/src/main/database_manager.cpp +6 -6
- package/src/duckdb/src/main/extension/extension_helper.cpp +18 -3
- package/src/duckdb/src/main/extension/extension_install.cpp +18 -2
- package/src/duckdb/src/main/extension/extension_load.cpp +30 -4
- 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 +13 -0
- 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 +3 -3
- 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 +2 -2
- 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 +78 -15
- 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_aggregate.cpp +9 -3
- package/src/duckdb/src/optimizer/statistics/expression/propagate_and_compress.cpp +9 -10
- package/src/duckdb/src/optimizer/statistics/expression/propagate_between.cpp +6 -6
- package/src/duckdb/src/optimizer/statistics/expression/propagate_cast.cpp +14 -11
- package/src/duckdb/src/optimizer/statistics/expression/propagate_columnref.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_comparison.cpp +15 -17
- package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +2 -3
- package/src/duckdb/src/optimizer/statistics/expression/propagate_constant.cpp +3 -75
- package/src/duckdb/src/optimizer/statistics/expression/propagate_function.cpp +7 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +12 -2
- package/src/duckdb/src/optimizer/statistics/operator/propagate_aggregate.cpp +2 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +40 -42
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +9 -9
- package/src/duckdb/src/optimizer/statistics/operator/propagate_limit.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics_propagator.cpp +34 -22
- 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/executor.cpp +59 -53
- package/src/duckdb/src/parallel/meta_pipeline.cpp +8 -15
- package/src/duckdb/src/parallel/pipeline.cpp +67 -35
- package/src/duckdb/src/parallel/pipeline_executor.cpp +23 -23
- package/src/duckdb/src/parallel/pipeline_initialize_event.cpp +1 -1
- package/src/duckdb/src/parallel/task_scheduler.cpp +6 -6
- 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_scalar_function_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +27 -28
- 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 +2 -2
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +3 -3
- 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 +43 -12
- 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 +1 -1
- package/src/duckdb/src/parser/statement/pragma_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/select_statement.cpp +59 -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 +31 -2
- 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 +46 -0
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +7 -7
- 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 +96 -119
- 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 +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +10 -10
- 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 +4 -4
- 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 +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_detach.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +1 -1
- 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 +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_load.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +59 -25
- 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 +7 -8
- 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 +13 -2
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +23 -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 +96 -96
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +19 -16
- package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +8 -8
- package/src/duckdb/src/planner/binder/expression/bind_case_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +60 -16
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_conjunction_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_constant_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +40 -29
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +14 -13
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +10 -10
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +16 -3
- 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 +9 -5
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +163 -24
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +6 -6
- 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 +134 -133
- 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 +3 -3
- 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 -25
- 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 +28 -16
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +51 -52
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +31 -23
- 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 +1 -1
- 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 +25 -26
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +39 -36
- package/src/duckdb/src/planner/binder/statement/bind_load.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +1 -1
- 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 +2 -2
- 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 +37 -34
- 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 +45 -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 +37 -18
- 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 +85 -94
- package/src/duckdb/src/planner/bound_result_modifier.cpp +27 -1
- 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 +4 -4
- 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 +4 -0
- 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 +4 -4
- package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +21 -22
- 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 +146 -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 +5 -7
- 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 +1 -1
- 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 +2 -2
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +3 -3
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +4 -4
- package/src/duckdb/src/planner/operator/logical_create.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +2 -2
- 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 +1 -1
- package/src/duckdb/src/planner/operator/logical_delete.cpp +5 -5
- package/src/duckdb/src/planner/operator/logical_delim_get.cpp +1 -1
- 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 +1 -1
- package/src/duckdb/src/planner/operator/logical_expression_get.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_filter.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_get.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_insert.cpp +6 -7
- 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 +35 -0
- package/src/duckdb/src/planner/operator/logical_positional_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_projection.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +1 -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_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 +1 -1
- package/src/duckdb/src/planner/operator/logical_update.cpp +6 -7
- package/src/duckdb/src/planner/operator/logical_window.cpp +1 -1
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -5
- package/src/duckdb/src/planner/planner.cpp +2 -1
- package/src/duckdb/src/planner/pragma_handler.cpp +9 -7
- 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 +83 -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/row_group_writer.cpp +1 -1
- package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +5 -16
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +13 -7
- package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +2 -2
- package/src/duckdb/src/storage/checkpoint_manager.cpp +38 -32
- package/src/duckdb/src/storage/compression/bitpacking.cpp +12 -13
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +12 -13
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +9 -8
- package/src/duckdb/src/storage/compression/fsst.cpp +15 -17
- package/src/duckdb/src/storage/compression/numeric_constant.cpp +10 -11
- package/src/duckdb/src/storage/compression/patas.cpp +1 -1
- package/src/duckdb/src/storage/compression/rle.cpp +10 -11
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +7 -7
- package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +9 -9
- package/src/duckdb/src/storage/data_table.cpp +50 -50
- package/src/duckdb/src/storage/index.cpp +17 -7
- package/src/duckdb/src/storage/local_storage.cpp +98 -91
- package/src/duckdb/src/storage/meta_block_reader.cpp +23 -0
- package/src/duckdb/src/storage/single_file_block_manager.cpp +2 -2
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +801 -0
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +373 -128
- package/src/duckdb/src/storage/statistics/column_statistics.cpp +57 -3
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +10 -11
- package/src/duckdb/src/storage/statistics/list_stats.cpp +121 -0
- package/src/duckdb/src/storage/statistics/numeric_stats.cpp +591 -0
- package/src/duckdb/src/storage/statistics/numeric_stats_union.cpp +65 -0
- package/src/duckdb/src/storage/statistics/segment_statistics.cpp +2 -11
- package/src/duckdb/src/storage/statistics/string_stats.cpp +273 -0
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +133 -0
- package/src/duckdb/src/storage/storage_info.cpp +2 -2
- package/src/duckdb/src/storage/storage_lock.cpp +2 -2
- package/src/duckdb/src/storage/storage_manager.cpp +20 -21
- package/src/duckdb/src/storage/table/chunk_info.cpp +2 -2
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +7 -13
- package/src/duckdb/src/storage/table/column_data.cpp +123 -70
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +28 -15
- package/src/duckdb/src/storage/table/column_segment.cpp +55 -71
- package/src/duckdb/src/storage/table/list_column_data.cpp +21 -27
- package/src/duckdb/src/storage/table/persistent_table_data.cpp +2 -1
- package/src/duckdb/src/storage/table/row_group.cpp +222 -152
- package/src/duckdb/src/storage/table/row_group_collection.cpp +154 -108
- package/src/duckdb/src/storage/table/scan_state.cpp +46 -34
- package/src/duckdb/src/storage/table/standard_column_data.cpp +13 -14
- package/src/duckdb/src/storage/table/struct_column_data.cpp +30 -37
- package/src/duckdb/src/storage/table/table_statistics.cpp +28 -8
- package/src/duckdb/src/storage/table/update_segment.cpp +41 -36
- package/src/duckdb/src/storage/table_index_list.cpp +3 -3
- package/src/duckdb/src/storage/wal_replay.cpp +11 -8
- package/src/duckdb/src/storage/write_ahead_log.cpp +47 -47
- package/src/duckdb/src/transaction/cleanup_state.cpp +10 -10
- package/src/duckdb/src/transaction/commit_state.cpp +66 -62
- package/src/duckdb/src/transaction/duck_transaction.cpp +9 -9
- 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 +2 -1
- package/src/duckdb/src/verification/copied_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +2 -3
- package/src/duckdb/src/verification/external_statement_verifier.cpp +1 -1
- 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 +3 -3
- package/src/duckdb/src/verification/unoptimized_statement_verifier.cpp +1 -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 +2 -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 -961
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +4 -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 +18328 -17747
- 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/ub_extension_icu_third_party_icu_i18n.cpp +5 -5
- 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_serializer.cpp +2 -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_execution_operator_projection.cpp +2 -0
- package/src/duckdb/ub_src_execution_physical_plan.cpp +4 -0
- package/src/duckdb/ub_src_function_scalar_generic.cpp +2 -0
- package/src/duckdb/ub_src_function_scalar_string.cpp +4 -0
- package/src/duckdb/ub_src_function_scalar_string_regexp.cpp +4 -0
- package/src/duckdb/ub_src_optimizer_rule.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 +2 -0
- package/src/duckdb/ub_src_storage_buffer.cpp +8 -0
- package/src/duckdb/ub_src_storage_statistics.cpp +6 -6
- 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 -65
- package/src/duckdb/src/include/duckdb/common/single_thread_ptr.hpp +0 -183
- package/src/duckdb/src/include/duckdb/storage/statistics/list_statistics.hpp +0 -36
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_statistics.hpp +0 -75
- package/src/duckdb/src/include/duckdb/storage/statistics/string_statistics.hpp +0 -49
- package/src/duckdb/src/include/duckdb/storage/statistics/struct_statistics.hpp +0 -36
- package/src/duckdb/src/include/duckdb/storage/statistics/validity_statistics.hpp +0 -45
- package/src/duckdb/src/storage/statistics/list_statistics.cpp +0 -94
- package/src/duckdb/src/storage/statistics/numeric_statistics.cpp +0 -307
- package/src/duckdb/src/storage/statistics/string_statistics.cpp +0 -220
- package/src/duckdb/src/storage/statistics/struct_statistics.cpp +0 -108
- package/src/duckdb/src/storage/statistics/validity_statistics.cpp +0 -91
- package/src/duckdb/src/storage/table/segment_tree.cpp +0 -179
@@ -11,6 +11,8 @@
|
|
11
11
|
#include "duckdb/parser/tableref/table_function_ref.hpp"
|
12
12
|
#include "duckdb/planner/operator/logical_get.hpp"
|
13
13
|
#include "duckdb/main/extension_helper.hpp"
|
14
|
+
#include "duckdb/common/multi_file_reader.hpp"
|
15
|
+
#include "duckdb/main/client_data.hpp"
|
14
16
|
|
15
17
|
#include <limits>
|
16
18
|
|
@@ -22,68 +24,57 @@ unique_ptr<CSVFileHandle> ReadCSV::OpenCSV(const string &file_path, FileCompress
|
|
22
24
|
auto opener = FileSystem::GetFileOpener(context);
|
23
25
|
auto file_handle =
|
24
26
|
fs.OpenFile(file_path.c_str(), FileFlags::FILE_FLAGS_READ, FileLockType::NO_LOCK, compression, opener);
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
void ReadCSVData::InitializeFiles(ClientContext &context, const vector<string> &patterns) {
|
29
|
-
auto &fs = FileSystem::GetFileSystem(context);
|
30
|
-
for (auto &file_pattern : patterns) {
|
31
|
-
auto found_files = fs.GlobFiles(file_pattern, context);
|
32
|
-
files.insert(files.end(), found_files.begin(), found_files.end());
|
33
|
-
}
|
34
|
-
if (files.empty()) {
|
35
|
-
throw IOException("CSV reader needs at least one file to read");
|
27
|
+
if (file_handle->CanSeek()) {
|
28
|
+
file_handle->Reset();
|
36
29
|
}
|
30
|
+
return make_uniq<CSVFileHandle>(std::move(file_handle));
|
37
31
|
}
|
38
32
|
|
39
33
|
void ReadCSVData::FinalizeRead(ClientContext &context) {
|
40
34
|
BaseCSVData::Finalize();
|
41
|
-
|
42
|
-
single_threaded = !config.options.experimental_parallel_csv_reader;
|
43
|
-
if (options.has_parallel) {
|
44
|
-
// Override the option set in the config
|
45
|
-
single_threaded = !options.use_parallel;
|
46
|
-
}
|
35
|
+
// Here we identify if we can run this CSV file on parallel or not.
|
47
36
|
bool null_or_empty = options.delimiter.empty() || options.escape.empty() || options.quote.empty() ||
|
48
37
|
options.delimiter[0] == '\0' || options.escape[0] == '\0' || options.quote[0] == '\0';
|
49
38
|
bool complex_options = options.delimiter.size() > 1 || options.escape.size() > 1 || options.quote.size() > 1;
|
50
|
-
|
39
|
+
bool not_supported_options = options.null_padding;
|
40
|
+
|
41
|
+
if (!options.run_parallel || null_or_empty || not_supported_options || complex_options ||
|
42
|
+
options.new_line == NewLineIdentifier::MIX) {
|
51
43
|
// not supported for parallel CSV reading
|
52
44
|
single_threaded = true;
|
53
45
|
}
|
54
46
|
}
|
55
47
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
48
|
+
uint8_t GetCandidateSpecificity(const LogicalType &candidate_type) {
|
49
|
+
//! Const ht with accepted auto_types and their weights in specificity
|
50
|
+
const duckdb::unordered_map<uint8_t, uint8_t> auto_type_candidates_specificity {
|
51
|
+
{(uint8_t)LogicalTypeId::VARCHAR, 0}, {(uint8_t)LogicalTypeId::TIMESTAMP, 1},
|
52
|
+
{(uint8_t)LogicalTypeId::DATE, 2}, {(uint8_t)LogicalTypeId::TIME, 3},
|
53
|
+
{(uint8_t)LogicalTypeId::DOUBLE, 4}, {(uint8_t)LogicalTypeId::FLOAT, 5},
|
54
|
+
{(uint8_t)LogicalTypeId::BIGINT, 6}, {(uint8_t)LogicalTypeId::INTEGER, 7},
|
55
|
+
{(uint8_t)LogicalTypeId::SMALLINT, 8}, {(uint8_t)LogicalTypeId::TINYINT, 9},
|
56
|
+
{(uint8_t)LogicalTypeId::BOOLEAN, 10}, {(uint8_t)LogicalTypeId::SQLNULL, 11}};
|
57
|
+
|
58
|
+
auto id = (uint8_t)candidate_type.id();
|
59
|
+
auto it = auto_type_candidates_specificity.find(id);
|
60
|
+
if (it == auto_type_candidates_specificity.end()) {
|
61
|
+
throw BinderException("Auto Type Candidate of type %s is not accepted as a valid input",
|
62
|
+
LogicalTypeIdToString(candidate_type.id()));
|
61
63
|
}
|
64
|
+
return it->second;
|
65
|
+
}
|
62
66
|
|
63
|
-
|
67
|
+
static unique_ptr<FunctionData> ReadCSVBind(ClientContext &context, TableFunctionBindInput &input,
|
68
|
+
vector<LogicalType> &return_types, vector<string> &names) {
|
69
|
+
auto result = make_uniq<ReadCSVData>();
|
64
70
|
auto &options = result->options;
|
65
|
-
|
66
|
-
vector<string> patterns;
|
67
|
-
if (input.inputs[0].IsNull()) {
|
68
|
-
throw ParserException("CSV reader cannot take NULL as parameter");
|
69
|
-
}
|
70
|
-
if (input.inputs[0].type().id() == LogicalTypeId::LIST) {
|
71
|
-
// list of globs
|
72
|
-
for (auto &val : ListValue::GetChildren(input.inputs[0])) {
|
73
|
-
if (val.IsNull()) {
|
74
|
-
throw ParserException("CSV reader cannot take NULL input as parameter");
|
75
|
-
}
|
76
|
-
patterns.push_back(StringValue::Get(val));
|
77
|
-
}
|
78
|
-
} else {
|
79
|
-
// single glob pattern
|
80
|
-
patterns.push_back(StringValue::Get(input.inputs[0]));
|
81
|
-
}
|
82
|
-
|
83
|
-
result->InitializeFiles(context, patterns);
|
71
|
+
result->files = MultiFileReader::GetFileList(context, input.inputs[0], "CSV");
|
84
72
|
|
85
73
|
bool explicitly_set_columns = false;
|
86
74
|
for (auto &kv : input.named_parameters) {
|
75
|
+
if (MultiFileReader::ParseOption(kv.first, kv.second, options.file_options)) {
|
76
|
+
continue;
|
77
|
+
}
|
87
78
|
auto loption = StringUtil::Lower(kv.first);
|
88
79
|
if (loption == "columns") {
|
89
80
|
explicitly_set_columns = true;
|
@@ -105,6 +96,32 @@ static unique_ptr<FunctionData> ReadCSVBind(ClientContext &context, TableFunctio
|
|
105
96
|
if (names.empty()) {
|
106
97
|
throw BinderException("read_csv requires at least a single column as input!");
|
107
98
|
}
|
99
|
+
} else if (loption == "auto_type_candidates") {
|
100
|
+
options.auto_type_candidates.clear();
|
101
|
+
map<uint8_t, LogicalType> candidate_types;
|
102
|
+
// We always have the extremes of Null and Varchar, so we can default to varchar if the
|
103
|
+
// sniffer is not able to confidently detect that column type
|
104
|
+
candidate_types[GetCandidateSpecificity(LogicalType::VARCHAR)] = LogicalType::VARCHAR;
|
105
|
+
candidate_types[GetCandidateSpecificity(LogicalType::SQLNULL)] = LogicalType::SQLNULL;
|
106
|
+
|
107
|
+
auto &child_type = kv.second.type();
|
108
|
+
if (child_type.id() != LogicalTypeId::LIST) {
|
109
|
+
throw BinderException("read_csv auto_types requires a list as input");
|
110
|
+
}
|
111
|
+
auto &list_children = ListValue::GetChildren(kv.second);
|
112
|
+
if (list_children.empty()) {
|
113
|
+
throw BinderException("auto_type_candidates requires at least one type");
|
114
|
+
}
|
115
|
+
for (auto &child : list_children) {
|
116
|
+
if (child.type().id() != LogicalTypeId::VARCHAR) {
|
117
|
+
throw BinderException("auto_type_candidates requires a type specification as string");
|
118
|
+
}
|
119
|
+
auto candidate_type = TransformStringToLogicalType(StringValue::Get(child), context);
|
120
|
+
candidate_types[GetCandidateSpecificity(candidate_type)] = candidate_type;
|
121
|
+
}
|
122
|
+
for (auto &candidate_type : candidate_types) {
|
123
|
+
options.auto_type_candidates.emplace_back(candidate_type.second);
|
124
|
+
}
|
108
125
|
} else if (loption == "column_names" || loption == "names") {
|
109
126
|
if (!options.name_list.empty()) {
|
110
127
|
throw BinderException("read_csv_auto column_names/names can only be supplied once");
|
@@ -160,10 +177,8 @@ static unique_ptr<FunctionData> ReadCSVBind(ClientContext &context, TableFunctio
|
|
160
177
|
options.all_varchar = BooleanValue::Get(kv.second);
|
161
178
|
} else if (loption == "normalize_names") {
|
162
179
|
options.normalize_names = BooleanValue::Get(kv.second);
|
163
|
-
} else if (loption == "
|
164
|
-
options.
|
165
|
-
} else if (loption == "hive_partitioning") {
|
166
|
-
options.include_parsed_hive_partitions = BooleanValue::Get(kv.second);
|
180
|
+
} else if (loption == "parallel") {
|
181
|
+
options.run_parallel = BooleanValue::Get(kv.second);
|
167
182
|
} else {
|
168
183
|
options.SetReadOption(loption, kv.second, names);
|
169
184
|
}
|
@@ -175,7 +190,7 @@ static unique_ptr<FunctionData> ReadCSVBind(ClientContext &context, TableFunctio
|
|
175
190
|
}
|
176
191
|
if (options.auto_detect) {
|
177
192
|
options.file_path = result->files[0];
|
178
|
-
auto initial_reader =
|
193
|
+
auto initial_reader = make_uniq<BufferedCSVReader>(context, options);
|
179
194
|
return_types.assign(initial_reader->return_types.begin(), initial_reader->return_types.end());
|
180
195
|
if (names.empty()) {
|
181
196
|
names.assign(initial_reader->names.begin(), initial_reader->names.end());
|
@@ -190,61 +205,37 @@ static unique_ptr<FunctionData> ReadCSVBind(ClientContext &context, TableFunctio
|
|
190
205
|
} else {
|
191
206
|
D_ASSERT(return_types.size() == names.size());
|
192
207
|
}
|
208
|
+
initial_reader->names = names;
|
193
209
|
}
|
194
210
|
options = initial_reader->options;
|
195
|
-
result->sql_types = initial_reader->return_types;
|
196
211
|
result->initial_reader = std::move(initial_reader);
|
197
212
|
} else {
|
198
|
-
result->sql_types = return_types;
|
199
213
|
D_ASSERT(return_types.size() == names.size());
|
200
214
|
}
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
std::move(dummy_readers.begin(), dummy_readers.end(), std::back_inserter(result->union_readers));
|
215
|
-
for (auto &reader : result->union_readers) {
|
216
|
-
reader->insert_cols_idx = reader->union_idx_map;
|
215
|
+
result->csv_types = return_types;
|
216
|
+
result->csv_names = names;
|
217
|
+
|
218
|
+
if (options.file_options.union_by_name) {
|
219
|
+
result->reader_bind =
|
220
|
+
MultiFileReader::BindUnionReader<BufferedCSVReader>(context, return_types, names, *result, options);
|
221
|
+
if (result->union_readers.size() > 1) {
|
222
|
+
result->column_info.emplace_back(result->csv_names, result->csv_types);
|
223
|
+
for (idx_t i = 1; i < result->union_readers.size(); i++) {
|
224
|
+
result->column_info.emplace_back(result->union_readers[i]->names,
|
225
|
+
result->union_readers[i]->return_types);
|
226
|
+
}
|
217
227
|
}
|
218
|
-
|
219
|
-
names.assign(union_col_names.begin(), union_col_names.end());
|
220
|
-
return_types.assign(union_col_types.begin(), union_col_types.end());
|
221
|
-
const idx_t first_file_index = 0;
|
222
|
-
result->initial_reader = std::move(result->union_readers[first_file_index]);
|
223
|
-
D_ASSERT(names.size() == return_types.size());
|
224
|
-
|
225
228
|
if (!options.sql_types_per_column.empty()) {
|
226
229
|
auto exception = BufferedCSVReader::ColumnTypesError(options.sql_types_per_column, names);
|
227
230
|
if (!exception.empty()) {
|
228
231
|
throw BinderException(exception);
|
229
232
|
}
|
230
233
|
}
|
234
|
+
} else {
|
235
|
+
result->reader_bind = MultiFileReader::BindOptions(options.file_options, result->files, return_types, names);
|
231
236
|
}
|
232
|
-
|
233
|
-
|
234
|
-
result->filename_col_idx = names.size();
|
235
|
-
return_types.emplace_back(LogicalType::VARCHAR);
|
236
|
-
names.emplace_back("filename");
|
237
|
-
}
|
238
|
-
|
239
|
-
if (result->options.include_parsed_hive_partitions) {
|
240
|
-
auto partitions = HivePartitioning::Parse(result->files[0]);
|
241
|
-
result->hive_partition_col_idx = names.size();
|
242
|
-
for (auto &part : partitions) {
|
243
|
-
return_types.emplace_back(LogicalType::VARCHAR);
|
244
|
-
names.emplace_back(part.first);
|
245
|
-
}
|
246
|
-
}
|
247
|
-
result->options.names = names;
|
237
|
+
result->return_types = return_types;
|
238
|
+
result->return_names = names;
|
248
239
|
result->FinalizeRead(context);
|
249
240
|
return std::move(result);
|
250
241
|
}
|
@@ -265,36 +256,53 @@ struct ParallelCSVGlobalState : public GlobalTableFunctionState {
|
|
265
256
|
public:
|
266
257
|
ParallelCSVGlobalState(ClientContext &context, unique_ptr<CSVFileHandle> file_handle_p,
|
267
258
|
vector<string> &files_path_p, idx_t system_threads_p, idx_t buffer_size_p,
|
268
|
-
idx_t rows_to_skip, bool force_parallelism_p)
|
259
|
+
idx_t rows_to_skip, bool force_parallelism_p, vector<column_t> column_ids_p)
|
269
260
|
: file_handle(std::move(file_handle_p)), system_threads(system_threads_p), buffer_size(buffer_size_p),
|
270
|
-
force_parallelism(force_parallelism_p) {
|
261
|
+
force_parallelism(force_parallelism_p), column_ids(std::move(column_ids_p)) {
|
271
262
|
current_file_path = files_path_p[0];
|
272
263
|
estimated_linenr = rows_to_skip;
|
273
264
|
file_size = file_handle->FileSize();
|
274
265
|
first_file_size = file_size;
|
275
266
|
bytes_read = 0;
|
276
|
-
if (buffer_size < file_size) {
|
267
|
+
if (buffer_size < file_size || file_size == 0) {
|
277
268
|
bytes_per_local_state = buffer_size / ParallelCSVGlobalState::MaxThreads();
|
278
269
|
} else {
|
279
270
|
bytes_per_local_state = file_size / MaxThreads();
|
280
271
|
}
|
281
|
-
|
282
|
-
|
272
|
+
if (bytes_per_local_state == 0) {
|
273
|
+
// In practice, I think this won't happen, it only happens because we are mocking up test scenarios
|
274
|
+
// this boy needs to be at least one.
|
275
|
+
bytes_per_local_state = 1;
|
276
|
+
}
|
277
|
+
for (idx_t i = 0; i < rows_to_skip; i++) {
|
278
|
+
file_handle->ReadLine();
|
279
|
+
}
|
280
|
+
first_position = current_csv_position;
|
281
|
+
current_buffer = make_shared<CSVBuffer>(context, buffer_size, *file_handle, current_csv_position, file_number);
|
282
|
+
next_buffer = shared_ptr<CSVBuffer>(
|
283
|
+
current_buffer->Next(*file_handle, buffer_size, current_csv_position, file_number).release());
|
283
284
|
running_threads = MaxThreads();
|
284
285
|
}
|
285
286
|
ParallelCSVGlobalState() {
|
287
|
+
running_threads = MaxThreads();
|
286
288
|
}
|
287
289
|
|
288
290
|
~ParallelCSVGlobalState() override {
|
289
291
|
}
|
290
292
|
|
293
|
+
//! How many bytes were read up to this point
|
294
|
+
atomic<idx_t> bytes_read;
|
295
|
+
//! Size of current file
|
296
|
+
idx_t file_size;
|
297
|
+
|
298
|
+
public:
|
291
299
|
idx_t MaxThreads() const override;
|
292
|
-
//!
|
293
|
-
|
300
|
+
//! Updates the CSV reader with the next buffer to read. Returns false if no more buffers are available.
|
301
|
+
bool Next(ClientContext &context, const ReadCSVData &bind_data, unique_ptr<ParallelCSVReader> &reader);
|
294
302
|
//! Verify if the CSV File was read correctly
|
295
303
|
void Verify();
|
296
304
|
|
297
|
-
void UpdateVerification(VerificationPositions positions);
|
305
|
+
void UpdateVerification(VerificationPositions positions, idx_t file_number);
|
298
306
|
|
299
307
|
void IncrementThread();
|
300
308
|
|
@@ -302,11 +310,6 @@ public:
|
|
302
310
|
|
303
311
|
bool Finished();
|
304
312
|
|
305
|
-
//! How many bytes were read up to this point
|
306
|
-
atomic<idx_t> bytes_read;
|
307
|
-
//! Size of current file
|
308
|
-
idx_t file_size;
|
309
|
-
|
310
313
|
double GetProgress(ReadCSVData &bind_data) const {
|
311
314
|
idx_t total_files = bind_data.files.size();
|
312
315
|
|
@@ -325,7 +328,6 @@ public:
|
|
325
328
|
|
326
329
|
private:
|
327
330
|
//! File Handle for current file
|
328
|
-
unique_ptr<CSVFileHandle> prev_file_handle;
|
329
331
|
unique_ptr<CSVFileHandle> file_handle;
|
330
332
|
shared_ptr<CSVBuffer> current_buffer;
|
331
333
|
shared_ptr<CSVBuffer> next_buffer;
|
@@ -351,25 +353,30 @@ private:
|
|
351
353
|
//! Current batch index
|
352
354
|
idx_t batch_index = 0;
|
353
355
|
//! Forces parallelism for small CSV Files, should only be used for testing.
|
354
|
-
bool force_parallelism;
|
356
|
+
bool force_parallelism = false;
|
355
357
|
//! Current (Global) position of CSV
|
356
358
|
idx_t current_csv_position = 0;
|
359
|
+
//! First Position of First Buffer
|
360
|
+
idx_t first_position = 0;
|
361
|
+
//! Current File Number
|
362
|
+
idx_t file_number = 0;
|
357
363
|
idx_t max_tuple_end = 0;
|
358
364
|
//! the vector stores positions where threads ended the last line they read in the CSV File, and the set stores
|
359
365
|
//! positions where they started reading the first line.
|
360
|
-
vector<idx_t
|
361
|
-
set<idx_t
|
366
|
+
vector<vector<idx_t>> tuple_end;
|
367
|
+
vector<set<idx_t>> tuple_start;
|
362
368
|
idx_t running_threads = 0;
|
369
|
+
//! The column ids to read
|
370
|
+
vector<column_t> column_ids;
|
363
371
|
};
|
364
372
|
|
365
373
|
idx_t ParallelCSVGlobalState::MaxThreads() const {
|
366
374
|
if (force_parallelism) {
|
367
375
|
return system_threads;
|
368
376
|
}
|
369
|
-
|
370
377
|
idx_t one_mb = 1000000; // We initialize max one thread per Mb
|
371
378
|
idx_t threads_per_mb = first_file_size / one_mb + 1;
|
372
|
-
if (threads_per_mb < system_threads) {
|
379
|
+
if (threads_per_mb < system_threads || threads_per_mb == 1) {
|
373
380
|
return threads_per_mb;
|
374
381
|
}
|
375
382
|
|
@@ -395,31 +402,43 @@ bool ParallelCSVGlobalState::Finished() {
|
|
395
402
|
void ParallelCSVGlobalState::Verify() {
|
396
403
|
// All threads are done, we run some magic sweet verification code
|
397
404
|
if (running_threads == 0) {
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
405
|
+
D_ASSERT(tuple_end.size() == tuple_start.size());
|
406
|
+
for (idx_t i = 0; i < tuple_start.size(); i++) {
|
407
|
+
auto ¤t_tuple_end = tuple_end[i];
|
408
|
+
auto ¤t_tuple_start = tuple_start[i];
|
409
|
+
// figure out max value of last_pos
|
410
|
+
if (current_tuple_end.empty()) {
|
411
|
+
return;
|
403
412
|
}
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
413
|
+
auto max_value = *max_element(std::begin(current_tuple_end), std::end(current_tuple_end));
|
414
|
+
for (auto &last_pos : current_tuple_end) {
|
415
|
+
auto first_pos = current_tuple_start.find(last_pos);
|
416
|
+
if (first_pos == current_tuple_start.end()) {
|
417
|
+
// this might be necessary due to carriage returns outside buffer scopes.
|
418
|
+
first_pos = current_tuple_start.find(last_pos + 1);
|
410
419
|
}
|
411
|
-
|
412
|
-
|
413
|
-
|
420
|
+
if (first_pos == current_tuple_start.end() && last_pos != max_value) {
|
421
|
+
string error =
|
422
|
+
"Not possible to read this CSV File with multithreading. Tuple: " + to_string(last_pos) +
|
423
|
+
" does not have a match\n";
|
424
|
+
error += "End Lines: \n";
|
425
|
+
for (auto &end_line : current_tuple_end) {
|
426
|
+
error += to_string(end_line) + "\n";
|
427
|
+
}
|
428
|
+
error += "Start Lines: \n";
|
429
|
+
for (auto &start_line : current_tuple_start) {
|
430
|
+
error += to_string(start_line) + "\n";
|
431
|
+
}
|
432
|
+
throw InvalidInputException(
|
433
|
+
"CSV File not supported for multithreading. Please run single-threaded CSV Reading");
|
414
434
|
}
|
415
|
-
throw InvalidInputException(
|
416
|
-
"CSV File not supported for multithreading. Please run single-threaded CSV Reading");
|
417
435
|
}
|
418
436
|
}
|
419
437
|
}
|
420
438
|
}
|
421
439
|
|
422
|
-
|
440
|
+
bool ParallelCSVGlobalState::Next(ClientContext &context, const ReadCSVData &bind_data,
|
441
|
+
unique_ptr<ParallelCSVReader> &reader) {
|
423
442
|
lock_guard<mutex> parallel_lock(main_mutex);
|
424
443
|
if (!current_buffer) {
|
425
444
|
// This means we are done with the current file, we need to go to the next one (if exists).
|
@@ -427,19 +446,23 @@ unique_ptr<CSVBufferRead> ParallelCSVGlobalState::Next(ClientContext &context, R
|
|
427
446
|
current_file_path = bind_data.files[file_index++];
|
428
447
|
file_handle = ReadCSV::OpenCSV(current_file_path, bind_data.options.compression, context);
|
429
448
|
current_csv_position = 0;
|
430
|
-
|
431
|
-
|
449
|
+
file_number++;
|
450
|
+
current_buffer =
|
451
|
+
make_shared<CSVBuffer>(context, buffer_size, *file_handle, current_csv_position, file_number);
|
452
|
+
next_buffer = shared_ptr<CSVBuffer>(
|
453
|
+
current_buffer->Next(*file_handle, buffer_size, current_csv_position, file_number).release());
|
432
454
|
} else {
|
433
455
|
// We are done scanning.
|
434
|
-
|
456
|
+
reader.reset();
|
457
|
+
return false;
|
435
458
|
}
|
436
459
|
}
|
437
460
|
// set up the current buffer
|
438
|
-
auto result =
|
439
|
-
|
461
|
+
auto result = make_uniq<CSVBufferRead>(current_buffer, next_buffer, next_byte, next_byte + bytes_per_local_state,
|
462
|
+
batch_index++, estimated_linenr);
|
440
463
|
// move the byte index of the CSV reader to the next buffer
|
441
464
|
next_byte += bytes_per_local_state;
|
442
|
-
estimated_linenr += bytes_per_local_state / (bind_data.
|
465
|
+
estimated_linenr += bytes_per_local_state / (bind_data.csv_types.size() * 5); // estimate 5 bytes per column
|
443
466
|
if (next_byte >= current_buffer->GetBufferSize()) {
|
444
467
|
// We replace the current buffer with the next buffer
|
445
468
|
next_byte = 0;
|
@@ -447,19 +470,53 @@ unique_ptr<CSVBufferRead> ParallelCSVGlobalState::Next(ClientContext &context, R
|
|
447
470
|
current_buffer = next_buffer;
|
448
471
|
if (next_buffer) {
|
449
472
|
// Next buffer gets the next-next buffer
|
450
|
-
next_buffer =
|
473
|
+
next_buffer = shared_ptr<CSVBuffer>(
|
474
|
+
next_buffer->Next(*file_handle, buffer_size, current_csv_position, file_number).release());
|
451
475
|
}
|
452
476
|
}
|
453
|
-
|
477
|
+
if (!reader || reader->options.file_path != current_file_path) {
|
478
|
+
// we either don't have a reader, or the reader was created for a different file
|
479
|
+
// we need to create a new reader and instantiate it
|
480
|
+
if (file_index > 0 && file_index <= bind_data.union_readers.size() && bind_data.union_readers[file_index - 1]) {
|
481
|
+
// we are doing UNION BY NAME - fetch the options from the union reader for this file
|
482
|
+
auto &union_reader = *bind_data.union_readers[file_index - 1];
|
483
|
+
reader = make_uniq<ParallelCSVReader>(context, union_reader.options, std::move(result), first_position,
|
484
|
+
union_reader.GetTypes());
|
485
|
+
reader->names = union_reader.GetNames();
|
486
|
+
} else if (file_index <= bind_data.column_info.size()) {
|
487
|
+
// Serialized Union By name
|
488
|
+
reader = make_uniq<ParallelCSVReader>(context, bind_data.options, std::move(result), first_position,
|
489
|
+
bind_data.column_info[file_index - 1].types);
|
490
|
+
reader->names = bind_data.column_info[file_index - 1].names;
|
491
|
+
} else {
|
492
|
+
// regular file - use the standard options
|
493
|
+
reader = make_uniq<ParallelCSVReader>(context, bind_data.options, std::move(result), first_position,
|
494
|
+
bind_data.csv_types);
|
495
|
+
reader->names = bind_data.csv_names;
|
496
|
+
}
|
497
|
+
reader->options.file_path = current_file_path;
|
498
|
+
MultiFileReader::InitializeReader(*reader, bind_data.options.file_options, bind_data.reader_bind,
|
499
|
+
bind_data.return_types, bind_data.return_names, column_ids, nullptr);
|
500
|
+
} else {
|
501
|
+
// update the current reader
|
502
|
+
reader->SetBufferRead(std::move(result));
|
503
|
+
}
|
504
|
+
return true;
|
454
505
|
}
|
455
|
-
void ParallelCSVGlobalState::UpdateVerification(VerificationPositions positions) {
|
506
|
+
void ParallelCSVGlobalState::UpdateVerification(VerificationPositions positions, idx_t file_number_p) {
|
456
507
|
lock_guard<mutex> parallel_lock(main_mutex);
|
457
508
|
if (positions.beginning_of_first_line < positions.end_of_last_line) {
|
458
509
|
if (positions.end_of_last_line > max_tuple_end) {
|
459
510
|
max_tuple_end = positions.end_of_last_line;
|
460
511
|
}
|
461
|
-
tuple_start.
|
462
|
-
|
512
|
+
while (file_number_p >= tuple_start.size()) {
|
513
|
+
vector<idx_t> empty_tuple_end;
|
514
|
+
set<idx_t> empty_set;
|
515
|
+
tuple_start.emplace_back(empty_set);
|
516
|
+
tuple_end.emplace_back(empty_tuple_end);
|
517
|
+
}
|
518
|
+
tuple_start[file_number_p].insert(positions.beginning_of_first_line);
|
519
|
+
tuple_end[file_number_p].push_back(positions.end_of_last_line);
|
463
520
|
}
|
464
521
|
}
|
465
522
|
|
@@ -468,17 +525,15 @@ static unique_ptr<GlobalTableFunctionState> ParallelCSVInitGlobal(ClientContext
|
|
468
525
|
auto &bind_data = (ReadCSVData &)*input.bind_data;
|
469
526
|
if (bind_data.files.empty()) {
|
470
527
|
// This can happen when a filename based filter pushdown has eliminated all possible files for this scan.
|
471
|
-
return
|
528
|
+
return make_uniq<ParallelCSVGlobalState>();
|
472
529
|
}
|
473
530
|
unique_ptr<CSVFileHandle> file_handle;
|
474
531
|
|
475
532
|
bind_data.options.file_path = bind_data.files[0];
|
476
533
|
file_handle = ReadCSV::OpenCSV(bind_data.options.file_path, bind_data.options.compression, context);
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
context.db->NumberOfThreads(), bind_data.options.buffer_size,
|
481
|
-
rows_to_skip, ClientConfig::GetConfig(context).verify_parallelism);
|
534
|
+
return make_uniq<ParallelCSVGlobalState>(
|
535
|
+
context, std::move(file_handle), bind_data.files, context.db->NumberOfThreads(), bind_data.options.buffer_size,
|
536
|
+
bind_data.options.skip_rows, ClientConfig::GetConfig(context).verify_parallelism, input.column_ids);
|
482
537
|
}
|
483
538
|
|
484
539
|
//===--------------------------------------------------------------------===//
|
@@ -497,23 +552,21 @@ public:
|
|
497
552
|
|
498
553
|
unique_ptr<LocalTableFunctionState> ParallelReadCSVInitLocal(ExecutionContext &context, TableFunctionInitInput &input,
|
499
554
|
GlobalTableFunctionState *global_state_p) {
|
500
|
-
auto &csv_data =
|
501
|
-
auto &global_state = (
|
502
|
-
auto next_local_buffer = global_state.Next(context.client, csv_data);
|
555
|
+
auto &csv_data = input.bind_data->Cast<ReadCSVData>();
|
556
|
+
auto &global_state = global_state_p->Cast<ParallelCSVGlobalState>();
|
503
557
|
unique_ptr<ParallelCSVReader> csv_reader;
|
504
|
-
|
505
|
-
|
506
|
-
csv_data.sql_types);
|
507
|
-
} else {
|
558
|
+
auto has_next = global_state.Next(context.client, csv_data, csv_reader);
|
559
|
+
if (!has_next) {
|
508
560
|
global_state.DecrementThread();
|
561
|
+
csv_reader.reset();
|
509
562
|
}
|
510
|
-
return
|
563
|
+
return make_uniq<ParallelCSVLocalState>(std::move(csv_reader));
|
511
564
|
}
|
512
565
|
|
513
566
|
static void ParallelReadCSVFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) {
|
514
|
-
auto &bind_data =
|
515
|
-
auto &csv_global_state =
|
516
|
-
auto &csv_local_state =
|
567
|
+
auto &bind_data = data_p.bind_data->Cast<ReadCSVData>();
|
568
|
+
auto &csv_global_state = data_p.global_state->Cast<ParallelCSVGlobalState>();
|
569
|
+
auto &csv_local_state = data_p.local_state->Cast<ParallelCSVLocalState>();
|
517
570
|
|
518
571
|
if (!csv_local_state.csv_reader) {
|
519
572
|
// no csv_reader was set, this can happen when a filename-based filter has filtered out all possible files
|
@@ -522,21 +575,20 @@ static void ParallelReadCSVFunction(ClientContext &context, TableFunctionInput &
|
|
522
575
|
|
523
576
|
do {
|
524
577
|
if (output.size() != 0) {
|
578
|
+
MultiFileReader::FinalizeChunk(bind_data.reader_bind, csv_local_state.csv_reader->reader_data, output);
|
525
579
|
break;
|
526
580
|
}
|
527
581
|
if (csv_local_state.csv_reader->finished) {
|
528
582
|
auto verification_updates = csv_local_state.csv_reader->GetVerificationPositions();
|
529
|
-
if (
|
530
|
-
|
531
|
-
|
583
|
+
if (verification_updates.beginning_of_first_line != verification_updates.end_of_last_line) {
|
584
|
+
csv_global_state.UpdateVerification(verification_updates,
|
585
|
+
csv_local_state.csv_reader->buffer->buffer->GetFileNumber());
|
532
586
|
}
|
533
|
-
csv_global_state.
|
534
|
-
|
535
|
-
if (!next_chunk) {
|
587
|
+
auto has_next = csv_global_state.Next(context, bind_data, csv_local_state.csv_reader);
|
588
|
+
if (!has_next) {
|
536
589
|
csv_global_state.DecrementThread();
|
537
590
|
break;
|
538
591
|
}
|
539
|
-
csv_local_state.csv_reader->SetBufferRead(std::move(next_chunk));
|
540
592
|
}
|
541
593
|
csv_local_state.csv_reader->ParseCSV(output);
|
542
594
|
|
@@ -544,15 +596,6 @@ static void ParallelReadCSVFunction(ClientContext &context, TableFunctionInput &
|
|
544
596
|
if (csv_global_state.Finished()) {
|
545
597
|
csv_global_state.Verify();
|
546
598
|
}
|
547
|
-
if (bind_data.options.union_by_name) {
|
548
|
-
throw InternalException("FIXME: union by name");
|
549
|
-
}
|
550
|
-
if (bind_data.options.include_file_name) {
|
551
|
-
throw InternalException("FIXME: output file name");
|
552
|
-
}
|
553
|
-
if (bind_data.options.include_parsed_hive_partitions) {
|
554
|
-
throw InternalException("FIXME: hive partitions");
|
555
|
-
}
|
556
599
|
}
|
557
600
|
|
558
601
|
//===--------------------------------------------------------------------===//
|
@@ -572,7 +615,11 @@ struct SingleThreadedCSVState : public GlobalTableFunctionState {
|
|
572
615
|
//! This goes from [0...next_file] * 100
|
573
616
|
atomic<idx_t> progress_in_files;
|
574
617
|
//! The set of SQL types
|
575
|
-
vector<LogicalType>
|
618
|
+
vector<LogicalType> csv_types;
|
619
|
+
//! The set of SQL names to be read from the file
|
620
|
+
vector<string> csv_names;
|
621
|
+
//! The column ids to read
|
622
|
+
vector<column_t> column_ids;
|
576
623
|
|
577
624
|
idx_t MaxThreads() const override {
|
578
625
|
return total_files;
|
@@ -602,11 +649,17 @@ struct SingleThreadedCSVState : public GlobalTableFunctionState {
|
|
602
649
|
}
|
603
650
|
// reuse csv_readers was created during binding
|
604
651
|
unique_ptr<BufferedCSVReader> result;
|
605
|
-
if (
|
652
|
+
if (file_index < bind_data.union_readers.size() && bind_data.union_readers[file_index]) {
|
606
653
|
result = std::move(bind_data.union_readers[file_index]);
|
607
654
|
} else {
|
655
|
+
auto union_by_name = options.file_options.union_by_name;
|
608
656
|
options.file_path = bind_data.files[file_index];
|
609
|
-
result =
|
657
|
+
result = make_uniq<BufferedCSVReader>(context, std::move(options), csv_types);
|
658
|
+
if (!union_by_name) {
|
659
|
+
result->names = csv_names;
|
660
|
+
}
|
661
|
+
MultiFileReader::InitializeReader(*result, bind_data.options.file_options, bind_data.reader_bind,
|
662
|
+
bind_data.return_types, bind_data.return_names, column_ids, nullptr);
|
610
663
|
}
|
611
664
|
total_size = result->file_handle->FileSize();
|
612
665
|
return result;
|
@@ -633,29 +686,46 @@ public:
|
|
633
686
|
static unique_ptr<GlobalTableFunctionState> SingleThreadedCSVInit(ClientContext &context,
|
634
687
|
TableFunctionInitInput &input) {
|
635
688
|
auto &bind_data = (ReadCSVData &)*input.bind_data;
|
636
|
-
auto result =
|
637
|
-
if (bind_data.
|
638
|
-
result->initial_reader = std::move(bind_data.initial_reader);
|
639
|
-
} else if (bind_data.files.empty()) {
|
689
|
+
auto result = make_uniq<SingleThreadedCSVState>(bind_data.files.size());
|
690
|
+
if (bind_data.files.empty()) {
|
640
691
|
// This can happen when a filename based filter pushdown has eliminated all possible files for this scan.
|
641
692
|
return std::move(result);
|
642
693
|
} else {
|
643
694
|
bind_data.options.file_path = bind_data.files[0];
|
644
|
-
|
695
|
+
if (bind_data.initial_reader && !bind_data.file_exists) {
|
696
|
+
// If this is not an on disk file we gotta reuse the reader.
|
697
|
+
result->initial_reader = std::move(bind_data.initial_reader);
|
698
|
+
} else {
|
699
|
+
result->initial_reader = make_uniq<BufferedCSVReader>(context, bind_data.options, bind_data.csv_types);
|
700
|
+
}
|
701
|
+
if (!bind_data.options.file_options.union_by_name) {
|
702
|
+
result->initial_reader->names = bind_data.csv_names;
|
703
|
+
}
|
645
704
|
if (bind_data.options.auto_detect) {
|
646
705
|
bind_data.options = result->initial_reader->options;
|
647
706
|
}
|
648
707
|
}
|
649
|
-
|
708
|
+
MultiFileReader::InitializeReader(*result->initial_reader, bind_data.options.file_options, bind_data.reader_bind,
|
709
|
+
bind_data.return_types, bind_data.return_names, input.column_ids, input.filters);
|
710
|
+
for (auto &reader : bind_data.union_readers) {
|
711
|
+
if (!reader) {
|
712
|
+
continue;
|
713
|
+
}
|
714
|
+
MultiFileReader::InitializeReader(*reader, bind_data.options.file_options, bind_data.reader_bind,
|
715
|
+
bind_data.return_types, bind_data.return_names, input.column_ids,
|
716
|
+
input.filters);
|
717
|
+
}
|
718
|
+
result->column_ids = input.column_ids;
|
719
|
+
|
720
|
+
if (!bind_data.options.file_options.union_by_name) {
|
650
721
|
// if we are reading multiple files - run auto-detect only on the first file
|
651
722
|
// UNLESS union by name is turned on - in that case we assume that different files have different schemas
|
652
723
|
// as such, we need to re-run the auto detection on each file
|
653
724
|
bind_data.options.auto_detect = false;
|
654
725
|
}
|
726
|
+
result->csv_types = bind_data.csv_types;
|
727
|
+
result->csv_names = bind_data.csv_names;
|
655
728
|
result->next_file = 1;
|
656
|
-
if (result->initial_reader) {
|
657
|
-
result->sql_types = result->initial_reader->return_types;
|
658
|
-
}
|
659
729
|
return std::move(result);
|
660
730
|
}
|
661
731
|
|
@@ -664,7 +734,7 @@ unique_ptr<LocalTableFunctionState> SingleThreadedReadCSVInitLocal(ExecutionCont
|
|
664
734
|
GlobalTableFunctionState *global_state_p) {
|
665
735
|
auto &bind_data = (ReadCSVData &)*input.bind_data;
|
666
736
|
auto &data = (SingleThreadedCSVState &)*global_state_p;
|
667
|
-
auto result =
|
737
|
+
auto result = make_uniq<SingleThreadedCSVLocalState>();
|
668
738
|
result->csv_reader = data.GetCSVReader(context.client, bind_data, result->file_index, result->total_size);
|
669
739
|
return std::move(result);
|
670
740
|
}
|
@@ -672,7 +742,7 @@ unique_ptr<LocalTableFunctionState> SingleThreadedReadCSVInitLocal(ExecutionCont
|
|
672
742
|
static void SingleThreadedCSVFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) {
|
673
743
|
auto &bind_data = (ReadCSVData &)*data_p.bind_data;
|
674
744
|
auto &data = (SingleThreadedCSVState &)*data_p.global_state;
|
675
|
-
auto &lstate =
|
745
|
+
auto &lstate = data_p.local_state->Cast<SingleThreadedCSVLocalState>();
|
676
746
|
if (!lstate.csv_reader) {
|
677
747
|
// no csv_reader was set, this can happen when a filename-based filter has filtered out all possible files
|
678
748
|
return;
|
@@ -708,41 +778,10 @@ static void SingleThreadedCSVFunction(ClientContext &context, TableFunctionInput
|
|
708
778
|
}
|
709
779
|
lstate.bytes_read = 0;
|
710
780
|
} else {
|
781
|
+
MultiFileReader::FinalizeChunk(bind_data.reader_bind, lstate.csv_reader->reader_data, output);
|
711
782
|
break;
|
712
783
|
}
|
713
784
|
} while (true);
|
714
|
-
|
715
|
-
if (bind_data.options.union_by_name) {
|
716
|
-
UnionByName<BufferedCSVReader, BufferedCSVReaderOptions>::SetNullUnionCols(output,
|
717
|
-
lstate.csv_reader->union_null_cols);
|
718
|
-
}
|
719
|
-
if (bind_data.options.include_file_name) {
|
720
|
-
auto &col = output.data[bind_data.filename_col_idx];
|
721
|
-
col.SetValue(0, Value(lstate.csv_reader->options.file_path));
|
722
|
-
col.SetVectorType(VectorType::CONSTANT_VECTOR);
|
723
|
-
}
|
724
|
-
if (bind_data.options.include_parsed_hive_partitions) {
|
725
|
-
auto partitions = HivePartitioning::Parse(lstate.csv_reader->options.file_path);
|
726
|
-
|
727
|
-
idx_t i = bind_data.hive_partition_col_idx;
|
728
|
-
|
729
|
-
if (partitions.size() != (bind_data.options.names.size() - bind_data.hive_partition_col_idx)) {
|
730
|
-
throw IOException("Hive partition count mismatch, expected " +
|
731
|
-
std::to_string(bind_data.options.names.size() - bind_data.hive_partition_col_idx) +
|
732
|
-
" hive partitions, got " + std::to_string(partitions.size()) + "\n");
|
733
|
-
}
|
734
|
-
|
735
|
-
for (auto &part : partitions) {
|
736
|
-
if (bind_data.options.names[i] != part.first) {
|
737
|
-
throw IOException("Hive partition names mismatch, expected '" + bind_data.options.names[i] +
|
738
|
-
"' but found '" + part.first + "' for file '" + lstate.csv_reader->options.file_path +
|
739
|
-
"'");
|
740
|
-
}
|
741
|
-
auto &col = output.data[i++];
|
742
|
-
col.SetValue(0, Value(part.second));
|
743
|
-
col.SetVectorType(VectorType::CONSTANT_VECTOR);
|
744
|
-
}
|
745
|
-
}
|
746
785
|
}
|
747
786
|
|
748
787
|
//===--------------------------------------------------------------------===//
|
@@ -750,6 +789,14 @@ static void SingleThreadedCSVFunction(ClientContext &context, TableFunctionInput
|
|
750
789
|
//===--------------------------------------------------------------------===//
|
751
790
|
static unique_ptr<GlobalTableFunctionState> ReadCSVInitGlobal(ClientContext &context, TableFunctionInitInput &input) {
|
752
791
|
auto &bind_data = (ReadCSVData &)*input.bind_data;
|
792
|
+
auto &fs = FileSystem::GetFileSystem(context);
|
793
|
+
for (auto &file : bind_data.files) {
|
794
|
+
if (!fs.FileExists(file)) {
|
795
|
+
bind_data.file_exists = false;
|
796
|
+
break;
|
797
|
+
}
|
798
|
+
}
|
799
|
+
bind_data.single_threaded = bind_data.single_threaded || !bind_data.file_exists;
|
753
800
|
if (bind_data.single_threaded) {
|
754
801
|
return SingleThreadedCSVInit(context, input);
|
755
802
|
} else {
|
@@ -780,10 +827,10 @@ static idx_t CSVReaderGetBatchIndex(ClientContext &context, const FunctionData *
|
|
780
827
|
LocalTableFunctionState *local_state, GlobalTableFunctionState *global_state) {
|
781
828
|
auto &bind_data = (ReadCSVData &)*bind_data_p;
|
782
829
|
if (bind_data.single_threaded) {
|
783
|
-
auto &data = (
|
830
|
+
auto &data = local_state->Cast<SingleThreadedCSVLocalState>();
|
784
831
|
return data.file_index;
|
785
832
|
}
|
786
|
-
auto &data = (
|
833
|
+
auto &data = local_state->Cast<ParallelCSVLocalState>();
|
787
834
|
return data.csv_reader->buffer->batch_index;
|
788
835
|
}
|
789
836
|
|
@@ -795,6 +842,7 @@ static void ReadCSVAddNamedParameters(TableFunction &table_function) {
|
|
795
842
|
table_function.named_parameters["escape"] = LogicalType::VARCHAR;
|
796
843
|
table_function.named_parameters["nullstr"] = LogicalType::VARCHAR;
|
797
844
|
table_function.named_parameters["columns"] = LogicalType::ANY;
|
845
|
+
table_function.named_parameters["auto_type_candidates"] = LogicalType::ANY;
|
798
846
|
table_function.named_parameters["header"] = LogicalType::BOOLEAN;
|
799
847
|
table_function.named_parameters["auto_detect"] = LogicalType::BOOLEAN;
|
800
848
|
table_function.named_parameters["sample_size"] = LogicalType::BIGINT;
|
@@ -805,16 +853,20 @@ static void ReadCSVAddNamedParameters(TableFunction &table_function) {
|
|
805
853
|
table_function.named_parameters["timestampformat"] = LogicalType::VARCHAR;
|
806
854
|
table_function.named_parameters["normalize_names"] = LogicalType::BOOLEAN;
|
807
855
|
table_function.named_parameters["compression"] = LogicalType::VARCHAR;
|
808
|
-
table_function.named_parameters["filename"] = LogicalType::BOOLEAN;
|
809
|
-
table_function.named_parameters["hive_partitioning"] = LogicalType::BOOLEAN;
|
810
856
|
table_function.named_parameters["skip"] = LogicalType::BIGINT;
|
811
857
|
table_function.named_parameters["max_line_size"] = LogicalType::VARCHAR;
|
812
858
|
table_function.named_parameters["maximum_line_size"] = LogicalType::VARCHAR;
|
813
859
|
table_function.named_parameters["ignore_errors"] = LogicalType::BOOLEAN;
|
814
|
-
table_function.named_parameters["union_by_name"] = LogicalType::BOOLEAN;
|
815
860
|
table_function.named_parameters["buffer_size"] = LogicalType::UBIGINT;
|
816
861
|
table_function.named_parameters["decimal_separator"] = LogicalType::VARCHAR;
|
817
862
|
table_function.named_parameters["parallel"] = LogicalType::BOOLEAN;
|
863
|
+
table_function.named_parameters["null_padding"] = LogicalType::BOOLEAN;
|
864
|
+
table_function.named_parameters["column_types"] = LogicalType::ANY;
|
865
|
+
table_function.named_parameters["dtypes"] = LogicalType::ANY;
|
866
|
+
table_function.named_parameters["types"] = LogicalType::ANY;
|
867
|
+
table_function.named_parameters["names"] = LogicalType::LIST(LogicalType::VARCHAR);
|
868
|
+
table_function.named_parameters["column_names"] = LogicalType::LIST(LogicalType::VARCHAR);
|
869
|
+
MultiFileReader::AddParameters(table_function);
|
818
870
|
}
|
819
871
|
|
820
872
|
double CSVReaderProgress(ClientContext &context, const FunctionData *bind_data_p,
|
@@ -832,22 +884,10 @@ double CSVReaderProgress(ClientContext &context, const FunctionData *bind_data_p
|
|
832
884
|
void CSVComplexFilterPushdown(ClientContext &context, LogicalGet &get, FunctionData *bind_data_p,
|
833
885
|
vector<unique_ptr<Expression>> &filters) {
|
834
886
|
auto data = (ReadCSVData *)bind_data_p;
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
unordered_map<string, column_t> column_map;
|
840
|
-
for (idx_t i = 0; i < get.column_ids.size(); i++) {
|
841
|
-
column_map.insert({get.names[get.column_ids[i]], i});
|
842
|
-
}
|
843
|
-
|
844
|
-
HivePartitioning::ApplyFiltersToFileList(context, data->files, filters, column_map, get.table_index,
|
845
|
-
data->options.include_parsed_hive_partitions,
|
846
|
-
data->options.include_file_name);
|
847
|
-
|
848
|
-
if (data->files.empty() || data->files[0] != first_file) {
|
849
|
-
data->initial_reader.reset();
|
850
|
-
}
|
887
|
+
auto reset_reader =
|
888
|
+
MultiFileReader::ComplexFilterPushdown(context, data->files, data->options.file_options, get, filters);
|
889
|
+
if (reset_reader) {
|
890
|
+
MultiFileReader::PruneReaders(*data);
|
851
891
|
}
|
852
892
|
}
|
853
893
|
|
@@ -855,13 +895,13 @@ unique_ptr<NodeStatistics> CSVReaderCardinality(ClientContext &context, const Fu
|
|
855
895
|
auto &bind_data = (ReadCSVData &)*bind_data_p;
|
856
896
|
idx_t per_file_cardinality = 0;
|
857
897
|
if (bind_data.initial_reader && bind_data.initial_reader->file_handle) {
|
858
|
-
auto estimated_row_width = (bind_data.
|
898
|
+
auto estimated_row_width = (bind_data.csv_types.size() * 5);
|
859
899
|
per_file_cardinality = bind_data.initial_reader->file_handle->FileSize() / estimated_row_width;
|
860
900
|
} else {
|
861
901
|
// determined through the scientific method as the average amount of rows in a CSV file
|
862
902
|
per_file_cardinality = 42;
|
863
903
|
}
|
864
|
-
return
|
904
|
+
return make_uniq<NodeStatistics>(bind_data.files.size() * per_file_cardinality);
|
865
905
|
}
|
866
906
|
|
867
907
|
void BufferedCSVReaderOptions::Serialize(FieldWriter &writer) const {
|
@@ -879,9 +919,10 @@ void BufferedCSVReaderOptions::Serialize(FieldWriter &writer) const {
|
|
879
919
|
writer.WriteField<idx_t>(buffer_sample_size);
|
880
920
|
writer.WriteString(null_str);
|
881
921
|
writer.WriteField<FileCompressionType>(compression);
|
922
|
+
writer.WriteField<NewLineIdentifier>(new_line);
|
882
923
|
// read options
|
883
|
-
writer.WriteList<string>(names);
|
884
924
|
writer.WriteField<idx_t>(skip_rows);
|
925
|
+
writer.WriteField<bool>(skip_rows_set);
|
885
926
|
writer.WriteField<idx_t>(maximum_line_size);
|
886
927
|
writer.WriteField<bool>(normalize_names);
|
887
928
|
writer.WriteListNoReference<bool>(force_not_null);
|
@@ -890,9 +931,9 @@ void BufferedCSVReaderOptions::Serialize(FieldWriter &writer) const {
|
|
890
931
|
writer.WriteField<idx_t>(sample_chunks);
|
891
932
|
writer.WriteField<bool>(auto_detect);
|
892
933
|
writer.WriteString(file_path);
|
893
|
-
writer.WriteField<bool>(include_file_name);
|
894
|
-
writer.WriteField<bool>(include_parsed_hive_partitions);
|
895
934
|
writer.WriteString(decimal_separator);
|
935
|
+
writer.WriteField<bool>(null_padding);
|
936
|
+
writer.WriteSerializable(file_options);
|
896
937
|
// write options
|
897
938
|
writer.WriteListNoReference<bool>(force_quote);
|
898
939
|
}
|
@@ -912,9 +953,10 @@ void BufferedCSVReaderOptions::Deserialize(FieldReader &reader) {
|
|
912
953
|
buffer_sample_size = reader.ReadRequired<idx_t>();
|
913
954
|
null_str = reader.ReadRequired<string>();
|
914
955
|
compression = reader.ReadRequired<FileCompressionType>();
|
956
|
+
new_line = reader.ReadRequired<NewLineIdentifier>();
|
915
957
|
// read options
|
916
|
-
names = reader.ReadRequiredList<string>();
|
917
958
|
skip_rows = reader.ReadRequired<idx_t>();
|
959
|
+
skip_rows_set = reader.ReadRequired<bool>();
|
918
960
|
maximum_line_size = reader.ReadRequired<idx_t>();
|
919
961
|
normalize_names = reader.ReadRequired<bool>();
|
920
962
|
force_not_null = reader.ReadRequiredList<bool>();
|
@@ -923,9 +965,9 @@ void BufferedCSVReaderOptions::Deserialize(FieldReader &reader) {
|
|
923
965
|
sample_chunks = reader.ReadRequired<idx_t>();
|
924
966
|
auto_detect = reader.ReadRequired<bool>();
|
925
967
|
file_path = reader.ReadRequired<string>();
|
926
|
-
include_file_name = reader.ReadRequired<bool>();
|
927
|
-
include_parsed_hive_partitions = reader.ReadRequired<bool>();
|
928
968
|
decimal_separator = reader.ReadRequired<string>();
|
969
|
+
null_padding = reader.ReadRequired<bool>();
|
970
|
+
file_options = reader.ReadRequiredSerializable<MultiFileReaderOptions, MultiFileReaderOptions>();
|
929
971
|
// write options
|
930
972
|
force_quote = reader.ReadRequiredList<bool>();
|
931
973
|
}
|
@@ -933,67 +975,65 @@ void BufferedCSVReaderOptions::Deserialize(FieldReader &reader) {
|
|
933
975
|
static void CSVReaderSerialize(FieldWriter &writer, const FunctionData *bind_data_p, const TableFunction &function) {
|
934
976
|
auto &bind_data = (ReadCSVData &)*bind_data_p;
|
935
977
|
writer.WriteList<string>(bind_data.files);
|
936
|
-
writer.WriteRegularSerializableList<LogicalType>(bind_data.
|
978
|
+
writer.WriteRegularSerializableList<LogicalType>(bind_data.csv_types);
|
979
|
+
writer.WriteList<string>(bind_data.csv_names);
|
980
|
+
writer.WriteRegularSerializableList<LogicalType>(bind_data.return_types);
|
981
|
+
writer.WriteList<string>(bind_data.return_names);
|
937
982
|
writer.WriteField<idx_t>(bind_data.filename_col_idx);
|
938
983
|
writer.WriteField<idx_t>(bind_data.hive_partition_col_idx);
|
939
984
|
bind_data.options.Serialize(writer);
|
940
985
|
writer.WriteField<bool>(bind_data.single_threaded);
|
986
|
+
writer.WriteSerializable(bind_data.reader_bind);
|
987
|
+
writer.WriteField<uint32_t>(bind_data.column_info.size());
|
988
|
+
for (auto &col : bind_data.column_info) {
|
989
|
+
col.Serialize(writer);
|
990
|
+
}
|
941
991
|
}
|
942
992
|
|
943
993
|
static unique_ptr<FunctionData> CSVReaderDeserialize(ClientContext &context, FieldReader &reader,
|
944
994
|
TableFunction &function) {
|
945
|
-
auto result_data =
|
995
|
+
auto result_data = make_uniq<ReadCSVData>();
|
946
996
|
result_data->files = reader.ReadRequiredList<string>();
|
947
|
-
result_data->
|
997
|
+
result_data->csv_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
998
|
+
result_data->csv_names = reader.ReadRequiredList<string>();
|
999
|
+
result_data->return_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
1000
|
+
result_data->return_names = reader.ReadRequiredList<string>();
|
948
1001
|
result_data->filename_col_idx = reader.ReadRequired<idx_t>();
|
949
1002
|
result_data->hive_partition_col_idx = reader.ReadRequired<idx_t>();
|
950
1003
|
result_data->options.Deserialize(reader);
|
951
1004
|
result_data->single_threaded = reader.ReadField<bool>(true);
|
1005
|
+
result_data->reader_bind = reader.ReadRequiredSerializable<MultiFileReaderBindData, MultiFileReaderBindData>();
|
1006
|
+
uint32_t file_number = reader.ReadRequired<uint32_t>();
|
1007
|
+
for (idx_t i = 0; i < file_number; i++) {
|
1008
|
+
result_data->column_info.emplace_back(ColumnInfo::Deserialize(reader));
|
1009
|
+
}
|
952
1010
|
return std::move(result_data);
|
953
1011
|
}
|
954
1012
|
|
955
|
-
TableFunction ReadCSVTableFunction::GetFunction(
|
956
|
-
|
957
|
-
|
1013
|
+
TableFunction ReadCSVTableFunction::GetFunction() {
|
1014
|
+
TableFunction read_csv("read_csv", {LogicalType::VARCHAR}, ReadCSVFunction, ReadCSVBind, ReadCSVInitGlobal,
|
1015
|
+
ReadCSVInitLocal);
|
958
1016
|
read_csv.table_scan_progress = CSVReaderProgress;
|
959
1017
|
read_csv.pushdown_complex_filter = CSVComplexFilterPushdown;
|
960
1018
|
read_csv.serialize = CSVReaderSerialize;
|
961
1019
|
read_csv.deserialize = CSVReaderDeserialize;
|
962
1020
|
read_csv.get_batch_index = CSVReaderGetBatchIndex;
|
963
1021
|
read_csv.cardinality = CSVReaderCardinality;
|
1022
|
+
read_csv.projection_pushdown = true;
|
964
1023
|
ReadCSVAddNamedParameters(read_csv);
|
965
1024
|
return read_csv;
|
966
1025
|
}
|
967
1026
|
|
968
|
-
TableFunction ReadCSVTableFunction::GetAutoFunction(
|
969
|
-
auto
|
970
|
-
|
971
|
-
|
972
|
-
read_csv_auto.table_scan_progress = CSVReaderProgress;
|
973
|
-
read_csv_auto.pushdown_complex_filter = CSVComplexFilterPushdown;
|
974
|
-
read_csv_auto.serialize = CSVReaderSerialize;
|
975
|
-
read_csv_auto.deserialize = CSVReaderDeserialize;
|
976
|
-
read_csv_auto.get_batch_index = CSVReaderGetBatchIndex;
|
977
|
-
read_csv_auto.cardinality = CSVReaderCardinality;
|
978
|
-
ReadCSVAddNamedParameters(read_csv_auto);
|
979
|
-
read_csv_auto.named_parameters["column_types"] = LogicalType::ANY;
|
980
|
-
read_csv_auto.named_parameters["dtypes"] = LogicalType::ANY;
|
981
|
-
read_csv_auto.named_parameters["types"] = LogicalType::ANY;
|
982
|
-
read_csv_auto.named_parameters["names"] = LogicalType::LIST(LogicalType::VARCHAR);
|
983
|
-
read_csv_auto.named_parameters["column_names"] = LogicalType::LIST(LogicalType::VARCHAR);
|
1027
|
+
TableFunction ReadCSVTableFunction::GetAutoFunction() {
|
1028
|
+
auto read_csv_auto = ReadCSVTableFunction::GetFunction();
|
1029
|
+
read_csv_auto.name = "read_csv_auto";
|
1030
|
+
read_csv_auto.bind = ReadCSVAutoBind;
|
984
1031
|
return read_csv_auto;
|
985
1032
|
}
|
986
1033
|
|
987
1034
|
void ReadCSVTableFunction::RegisterFunction(BuiltinFunctions &set) {
|
988
|
-
|
989
|
-
|
990
|
-
read_csv.AddFunction(ReadCSVTableFunction::GetFunction(true));
|
991
|
-
set.AddFunction(read_csv);
|
992
|
-
|
993
|
-
TableFunctionSet read_csv_auto("read_csv_auto");
|
994
|
-
read_csv_auto.AddFunction(ReadCSVTableFunction::GetAutoFunction());
|
995
|
-
read_csv_auto.AddFunction(ReadCSVTableFunction::GetAutoFunction(true));
|
996
|
-
set.AddFunction(read_csv_auto);
|
1035
|
+
set.AddFunction(MultiFileReader::CreateFunctionSet(ReadCSVTableFunction::GetFunction()));
|
1036
|
+
set.AddFunction(MultiFileReader::CreateFunctionSet(ReadCSVTableFunction::GetAutoFunction()));
|
997
1037
|
}
|
998
1038
|
|
999
1039
|
unique_ptr<TableRef> ReadCSVReplacement(ClientContext &context, const string &table_name, ReplacementScanData *data) {
|
@@ -1008,10 +1048,10 @@ unique_ptr<TableRef> ReadCSVReplacement(ClientContext &context, const string &ta
|
|
1008
1048
|
!StringUtil::EndsWith(lower_name, ".tsv") && !StringUtil::Contains(lower_name, ".tsv?")) {
|
1009
1049
|
return nullptr;
|
1010
1050
|
}
|
1011
|
-
auto table_function =
|
1051
|
+
auto table_function = make_uniq<TableFunctionRef>();
|
1012
1052
|
vector<unique_ptr<ParsedExpression>> children;
|
1013
|
-
children.push_back(
|
1014
|
-
table_function->function =
|
1053
|
+
children.push_back(make_uniq<ConstantExpression>(Value(table_name)));
|
1054
|
+
table_function->function = make_uniq<FunctionExpression>("read_csv_auto", std::move(children));
|
1015
1055
|
return std::move(table_function);
|
1016
1056
|
}
|
1017
1057
|
|