duckdb 1.1.2-dev4.0 → 1.1.2-dev6.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/package.json +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/putil.cpp +0 -5
- package/src/duckdb/extension/icu/third_party/icu/common/rbbiscan.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/rbbitblb.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/ucurr.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/uresbund.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/uresimp.h +31 -31
- package/src/duckdb/extension/icu/third_party/icu/common/ustring.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/coleitr.cpp +12 -12
- package/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/listformatter.cpp +4 -4
- package/src/duckdb/extension/icu/third_party/icu/i18n/number_decimalquantity.h +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h +28 -28
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h +7 -7
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucol.h +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucoleitr.h +41 -41
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/umsg.h +41 -41
- package/src/duckdb/extension/icu/third_party/icu/i18n/usrchimp.h +3 -3
- package/src/duckdb/extension/json/include/json_common.hpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +13 -7
- package/src/duckdb/extension/parquet/column_writer.cpp +2 -1
- package/src/duckdb/extension/parquet/geo_parquet.cpp +24 -9
- package/src/duckdb/extension/parquet/include/geo_parquet.hpp +3 -1
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +1 -0
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +1 -1
- package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +0 -4
- package/src/duckdb/extension/parquet/parquet_extension.cpp +20 -6
- package/src/duckdb/extension/parquet/parquet_reader.cpp +1 -2
- package/src/duckdb/extension/parquet/parquet_writer.cpp +1 -1
- package/src/duckdb/extension/parquet/serialize_parquet.cpp +0 -2
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +8 -1
- package/src/duckdb/src/catalog/default/default_functions.cpp +5 -5
- package/src/duckdb/src/common/allocator.cpp +3 -2
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +1 -0
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +11 -0
- package/src/duckdb/src/common/arrow/schema_metadata.cpp +6 -4
- package/src/duckdb/src/common/enum_util.cpp +33 -0
- package/src/duckdb/src/common/exception.cpp +3 -0
- package/src/duckdb/src/common/extra_type_info.cpp +1 -44
- package/src/duckdb/src/common/field_writer.cpp +97 -0
- package/src/duckdb/src/common/render_tree.cpp +7 -5
- package/src/duckdb/src/common/row_operations/row_match.cpp +359 -0
- package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +27 -0
- package/src/duckdb/src/common/serializer/buffered_serializer.cpp +36 -0
- package/src/duckdb/src/common/serializer/format_serializer.cpp +15 -0
- package/src/duckdb/src/common/serializer.cpp +24 -0
- package/src/duckdb/src/common/sort/comparators.cpp +2 -2
- package/src/duckdb/src/common/types/bit.cpp +57 -34
- package/src/duckdb/src/common/types/data_chunk.cpp +32 -29
- package/src/duckdb/src/common/types/vector_cache.cpp +12 -6
- package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +14 -0
- package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +20 -1
- package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/holistic/approx_top_k.cpp +32 -7
- package/src/duckdb/src/core_functions/function_list.cpp +1 -2
- package/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp +23 -5
- package/src/duckdb/src/core_functions/scalar/date/date_diff.cpp +12 -6
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_between.cpp +4 -3
- package/src/duckdb/src/execution/expression_executor/execute_case.cpp +4 -3
- package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +2 -1
- package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +3 -2
- package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +2 -1
- package/src/duckdb/src/execution/expression_executor/execute_function.cpp +2 -1
- package/src/duckdb/src/execution/expression_executor/execute_operator.cpp +3 -2
- package/src/duckdb/src/execution/expression_executor/execute_reference.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor.cpp +9 -3
- package/src/duckdb/src/execution/expression_executor_state.cpp +11 -9
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +238 -0
- package/src/duckdb/src/execution/index/art/plan_art.cpp +94 -0
- package/src/duckdb/src/execution/index/index_type_set.cpp +4 -1
- package/src/duckdb/src/execution/join_hashtable.cpp +7 -8
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +6 -4
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +4 -4
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp +44 -5
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +28 -24
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +25 -26
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +5 -3
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +4 -4
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +2 -2
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_replacement.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +2 -2
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +73 -27
- package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +695 -0
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1487 -0
- package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +72 -0
- package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +158 -0
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +280 -0
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +666 -0
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +14 -4
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +207 -0
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +207 -0
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +6 -1
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +0 -4
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +14 -87
- package/src/duckdb/src/execution/physical_plan/plan_export.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_get.cpp +1 -1
- package/src/duckdb/src/execution/reservoir_sample.cpp +1 -1
- package/src/duckdb/src/execution/window_executor.cpp +3 -3
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -1
- package/src/duckdb/src/function/scalar/strftime_format.cpp +1 -2
- package/src/duckdb/src/function/scalar/string/concat.cpp +118 -151
- package/src/duckdb/src/function/table/arrow.cpp +13 -0
- package/src/duckdb/src/function/table/arrow_conversion.cpp +12 -7
- package/src/duckdb/src/function/table/copy_csv.cpp +1 -1
- package/src/duckdb/src/function/table/read_csv.cpp +2 -30
- package/src/duckdb/src/function/table/sniff_csv.cpp +2 -1
- package/src/duckdb/src/function/table/system/duckdb_secrets.cpp +15 -7
- package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/atomic.hpp +13 -1
- package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +3 -4
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/enums/metric_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/exception.hpp +10 -0
- package/src/duckdb/src/include/duckdb/common/extra_type_info/enum_type_info.hpp +53 -0
- package/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -0
- package/src/duckdb/src/include/duckdb/common/types/bit.hpp +36 -33
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +10 -13
- package/src/duckdb/src/include/duckdb/common/types/uhugeint.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/vector_cache.hpp +7 -5
- package/src/duckdb/src/include/duckdb/common/windows_undefs.hpp +2 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/minmax_n_helpers.hpp +2 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +0 -6
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/index_type.hpp +16 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_schema.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/csv_sniffer.hpp +91 -36
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp +36 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +0 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +2 -5
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/database.hpp +5 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/profiling_info.hpp +20 -22
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +7 -9
- package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +8 -1
- package/src/duckdb/src/include/duckdb/main/table_description.hpp +14 -0
- package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +5 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +15 -5
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +10 -13
- package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +0 -2
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +1 -0
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +5 -1
- package/src/duckdb/src/include/duckdb.h +2 -2
- package/src/duckdb/src/main/appender.cpp +3 -0
- package/src/duckdb/src/main/capi/profiling_info-c.cpp +5 -2
- package/src/duckdb/src/main/client_context.cpp +8 -2
- package/src/duckdb/src/main/connection.cpp +1 -1
- package/src/duckdb/src/main/database.cpp +13 -0
- package/src/duckdb/src/main/extension/extension_helper.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_install.cpp +9 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +3 -2
- package/src/duckdb/src/main/extension_install_info.cpp +1 -1
- package/src/duckdb/src/main/profiling_info.cpp +78 -58
- package/src/duckdb/src/main/query_profiler.cpp +79 -89
- package/src/duckdb/src/main/relation/read_csv_relation.cpp +1 -1
- package/src/duckdb/src/main/secret/secret.cpp +2 -1
- package/src/duckdb/src/main/secret/secret_manager.cpp +14 -0
- package/src/duckdb/src/optimizer/cte_filter_pusher.cpp +4 -2
- package/src/duckdb/src/optimizer/deliminator.cpp +0 -7
- package/src/duckdb/src/optimizer/in_clause_rewriter.cpp +7 -0
- package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +4 -1
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +21 -21
- package/src/duckdb/src/parallel/task_scheduler.cpp +9 -0
- package/src/duckdb/src/parser/parsed_data/exported_table_data.cpp +22 -0
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +3 -0
- package/src/duckdb/src/parser/statement/insert_statement.cpp +7 -1
- package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +1 -1
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +89 -87
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +4 -9
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +4 -0
- package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +4 -1
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +4 -3
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +13 -3
- package/src/duckdb/src/planner/expression_binder.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_export.cpp +28 -0
- package/src/duckdb/src/planner/table_binding.cpp +1 -2
- package/src/duckdb/src/planner/table_filter.cpp +6 -2
- package/src/duckdb/src/storage/buffer/buffer_pool.cpp +2 -1
- package/src/duckdb/src/storage/checkpoint_manager.cpp +1 -1
- package/src/duckdb/src/storage/compression/bitpacking.cpp +7 -3
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +1 -1
- package/src/duckdb/src/storage/metadata/metadata_manager.cpp +2 -2
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +16 -0
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +29 -0
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +15 -0
- package/src/duckdb/src/storage/single_file_block_manager.cpp +2 -1
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +3 -5
- package/src/duckdb/src/storage/storage_info.cpp +4 -4
- package/src/duckdb/src/storage/table/row_group_collection.cpp +1 -1
- package/src/duckdb/src/storage/table/row_version_manager.cpp +5 -1
- package/src/duckdb/src/storage/temporary_file_manager.cpp +1 -1
- package/src/duckdb/src/transaction/duck_transaction.cpp +15 -14
- package/src/duckdb/third_party/brotli/common/brotli_platform.h +1 -1
- package/src/duckdb/third_party/brotli/dec/decode.cpp +1 -1
- package/src/duckdb/third_party/brotli/enc/memory.cpp +4 -4
- package/src/duckdb/third_party/fsst/libfsst.cpp +1 -1
- package/src/duckdb/third_party/hyperloglog/sds.cpp +1 -1
- package/src/duckdb/third_party/hyperloglog/sds.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/common/keywords.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/datatype/timestamp.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/mb/pg_wchar.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/bitmapset.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/lockoptions.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/makefuncs.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/pg_list.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/value.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/gramparse.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/parser.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/scanner.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/scansup.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/pg_functions.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/pg_functions.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_nodes_list.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_nodes_makefuncs.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_nodes_value.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +1964 -1964
- package/src/duckdb/third_party/libpg_query/src_backend_parser_parser.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_common_keywords.cpp +1 -1
- package/src/duckdb/third_party/lz4/lz4.cpp +1 -1
- package/src/duckdb/third_party/mbedtls/include/des_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/aes_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/aria_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/asn1write.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/camellia_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ccm_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/chacha20.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/chachapoly.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/cmac.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/config_psa.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ecdsa.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ecp.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/gcm_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/md5.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/nist_kw.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs12.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs5.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/psa_util.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ripemd160.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/threading.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/timing.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/platform_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/psa/crypto.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/rsa_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/sha1_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/sha256_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/sha512_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/ssl_misc.h +1 -1
- package/src/duckdb/third_party/mbedtls/library/aesni.h +1 -1
- package/src/duckdb/third_party/mbedtls/library/padlock.h +1 -1
- package/src/duckdb/third_party/miniz/miniz.cpp +1 -1
- package/src/duckdb/third_party/parquet/parquet_types.cpp +1 -1
- package/src/duckdb/third_party/parquet/windows_compatibility.h +1 -1
- package/src/duckdb/third_party/pcg/pcg_extras.hpp +1 -1
- package/src/duckdb/third_party/pcg/pcg_uint128.hpp +1 -1
- package/src/duckdb/third_party/skiplist/Node.h +4 -4
- package/src/duckdb/third_party/snappy/snappy.cc +1 -1
- package/src/duckdb/third_party/snappy/snappy_version.hpp +1 -1
- package/src/duckdb/third_party/thrift/thrift/thrift-config.h +1 -1
- package/src/duckdb/third_party/zstd/decompress/zstd_decompress_block.cpp +1 -1
- package/src/duckdb/third_party/zstd/include/zstd_static.h +1 -1
- package/src/duckdb/ub_src_execution_index_art.cpp +2 -0
- package/src/duckdb/ub_src_parser_parsed_data.cpp +2 -0
- package/src/duckdb/ub_src_planner_operator.cpp +2 -0
package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/csv_sniffer.hpp
CHANGED
@@ -8,25 +8,50 @@
|
|
8
8
|
|
9
9
|
#pragma once
|
10
10
|
|
11
|
-
#include "duckdb/execution/operator/csv_scanner/
|
11
|
+
#include "duckdb/execution/operator/csv_scanner/csv_state_machine.hpp"
|
12
12
|
#include "duckdb/common/vector.hpp"
|
13
|
-
#include "duckdb/execution/operator/csv_scanner/
|
14
|
-
#include "duckdb/execution/operator/csv_scanner/
|
13
|
+
#include "duckdb/execution/operator/csv_scanner/quote_rules.hpp"
|
14
|
+
#include "duckdb/execution/operator/csv_scanner/column_count_scanner.hpp"
|
15
|
+
#include "duckdb/execution/operator/csv_scanner/csv_schema.hpp"
|
16
|
+
#include "duckdb/execution/operator/csv_scanner/header_value.hpp"
|
17
|
+
#include "duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp"
|
15
18
|
|
16
19
|
namespace duckdb {
|
17
20
|
struct DateTimestampSniffing {
|
18
21
|
bool initialized = false;
|
22
|
+
bool had_match = false;
|
19
23
|
vector<string> format;
|
24
|
+
idx_t initial_size;
|
20
25
|
};
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
|
27
|
+
//! All the options that will be used to sniff the dialect of the CSV file
|
28
|
+
struct DialectCandidates {
|
29
|
+
//! The constructor populates all of our the options that will be used in our sniffer search space
|
30
|
+
explicit DialectCandidates(const CSVStateMachineOptions &options);
|
31
|
+
|
32
|
+
//! Static functions to get defaults of the search space
|
33
|
+
static vector<char> GetDefaultDelimiter();
|
34
|
+
|
35
|
+
static vector<vector<char>> GetDefaultQuote();
|
36
|
+
|
37
|
+
static vector<QuoteRule> GetDefaultQuoteRule();
|
38
|
+
|
39
|
+
static vector<vector<char>> GetDefaultEscape();
|
40
|
+
|
41
|
+
static vector<char> GetDefaultComment();
|
42
|
+
|
43
|
+
string Print();
|
44
|
+
|
45
|
+
//! Candidates for the delimiter
|
46
|
+
vector<char> delim_candidates;
|
47
|
+
//! Candidates for the comment
|
48
|
+
vector<char> comment_candidates;
|
49
|
+
//! Quote-Rule Candidates
|
50
|
+
vector<QuoteRule> quote_rule_candidates;
|
51
|
+
//! Candidates for the quote option
|
52
|
+
unordered_map<uint8_t, vector<char>> quote_candidates_map;
|
53
|
+
//! Candidates for the escape option
|
54
|
+
unordered_map<uint8_t, vector<char>> escape_candidates_map;
|
30
55
|
};
|
31
56
|
|
32
57
|
//! This represents the data related to columns that have been set by the user
|
@@ -45,12 +70,12 @@ struct SetColumns {
|
|
45
70
|
//! Column Names that were detected
|
46
71
|
const vector<string> *names = nullptr;
|
47
72
|
//! If columns are set
|
48
|
-
bool IsSet();
|
73
|
+
bool IsSet() const;
|
49
74
|
//! How many columns
|
50
|
-
idx_t Size();
|
75
|
+
idx_t Size() const;
|
51
76
|
//! Helper function that checks if candidate is acceptable based on the number of columns it produces
|
52
|
-
inline bool IsCandidateUnacceptable(idx_t num_cols, bool null_padding, bool ignore_errors,
|
53
|
-
bool last_value_always_empty) {
|
77
|
+
inline bool IsCandidateUnacceptable(const idx_t num_cols, bool null_padding, bool ignore_errors,
|
78
|
+
bool last_value_always_empty) const {
|
54
79
|
if (!IsSet() || ignore_errors) {
|
55
80
|
// We can't say its unacceptable if it's not set or if we ignore errors
|
56
81
|
return false;
|
@@ -74,11 +99,17 @@ struct SetColumns {
|
|
74
99
|
}
|
75
100
|
};
|
76
101
|
|
102
|
+
//! Struct used to know if we have a date or timestamp type already identified in this CSV File
|
103
|
+
struct HasType {
|
104
|
+
bool date = false;
|
105
|
+
bool timestamp = false;
|
106
|
+
};
|
107
|
+
|
77
108
|
//! Sniffer that detects Header, Dialect and Types of CSV Files
|
78
109
|
class CSVSniffer {
|
79
110
|
public:
|
80
111
|
explicit CSVSniffer(CSVReaderOptions &options_p, shared_ptr<CSVBufferManager> buffer_manager_p,
|
81
|
-
CSVStateMachineCache &state_machine_cache,
|
112
|
+
CSVStateMachineCache &state_machine_cache, bool default_null_to_varchar = true);
|
82
113
|
|
83
114
|
//! Main method that sniffs the CSV file, returns the types, names and options as a result
|
84
115
|
//! CSV Sniffing consists of five steps:
|
@@ -89,8 +120,22 @@ public:
|
|
89
120
|
//! 5. Type Replacement: Replaces the types of the columns if the user specified them
|
90
121
|
SnifferResult SniffCSV(bool force_match = false);
|
91
122
|
|
123
|
+
//! I call it adaptive, since that's a sexier term.
|
124
|
+
//! In practice this Function that only sniffs the first two rows, to verify if a header exists and what are the
|
125
|
+
//! data types It does this considering a priorly set CSV schema. If there is a mismatch of the schema it runs the
|
126
|
+
//! full on blazing all guns sniffer, if that still fails it tells the user to union_by_name.
|
127
|
+
//! It returns the projection order.
|
128
|
+
SnifferResult AdaptiveSniff(const CSVSchema &file_schema);
|
129
|
+
|
130
|
+
//! Function that only sniffs the first two rows, to verify if a header exists and what are the data types
|
131
|
+
AdaptiveSnifferResult MinimalSniff();
|
132
|
+
|
92
133
|
static NewLineIdentifier DetectNewLineDelimiter(CSVBufferManager &buffer_manager);
|
93
134
|
|
135
|
+
//! If a string_t value can be cast to a type
|
136
|
+
static bool CanYouCastIt(ClientContext &context, const string_t value, const LogicalType &type,
|
137
|
+
const DialectOptions &dialect_options, const bool is_null, const char decimal_separator);
|
138
|
+
|
94
139
|
private:
|
95
140
|
//! CSV State Machine Cache
|
96
141
|
CSVStateMachineCache &state_machine_cache;
|
@@ -106,6 +151,7 @@ private:
|
|
106
151
|
SetColumns set_columns;
|
107
152
|
shared_ptr<CSVErrorHandler> error_handler;
|
108
153
|
shared_ptr<CSVErrorHandler> detection_error_handler;
|
154
|
+
|
109
155
|
//! Sets the result options
|
110
156
|
void SetResultOptions();
|
111
157
|
|
@@ -115,42 +161,41 @@ private:
|
|
115
161
|
//! First phase of auto detection: detect CSV dialect (i.e. delimiter, quote rules, etc)
|
116
162
|
void DetectDialect();
|
117
163
|
//! Functions called in the main DetectDialect(); function
|
118
|
-
//! 1. Generates the search space candidates for the
|
119
|
-
void GenerateCandidateDetectionSearchSpace(vector<char> &delim_candidates, vector<QuoteRule> "erule_candidates,
|
120
|
-
unordered_map<uint8_t, vector<char>> "e_candidates_map,
|
121
|
-
unordered_map<uint8_t, vector<char>> &escape_candidates_map);
|
122
|
-
//! 2. Generates the search space candidates for the state machines
|
164
|
+
//! 1. Generates the search space candidates for the state machines
|
123
165
|
void GenerateStateMachineSearchSpace(vector<unique_ptr<ColumnCountScanner>> &column_count_scanners,
|
124
|
-
const
|
125
|
-
|
126
|
-
|
127
|
-
const unordered_map<uint8_t, vector<char>> &escape_candidates_map);
|
128
|
-
//! 3. Analyzes if dialect candidate is a good candidate to be considered, if so, it adds it to the candidates
|
166
|
+
const DialectCandidates &dialect_candidates);
|
167
|
+
|
168
|
+
//! 2. Analyzes if dialect candidate is a good candidate to be considered, if so, it adds it to the candidates
|
129
169
|
void AnalyzeDialectCandidate(unique_ptr<ColumnCountScanner>, idx_t &rows_read, idx_t &best_consistent_rows,
|
130
|
-
idx_t &prev_padding_count);
|
131
|
-
//!
|
170
|
+
idx_t &prev_padding_count, idx_t &min_ignored_rows);
|
171
|
+
//! 3. Refine Candidates over remaining chunks
|
132
172
|
void RefineCandidates();
|
133
173
|
|
134
174
|
//! Checks if candidate still produces good values for the next chunk
|
135
|
-
bool RefineCandidateNextChunk(ColumnCountScanner &candidate);
|
175
|
+
bool RefineCandidateNextChunk(ColumnCountScanner &candidate) const;
|
136
176
|
|
137
177
|
//! ------------------------------------------------------//
|
138
178
|
//! ------------------- Type Detection ------------------ //
|
139
179
|
//! ------------------------------------------------------//
|
140
|
-
//! Second phase of auto
|
180
|
+
//! Second phase of auto-detection: detect types, format template candidates
|
141
181
|
//! ordered by descending specificity (~ from high to low)
|
142
182
|
void DetectTypes();
|
143
183
|
//! Change the date format for the type to the string
|
144
184
|
//! Try to cast a string value to the specified sql type
|
145
|
-
|
146
|
-
|
185
|
+
static void SetDateFormat(CSVStateMachine &candidate, const string &format_specifier,
|
186
|
+
const LogicalTypeId &sql_type);
|
147
187
|
|
148
188
|
//! Function that initialized the necessary variables used for date and timestamp detection
|
149
189
|
void InitializeDateAndTimeStampDetection(CSVStateMachine &candidate, const string &separator,
|
150
190
|
const LogicalType &sql_type);
|
191
|
+
//! Sets user defined date and time formats (if any)
|
192
|
+
void SetUserDefinedDateTimeFormat(CSVStateMachine &candidate) const;
|
151
193
|
//! Functions that performs detection for date and timestamp formats
|
152
194
|
void DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const LogicalType &sql_type, const string &separator,
|
153
|
-
|
195
|
+
const string_t &dummy_val);
|
196
|
+
//! Sniffs the types from a data chunk
|
197
|
+
void SniffTypes(DataChunk &data_chunk, CSVStateMachine &state_machine,
|
198
|
+
unordered_map<idx_t, vector<LogicalType>> &info_sql_types_candidates, idx_t start_idx_detection);
|
154
199
|
|
155
200
|
//! Variables for Type Detection
|
156
201
|
//! Format Candidates for Date and Timestamp Types
|
@@ -163,9 +208,10 @@ private:
|
|
163
208
|
unordered_map<idx_t, vector<LogicalType>> best_sql_types_candidates_per_column_idx;
|
164
209
|
map<LogicalTypeId, vector<string>> best_format_candidates;
|
165
210
|
unique_ptr<StringValueScanner> best_candidate;
|
166
|
-
vector<
|
211
|
+
vector<HeaderValue> best_header_row;
|
167
212
|
//! Variable used for sniffing date and timestamp
|
168
213
|
map<LogicalTypeId, DateTimestampSniffing> format_candidates;
|
214
|
+
map<LogicalTypeId, DateTimestampSniffing> original_format_candidates;
|
169
215
|
|
170
216
|
//! ------------------------------------------------------//
|
171
217
|
//! ------------------ Type Refinement ------------------ //
|
@@ -173,17 +219,26 @@ private:
|
|
173
219
|
void RefineTypes();
|
174
220
|
bool TryCastVector(Vector &parse_chunk_col, idx_t size, const LogicalType &sql_type);
|
175
221
|
vector<LogicalType> detected_types;
|
176
|
-
|
222
|
+
//! If when finding a SQLNULL type in type detection we default it to varchar
|
223
|
+
const bool default_null_to_varchar;
|
177
224
|
//! ------------------------------------------------------//
|
178
225
|
//! ------------------ Header Detection ----------------- //
|
179
226
|
//! ------------------------------------------------------//
|
180
227
|
void DetectHeader();
|
228
|
+
static bool DetectHeaderWithSetColumn(ClientContext &context, vector<HeaderValue> &best_header_row,
|
229
|
+
const SetColumns &set_columns, CSVReaderOptions &options);
|
230
|
+
static vector<string>
|
231
|
+
DetectHeaderInternal(ClientContext &context, vector<HeaderValue> &best_header_row, CSVStateMachine &state_machine,
|
232
|
+
const SetColumns &set_columns,
|
233
|
+
unordered_map<idx_t, vector<LogicalType>> &best_sql_types_candidates_per_column_idx,
|
234
|
+
CSVReaderOptions &options, CSVErrorHandler &error_handler);
|
181
235
|
vector<string> names;
|
182
236
|
|
183
237
|
//! ------------------------------------------------------//
|
184
238
|
//! ------------------ Type Replacement ----------------- //
|
185
239
|
//! ------------------------------------------------------//
|
186
240
|
void ReplaceTypes();
|
241
|
+
vector<bool> manually_set;
|
187
242
|
};
|
188
243
|
|
189
244
|
} // namespace duckdb
|
@@ -0,0 +1,36 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include "duckdb/execution/operator/csv_scanner/csv_state_machine.hpp"
|
12
|
+
#include "duckdb/common/vector.hpp"
|
13
|
+
|
14
|
+
namespace duckdb {
|
15
|
+
|
16
|
+
//! Struct to store the result of the Sniffer
|
17
|
+
struct SnifferResult {
|
18
|
+
SnifferResult(vector<LogicalType> return_types_p, vector<string> names_p)
|
19
|
+
: return_types(std::move(return_types_p)), names(std::move(names_p)) {
|
20
|
+
}
|
21
|
+
//! Return Types that were detected
|
22
|
+
vector<LogicalType> return_types;
|
23
|
+
//! Column Names that were detected
|
24
|
+
vector<string> names;
|
25
|
+
};
|
26
|
+
|
27
|
+
struct AdaptiveSnifferResult : SnifferResult {
|
28
|
+
AdaptiveSnifferResult(vector<LogicalType> return_types_p, vector<string> names_p, bool more_than_one_row_p)
|
29
|
+
: SnifferResult(std::move(return_types_p), std::move(names_p)), more_than_one_row(more_than_one_row_p) {
|
30
|
+
}
|
31
|
+
bool more_than_one_row;
|
32
|
+
SnifferResult ToSnifferResult() {
|
33
|
+
return {return_types, names};
|
34
|
+
}
|
35
|
+
};
|
36
|
+
} // namespace duckdb
|
package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp
CHANGED
@@ -186,7 +186,7 @@ public:
|
|
186
186
|
|
187
187
|
//! Internal Data Chunk used for flushing
|
188
188
|
DataChunk parse_chunk;
|
189
|
-
|
189
|
+
int64_t number_of_rows = 0;
|
190
190
|
idx_t cur_col_id = 0;
|
191
191
|
bool figure_out_new_line = false;
|
192
192
|
//! Information to properly handle errors
|
@@ -34,17 +34,14 @@ public:
|
|
34
34
|
|
35
35
|
public:
|
36
36
|
PhysicalExport(vector<LogicalType> types, CopyFunction function, unique_ptr<CopyInfo> info,
|
37
|
-
idx_t estimated_cardinality, BoundExportData exported_tables)
|
38
|
-
: PhysicalOperator(PhysicalOperatorType::EXPORT, std::move(types), estimated_cardinality),
|
39
|
-
function(std::move(function)), info(std::move(info)), exported_tables(std::move(exported_tables)) {
|
40
|
-
}
|
37
|
+
idx_t estimated_cardinality, unique_ptr<BoundExportData> exported_tables);
|
41
38
|
|
42
39
|
//! The copy function to use to read the file
|
43
40
|
CopyFunction function;
|
44
41
|
//! The binding info containing the set of options for reading the file
|
45
42
|
unique_ptr<CopyInfo> info;
|
46
43
|
//! The table info for each table that will be exported
|
47
|
-
BoundExportData exported_tables;
|
44
|
+
unique_ptr<BoundExportData> exported_tables;
|
48
45
|
|
49
46
|
public:
|
50
47
|
// Source interface
|
@@ -242,7 +242,7 @@ public:
|
|
242
242
|
//! The returned FunctionData object should be constant and should not be changed during execution.
|
243
243
|
table_function_bind_t bind;
|
244
244
|
//! (Optional) Bind replace function
|
245
|
-
//! This function is called before the regular bind function. It allows returning a TableRef will be used to
|
245
|
+
//! This function is called before the regular bind function. It allows returning a TableRef that will be used to
|
246
246
|
//! to generate a logical plan that replaces the LogicalGet of a regularly bound TableFunction. The BindReplace can
|
247
247
|
//! also return a nullptr to indicate a regular bind needs to be performed instead.
|
248
248
|
table_function_bind_replace_t bind_replace;
|
@@ -12,6 +12,7 @@
|
|
12
12
|
#include "duckdb/main/valid_checker.hpp"
|
13
13
|
#include "duckdb/common/winapi.hpp"
|
14
14
|
#include "duckdb/main/extension.hpp"
|
15
|
+
#include "duckdb/main/capi/extension_api.hpp"
|
15
16
|
#include "duckdb/main/extension_install_info.hpp"
|
16
17
|
#include "duckdb/main/settings.hpp"
|
17
18
|
|
@@ -58,6 +59,8 @@ public:
|
|
58
59
|
DUCKDB_API ValidChecker &GetValidChecker();
|
59
60
|
DUCKDB_API void SetExtensionLoaded(const string &extension_name, ExtensionInstallInfo &install_info);
|
60
61
|
|
62
|
+
DUCKDB_API const duckdb_ext_api_v0 GetExtensionAPIV0();
|
63
|
+
|
61
64
|
idx_t NumberOfThreads();
|
62
65
|
|
63
66
|
DUCKDB_API static DatabaseInstance &GetDatabase(ClientContext &context);
|
@@ -91,6 +94,8 @@ private:
|
|
91
94
|
ValidChecker db_validity;
|
92
95
|
unique_ptr<DatabaseFileSystem> db_file_system;
|
93
96
|
shared_ptr<DatabaseCacheEntry> db_cache_entry;
|
97
|
+
|
98
|
+
duckdb_ext_api_v0 (*create_api_v0)();
|
94
99
|
};
|
95
100
|
|
96
101
|
//! The database object. This object holds the catalog and all the
|
@@ -410,6 +410,7 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = {
|
|
410
410
|
{"binary_as_string", "parquet"},
|
411
411
|
{"ca_cert_file", "httpfs"},
|
412
412
|
{"calendar", "icu"},
|
413
|
+
{"enable_geoparquet_conversion", "parquet"},
|
413
414
|
{"enable_server_cert_verification", "httpfs"},
|
414
415
|
{"force_download", "httpfs"},
|
415
416
|
{"hf_max_per_page", "httpfs"},
|
@@ -26,38 +26,36 @@ namespace duckdb {
|
|
26
26
|
|
27
27
|
class ProfilingInfo {
|
28
28
|
public:
|
29
|
-
|
29
|
+
//! Enabling a metric adds it to this set.
|
30
30
|
profiler_settings_t settings;
|
31
|
-
|
31
|
+
//! This set contains the expanded to-be-collected metrics, which can differ from 'settings'.
|
32
|
+
profiler_settings_t expanded_settings;
|
33
|
+
//! Contains all enabled metrics.
|
32
34
|
profiler_metrics_t metrics;
|
33
|
-
|
35
|
+
//! Additional metrics.
|
34
36
|
// FIXME: move to metrics.
|
35
37
|
InsertionOrderPreservingMap<string> extra_info;
|
36
38
|
|
37
39
|
public:
|
38
40
|
ProfilingInfo() = default;
|
39
|
-
explicit ProfilingInfo(profiler_settings_t &n_settings, idx_t depth = 0)
|
40
|
-
if (depth == 0) {
|
41
|
-
settings.insert(MetricsType::QUERY_NAME);
|
42
|
-
} else {
|
43
|
-
settings.insert(MetricsType::OPERATOR_TYPE);
|
44
|
-
}
|
45
|
-
ResetMetrics();
|
46
|
-
}
|
41
|
+
explicit ProfilingInfo(const profiler_settings_t &n_settings, const idx_t depth = 0);
|
47
42
|
ProfilingInfo(ProfilingInfo &) = default;
|
48
43
|
ProfilingInfo &operator=(ProfilingInfo const &) = default;
|
49
44
|
|
50
45
|
public:
|
51
46
|
static profiler_settings_t DefaultSettings();
|
47
|
+
static profiler_settings_t DefaultRootSettings();
|
52
48
|
static profiler_settings_t DefaultOperatorSettings();
|
53
|
-
static profiler_settings_t AllSettings();
|
54
49
|
|
55
50
|
public:
|
56
51
|
void ResetMetrics();
|
57
|
-
|
52
|
+
//! Returns true, if the query profiler must collect this metric.
|
53
|
+
static bool Enabled(const profiler_settings_t &settings, const MetricsType metric);
|
54
|
+
//! Expand metrics depending on the collection of other metrics.
|
55
|
+
static void Expand(profiler_settings_t &settings, const MetricsType metric);
|
58
56
|
|
59
57
|
public:
|
60
|
-
string GetMetricAsString(MetricsType
|
58
|
+
string GetMetricAsString(const MetricsType metric) const;
|
61
59
|
void WriteMetricsToJSON(duckdb_yyjson::yyjson_mut_doc *doc, duckdb_yyjson::yyjson_mut_val *destination);
|
62
60
|
|
63
61
|
public:
|
@@ -68,20 +66,20 @@ public:
|
|
68
66
|
}
|
69
67
|
|
70
68
|
template <class METRIC_TYPE>
|
71
|
-
void AddToMetric(const MetricsType
|
72
|
-
D_ASSERT(!metrics[
|
73
|
-
if (metrics.find(
|
74
|
-
metrics[
|
69
|
+
void AddToMetric(const MetricsType type, const Value &value) {
|
70
|
+
D_ASSERT(!metrics[type].IsNull());
|
71
|
+
if (metrics.find(type) == metrics.end()) {
|
72
|
+
metrics[type] = value;
|
75
73
|
return;
|
76
74
|
}
|
77
|
-
auto new_value = metrics[
|
78
|
-
metrics[
|
75
|
+
auto new_value = metrics[type].GetValue<METRIC_TYPE>() + value.GetValue<METRIC_TYPE>();
|
76
|
+
metrics[type] = Value::CreateValue(new_value);
|
79
77
|
}
|
80
78
|
|
81
79
|
template <class METRIC_TYPE>
|
82
|
-
void AddToMetric(const MetricsType
|
80
|
+
void AddToMetric(const MetricsType type, const METRIC_TYPE &value) {
|
83
81
|
auto new_value = Value::CreateValue(value);
|
84
|
-
return AddToMetric<METRIC_TYPE>(
|
82
|
+
return AddToMetric<METRIC_TYPE>(type, new_value);
|
85
83
|
}
|
86
84
|
};
|
87
85
|
} // namespace duckdb
|
@@ -64,7 +64,10 @@ class OperatorProfiler {
|
|
64
64
|
|
65
65
|
public:
|
66
66
|
DUCKDB_API explicit OperatorProfiler(ClientContext &context);
|
67
|
+
~OperatorProfiler() {
|
68
|
+
}
|
67
69
|
|
70
|
+
public:
|
68
71
|
DUCKDB_API void StartOperator(optional_ptr<const PhysicalOperator> phys_op);
|
69
72
|
DUCKDB_API void EndOperator(optional_ptr<DataChunk> chunk);
|
70
73
|
|
@@ -72,20 +75,14 @@ public:
|
|
72
75
|
DUCKDB_API void Flush(const PhysicalOperator &phys_op);
|
73
76
|
DUCKDB_API OperatorInformation &GetOperatorInfo(const PhysicalOperator &phys_op);
|
74
77
|
|
75
|
-
|
76
|
-
}
|
77
|
-
|
78
|
+
public:
|
78
79
|
ClientContext &context;
|
79
80
|
|
80
|
-
bool HasOperatorSetting(const MetricsType &metric) const {
|
81
|
-
return operator_settings.find(metric) != operator_settings.end();
|
82
|
-
}
|
83
|
-
|
84
81
|
private:
|
85
82
|
//! Whether or not the profiler is enabled
|
86
83
|
bool enabled;
|
87
84
|
//! Sub-settings for the operator profiler
|
88
|
-
profiler_settings_t
|
85
|
+
profiler_settings_t settings;
|
89
86
|
|
90
87
|
//! The timer used to time the execution time of the individual Physical Operators
|
91
88
|
Profiler op;
|
@@ -113,7 +110,8 @@ public:
|
|
113
110
|
using TreeMap = reference_map_t<const PhysicalOperator, reference<ProfilingNode>>;
|
114
111
|
|
115
112
|
private:
|
116
|
-
unique_ptr<ProfilingNode> CreateTree(const PhysicalOperator &root, profiler_settings_t settings,
|
113
|
+
unique_ptr<ProfilingNode> CreateTree(const PhysicalOperator &root, const profiler_settings_t &settings,
|
114
|
+
const idx_t depth = 0);
|
117
115
|
void Render(const ProfilingNode &node, std::ostream &str) const;
|
118
116
|
|
119
117
|
public:
|
@@ -80,6 +80,13 @@ struct SecretType {
|
|
80
80
|
string default_provider;
|
81
81
|
};
|
82
82
|
|
83
|
+
enum class SecretSerializationType : uint8_t {
|
84
|
+
//! The secret is serialized with a custom serialization function
|
85
|
+
CUSTOM = 0,
|
86
|
+
//! The secret has been serialized as a KeyValueSecret
|
87
|
+
KEY_VALUE_SECRET = 1
|
88
|
+
};
|
89
|
+
|
83
90
|
//! Base class from which BaseSecret classes can be made.
|
84
91
|
class BaseSecret {
|
85
92
|
friend class SecretManager;
|
@@ -187,7 +194,7 @@ public:
|
|
187
194
|
|
188
195
|
for (const auto &entry : ListValue::GetChildren(secret_map_value)) {
|
189
196
|
auto kv_struct = StructValue::GetChildren(entry);
|
190
|
-
result->secret_map[kv_struct[0].ToString()] = kv_struct[1]
|
197
|
+
result->secret_map[kv_struct[0].ToString()] = kv_struct[1];
|
191
198
|
}
|
192
199
|
|
193
200
|
Value redact_set_value;
|
@@ -13,12 +13,26 @@
|
|
13
13
|
namespace duckdb {
|
14
14
|
|
15
15
|
struct TableDescription {
|
16
|
+
public:
|
16
17
|
//! The schema of the table
|
17
18
|
string schema;
|
18
19
|
//! The table name of the table
|
19
20
|
string table;
|
20
21
|
//! The columns of the table
|
21
22
|
vector<ColumnDefinition> columns;
|
23
|
+
|
24
|
+
public:
|
25
|
+
idx_t PhysicalColumnCount() const {
|
26
|
+
idx_t count = 0;
|
27
|
+
for (auto &column : columns) {
|
28
|
+
if (column.Generated()) {
|
29
|
+
continue;
|
30
|
+
}
|
31
|
+
count++;
|
32
|
+
}
|
33
|
+
D_ASSERT(count != 0);
|
34
|
+
return count;
|
35
|
+
}
|
22
36
|
};
|
23
37
|
|
24
38
|
} // namespace duckdb
|
@@ -8,8 +8,8 @@
|
|
8
8
|
|
9
9
|
#pragma once
|
10
10
|
|
11
|
-
#include "duckdb/planner/logical_operator.hpp"
|
12
11
|
#include "duckdb/common/pair.hpp"
|
12
|
+
#include "duckdb/planner/logical_operator.hpp"
|
13
13
|
|
14
14
|
namespace duckdb {
|
15
15
|
|
@@ -61,14 +61,14 @@ public:
|
|
61
61
|
|
62
62
|
private:
|
63
63
|
//! Find delim joins that contain an UNNEST
|
64
|
-
void FindCandidates(unique_ptr<LogicalOperator>
|
64
|
+
void FindCandidates(unique_ptr<LogicalOperator> &op, vector<reference<unique_ptr<LogicalOperator>>> &candidates);
|
65
65
|
//! Rewrite a delim join that contains an UNNEST
|
66
|
-
bool RewriteCandidate(unique_ptr<LogicalOperator>
|
66
|
+
bool RewriteCandidate(unique_ptr<LogicalOperator> &candidate);
|
67
67
|
//! Update the bindings of the RHS sequence of LOGICAL_PROJECTION(s)
|
68
|
-
void UpdateRHSBindings(unique_ptr<LogicalOperator>
|
68
|
+
void UpdateRHSBindings(unique_ptr<LogicalOperator> &plan, unique_ptr<LogicalOperator> &candidate,
|
69
69
|
UnnestRewriterPlanUpdater &updater);
|
70
70
|
//! Update the bindings of the BOUND_UNNEST expression of the LOGICAL_UNNEST
|
71
|
-
void UpdateBoundUnnestBindings(UnnestRewriterPlanUpdater &updater, unique_ptr<LogicalOperator>
|
71
|
+
void UpdateBoundUnnestBindings(UnnestRewriterPlanUpdater &updater, unique_ptr<LogicalOperator> &candidate);
|
72
72
|
|
73
73
|
//! Store all delim columns of the delim join
|
74
74
|
void GetDelimColumns(LogicalOperator &op);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
//===----------------------------------------------------------------------===//
|
2
2
|
// DuckDB
|
3
3
|
//
|
4
|
-
// duckdb/parser/parsed_data/
|
4
|
+
// duckdb/parser/parsed_data/exported_table_data.hpp
|
5
5
|
//
|
6
6
|
//
|
7
7
|
//===----------------------------------------------------------------------===//
|
@@ -28,16 +28,23 @@ struct ExportedTableData {
|
|
28
28
|
string file_path;
|
29
29
|
//! Not Null columns, if any
|
30
30
|
vector<string> not_null_columns;
|
31
|
+
|
32
|
+
void Serialize(Serializer &serializer) const;
|
33
|
+
static ExportedTableData Deserialize(Deserializer &deserializer);
|
31
34
|
};
|
32
35
|
|
33
36
|
struct ExportedTableInfo {
|
34
|
-
ExportedTableInfo(TableCatalogEntry &entry, ExportedTableData table_data_p, vector<string> ¬_null_columns_p)
|
35
|
-
|
36
|
-
table_data.not_null_columns = not_null_columns_p;
|
37
|
-
}
|
37
|
+
ExportedTableInfo(TableCatalogEntry &entry, ExportedTableData table_data_p, vector<string> ¬_null_columns_p);
|
38
|
+
ExportedTableInfo(ClientContext &context, ExportedTableData table_data);
|
38
39
|
|
39
40
|
TableCatalogEntry &entry;
|
40
41
|
ExportedTableData table_data;
|
42
|
+
|
43
|
+
void Serialize(Serializer &serializer) const;
|
44
|
+
static ExportedTableInfo Deserialize(Deserializer &deserializer);
|
45
|
+
|
46
|
+
private:
|
47
|
+
static TableCatalogEntry &GetEntry(ClientContext &context, const ExportedTableData &table_data);
|
41
48
|
};
|
42
49
|
|
43
50
|
struct BoundExportData : public ParseInfo {
|
@@ -49,6 +56,9 @@ public:
|
|
49
56
|
}
|
50
57
|
|
51
58
|
vector<ExportedTableInfo> data;
|
59
|
+
|
60
|
+
void Serialize(Serializer &serializer) const override;
|
61
|
+
static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
|
52
62
|
};
|
53
63
|
|
54
64
|
} // namespace duckdb
|
@@ -323,6 +323,8 @@ private:
|
|
323
323
|
//! Transform a range var into a (schema) qualified name
|
324
324
|
QualifiedName TransformQualifiedName(duckdb_libpgquery::PGRangeVar &root);
|
325
325
|
|
326
|
+
//! Transform a Postgres TypeName string into a LogicalType (non-LIST types)
|
327
|
+
LogicalType TransformTypeNameInternal(duckdb_libpgquery::PGTypeName &name);
|
326
328
|
//! Transform a Postgres TypeName string into a LogicalType
|
327
329
|
LogicalType TransformTypeName(duckdb_libpgquery::PGTypeName &name);
|
328
330
|
|
@@ -37,6 +37,9 @@ public:
|
|
37
37
|
|
38
38
|
unique_ptr<Expression> CreateExtraReference(unique_ptr<ParsedExpression> expr);
|
39
39
|
|
40
|
+
//! Sets the query component, for error messages
|
41
|
+
void SetQueryComponent(string component = string());
|
42
|
+
|
40
43
|
private:
|
41
44
|
unique_ptr<Expression> CreateProjectionReference(ParsedExpression &expr, const idx_t index);
|
42
45
|
unique_ptr<Expression> BindConstant(ParsedExpression &expr);
|
@@ -46,6 +49,7 @@ private:
|
|
46
49
|
vector<reference<Binder>> binders;
|
47
50
|
optional_ptr<vector<unique_ptr<ParsedExpression>>> extra_list;
|
48
51
|
SelectBindState &bind_state;
|
52
|
+
string query_component = "ORDER BY";
|
49
53
|
};
|
50
54
|
|
51
55
|
} // namespace duckdb
|