duckdb 1.1.2-dev2.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/binding.gyp +4 -2
- 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
@@ -20,26 +20,23 @@ public:
|
|
20
20
|
static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_EXPORT;
|
21
21
|
|
22
22
|
public:
|
23
|
-
LogicalExport(CopyFunction function, unique_ptr<CopyInfo> copy_info, BoundExportData exported_tables)
|
24
|
-
|
25
|
-
copy_info(std::move(copy_info)), exported_tables(std::move(exported_tables)) {
|
26
|
-
}
|
27
|
-
CopyFunction function;
|
23
|
+
LogicalExport(CopyFunction function, unique_ptr<CopyInfo> copy_info, unique_ptr<BoundExportData> exported_tables);
|
24
|
+
|
28
25
|
unique_ptr<CopyInfo> copy_info;
|
29
|
-
|
26
|
+
CopyFunction function;
|
27
|
+
unique_ptr<BoundExportData> exported_tables;
|
30
28
|
|
31
|
-
void Serialize(Serializer &serializer) const override
|
32
|
-
|
33
|
-
}
|
34
|
-
unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer) {
|
35
|
-
throw NotImplementedException("FIXME: Deserialize LogicalExport statement");
|
36
|
-
}
|
29
|
+
void Serialize(Serializer &serializer) const override;
|
30
|
+
static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer);
|
37
31
|
|
38
|
-
public:
|
39
32
|
protected:
|
33
|
+
LogicalExport(ClientContext &context, unique_ptr<ParseInfo> copy_info, unique_ptr<ParseInfo> exported_tables);
|
34
|
+
|
40
35
|
void ResolveTypes() override {
|
41
36
|
types.emplace_back(LogicalType::BOOLEAN);
|
42
37
|
}
|
38
|
+
|
39
|
+
CopyFunction GetCopyFunction(ClientContext &context, CopyInfo &info);
|
43
40
|
};
|
44
41
|
|
45
42
|
} // namespace duckdb
|
@@ -45,6 +45,7 @@ public:
|
|
45
45
|
//! Returns true if the statistics indicate that the segment can contain values that satisfy that filter
|
46
46
|
virtual FilterPropagateResult CheckStatistics(BaseStatistics &stats) = 0;
|
47
47
|
virtual string ToString(const string &column_name) = 0;
|
48
|
+
string DebugToString();
|
48
49
|
virtual unique_ptr<TableFilter> Copy() const = 0;
|
49
50
|
virtual bool Equals(const TableFilter &other) const {
|
50
51
|
return filter_type != other.filter_type;
|
@@ -50,9 +50,9 @@ public:
|
|
50
50
|
~MetadataManager();
|
51
51
|
|
52
52
|
MetadataHandle AllocateHandle();
|
53
|
-
MetadataHandle Pin(MetadataPointer pointer);
|
53
|
+
MetadataHandle Pin(const MetadataPointer &pointer);
|
54
54
|
|
55
|
-
MetaBlockPointer GetDiskPointer(MetadataPointer pointer, uint32_t offset = 0);
|
55
|
+
MetaBlockPointer GetDiskPointer(const MetadataPointer &pointer, uint32_t offset = 0);
|
56
56
|
MetadataPointer FromDiskPointer(MetaBlockPointer pointer);
|
57
57
|
MetadataPointer RegisterDiskPointer(MetaBlockPointer pointer);
|
58
58
|
|
@@ -76,7 +76,7 @@ public:
|
|
76
76
|
void SetMemoryLimit(idx_t limit = (idx_t)-1) final;
|
77
77
|
void SetSwapLimit(optional_idx limit = optional_idx()) final;
|
78
78
|
|
79
|
-
//! Returns
|
79
|
+
//! Returns information about memory usage
|
80
80
|
vector<MemoryInformation> GetMemoryUsageInfo() const override;
|
81
81
|
|
82
82
|
//! Returns a list of all temporary files
|
@@ -102,8 +102,12 @@ private:
|
|
102
102
|
reference_map_t<RowGroupCollection, shared_ptr<RowGroupCollection>> updated_collections;
|
103
103
|
//! Lock for the active_locks map
|
104
104
|
mutex active_locks_lock;
|
105
|
+
struct ActiveTableLock {
|
106
|
+
mutex checkpoint_lock_mutex; // protects access to the checkpoint_lock field in this class
|
107
|
+
weak_ptr<CheckpointLock> checkpoint_lock;
|
108
|
+
};
|
105
109
|
//! Active locks on tables
|
106
|
-
reference_map_t<DataTableInfo,
|
110
|
+
reference_map_t<DataTableInfo, unique_ptr<ActiveTableLock>> active_locks;
|
107
111
|
};
|
108
112
|
|
109
113
|
} // namespace duckdb
|
@@ -626,12 +626,12 @@ typedef struct _duckdb_arrow_array {
|
|
626
626
|
//===--------------------------------------------------------------------===//
|
627
627
|
//! Passed to C API extension as parameter to the entrypoint
|
628
628
|
struct duckdb_extension_access {
|
629
|
-
//! Indicate that an error has
|
629
|
+
//! Indicate that an error has occurred
|
630
630
|
void (*set_error)(duckdb_extension_info info, const char *error);
|
631
631
|
//! Fetch the database from duckdb to register extensions to
|
632
632
|
duckdb_database *(*get_database)(duckdb_extension_info info);
|
633
633
|
//! Fetch the API
|
634
|
-
void *(*get_api)(duckdb_extension_info info, const char *version);
|
634
|
+
const void *(*get_api)(duckdb_extension_info info, const char *version);
|
635
635
|
};
|
636
636
|
|
637
637
|
//===--------------------------------------------------------------------===//
|
@@ -62,6 +62,9 @@ Appender::Appender(Connection &con, const string &schema_name, const string &tab
|
|
62
62
|
}
|
63
63
|
vector<optional_ptr<const ParsedExpression>> defaults;
|
64
64
|
for (auto &column : description->columns) {
|
65
|
+
if (column.Generated()) {
|
66
|
+
continue;
|
67
|
+
}
|
65
68
|
types.push_back(column.Type());
|
66
69
|
defaults.push_back(column.HasDefaultValue() ? &column.DefaultValue() : nullptr);
|
67
70
|
}
|
@@ -30,7 +30,7 @@ duckdb_value duckdb_profiling_info_get_value(duckdb_profiling_info info, const c
|
|
30
30
|
auto &node = *reinterpret_cast<duckdb::ProfilingNode *>(info);
|
31
31
|
auto &profiling_info = node.GetProfilingInfo();
|
32
32
|
auto key_enum = EnumUtil::FromString<MetricsType>(duckdb::StringUtil::Upper(key));
|
33
|
-
if (!profiling_info.Enabled(key_enum)) {
|
33
|
+
if (!profiling_info.Enabled(profiling_info.settings, key_enum)) {
|
34
34
|
return nullptr;
|
35
35
|
}
|
36
36
|
|
@@ -46,10 +46,13 @@ duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info) {
|
|
46
46
|
auto &node = *reinterpret_cast<duckdb::ProfilingNode *>(info);
|
47
47
|
auto &profiling_info = node.GetProfilingInfo();
|
48
48
|
|
49
|
-
// FIXME: filter between operator metrics and query node metrics.
|
50
49
|
duckdb::unordered_map<duckdb::string, duckdb::string> metrics_map;
|
51
50
|
for (const auto &metric : profiling_info.metrics) {
|
52
51
|
auto key = EnumUtil::ToString(metric.first);
|
52
|
+
if (!profiling_info.Enabled(profiling_info.settings, metric.first)) {
|
53
|
+
continue;
|
54
|
+
}
|
55
|
+
|
53
56
|
if (key == EnumUtil::ToString(MetricsType::OPERATOR_TYPE)) {
|
54
57
|
auto type = duckdb::PhysicalOperatorType(metric.second.GetValue<uint8_t>());
|
55
58
|
metrics_map[key] = EnumUtil::ToString(type);
|
@@ -1132,13 +1132,19 @@ void ClientContext::Append(TableDescription &description, ColumnDataCollection &
|
|
1132
1132
|
auto &table_entry =
|
1133
1133
|
Catalog::GetEntry<TableCatalogEntry>(*this, INVALID_CATALOG, description.schema, description.table);
|
1134
1134
|
// verify that the table columns and types match up
|
1135
|
-
if (description.
|
1135
|
+
if (description.PhysicalColumnCount() != table_entry.GetColumns().PhysicalColumnCount()) {
|
1136
1136
|
throw InvalidInputException("Failed to append: table entry has different number of columns!");
|
1137
1137
|
}
|
1138
|
+
idx_t table_entry_col_idx = 0;
|
1138
1139
|
for (idx_t i = 0; i < description.columns.size(); i++) {
|
1139
|
-
|
1140
|
+
auto &column = description.columns[i];
|
1141
|
+
if (column.Generated()) {
|
1142
|
+
continue;
|
1143
|
+
}
|
1144
|
+
if (column.Type() != table_entry.GetColumns().GetColumn(PhysicalIndex(table_entry_col_idx)).Type()) {
|
1140
1145
|
throw InvalidInputException("Failed to append: table entry has different number of columns!");
|
1141
1146
|
}
|
1147
|
+
table_entry_col_idx++;
|
1142
1148
|
}
|
1143
1149
|
auto binder = Binder::CreateBinder(*this);
|
1144
1150
|
auto bound_constraints = binder->BindConstraints(table_entry);
|
@@ -19,7 +19,7 @@
|
|
19
19
|
namespace duckdb {
|
20
20
|
|
21
21
|
Connection::Connection(DatabaseInstance &database)
|
22
|
-
: context(make_shared_ptr<ClientContext>(database.shared_from_this())) {
|
22
|
+
: context(make_shared_ptr<ClientContext>(database.shared_from_this())), warning_cb(nullptr) {
|
23
23
|
ConnectionManager::Get(database).AddConnection(*context);
|
24
24
|
#ifdef DEBUG
|
25
25
|
EnableProfiling();
|
@@ -25,6 +25,7 @@
|
|
25
25
|
#include "duckdb/storage/storage_extension.hpp"
|
26
26
|
#include "duckdb/storage/storage_manager.hpp"
|
27
27
|
#include "duckdb/transaction/transaction_manager.hpp"
|
28
|
+
#include "duckdb/main/capi/extension_api.hpp"
|
28
29
|
|
29
30
|
#ifndef DUCKDB_NO_THREADS
|
30
31
|
#include "duckdb/common/thread.hpp"
|
@@ -56,6 +57,7 @@ DBConfig::~DBConfig() {
|
|
56
57
|
|
57
58
|
DatabaseInstance::DatabaseInstance() {
|
58
59
|
config.is_user_config = false;
|
60
|
+
create_api_v0 = nullptr;
|
59
61
|
}
|
60
62
|
|
61
63
|
DatabaseInstance::~DatabaseInstance() {
|
@@ -258,6 +260,10 @@ void DatabaseInstance::LoadExtensionSettings() {
|
|
258
260
|
}
|
259
261
|
}
|
260
262
|
|
263
|
+
static duckdb_ext_api_v0 CreateAPIv0Wrapper() {
|
264
|
+
return CreateAPIv0();
|
265
|
+
}
|
266
|
+
|
261
267
|
void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_config) {
|
262
268
|
DBConfig default_config;
|
263
269
|
DBConfig *config_ptr = &default_config;
|
@@ -267,6 +273,8 @@ void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_conf
|
|
267
273
|
|
268
274
|
Configure(*config_ptr, database_path);
|
269
275
|
|
276
|
+
create_api_v0 = CreateAPIv0Wrapper;
|
277
|
+
|
270
278
|
if (user_config && !user_config->options.use_temporary_directory) {
|
271
279
|
// temporary directories explicitly disabled
|
272
280
|
config.options.temporary_directory = string();
|
@@ -504,6 +512,11 @@ ValidChecker &DatabaseInstance::GetValidChecker() {
|
|
504
512
|
return db_validity;
|
505
513
|
}
|
506
514
|
|
515
|
+
const duckdb_ext_api_v0 DatabaseInstance::GetExtensionAPIV0() {
|
516
|
+
D_ASSERT(create_api_v0);
|
517
|
+
return create_api_v0();
|
518
|
+
}
|
519
|
+
|
507
520
|
ValidChecker &ValidChecker::Get(DatabaseInstance &db) {
|
508
521
|
return db.GetValidChecker();
|
509
522
|
}
|
@@ -363,7 +363,7 @@ ExtensionUpdateResult ExtensionHelper::UpdateExtension(ClientContext &context, c
|
|
363
363
|
throw InvalidInputException("Failed to update the extension '%s', the extension is not installed!",
|
364
364
|
extension_name);
|
365
365
|
} else if (update_result.tag == ExtensionUpdateResultTag::UNKNOWN) {
|
366
|
-
throw InternalException("Failed to update extension '%s', an unknown error
|
366
|
+
throw InternalException("Failed to update extension '%s', an unknown error occurred", extension_name);
|
367
367
|
}
|
368
368
|
return update_result;
|
369
369
|
}
|
@@ -358,7 +358,15 @@ static unique_ptr<ExtensionInstallInfo> InstallFromHttpUrl(DatabaseInstance &db,
|
|
358
358
|
{
|
359
359
|
auto fs = FileSystem::CreateLocal();
|
360
360
|
if (fs->FileExists(local_extension_path + ".info")) {
|
361
|
-
|
361
|
+
try {
|
362
|
+
install_info =
|
363
|
+
ExtensionInstallInfo::TryReadInfoFile(*fs, local_extension_path + ".info", extension_name);
|
364
|
+
} catch (...) {
|
365
|
+
if (!options.force_install) {
|
366
|
+
// We are going to rewrite the file anyhow, so this is fine
|
367
|
+
throw;
|
368
|
+
}
|
369
|
+
}
|
362
370
|
}
|
363
371
|
}
|
364
372
|
|
@@ -91,7 +91,7 @@ struct ExtensionAccess {
|
|
91
91
|
}
|
92
92
|
|
93
93
|
//! Called by the extension get a pointer the correctly versioned extension C API struct.
|
94
|
-
static void *GetAPI(duckdb_extension_info info, const char *version) {
|
94
|
+
static const void *GetAPI(duckdb_extension_info info, const char *version) {
|
95
95
|
|
96
96
|
string version_string = version;
|
97
97
|
idx_t major, minor, patch;
|
@@ -106,7 +106,8 @@ struct ExtensionAccess {
|
|
106
106
|
"Unsupported C CAPI version detected during extension initialization: " + string(version));
|
107
107
|
return nullptr;
|
108
108
|
}
|
109
|
-
|
109
|
+
|
110
|
+
load_state.api_struct = load_state.db.GetExtensionAPIV0();
|
110
111
|
return &load_state.api_struct;
|
111
112
|
}
|
112
113
|
};
|
@@ -100,7 +100,7 @@ unique_ptr<ExtensionInstallInfo> ExtensionInstallInfo::TryReadInfoFile(FileSyste
|
|
100
100
|
} catch (std::exception &ex) {
|
101
101
|
ErrorData error(ex);
|
102
102
|
throw IOException(
|
103
|
-
"Failed to read info file for '%s' extension: '%s'.\nA serialization error
|
103
|
+
"Failed to read info file for '%s' extension: '%s'.\nA serialization error occurred: '%s'\n%s",
|
104
104
|
extension_name, info_file_path, error.RawMessage(), hint);
|
105
105
|
}
|
106
106
|
}
|
@@ -9,44 +9,53 @@ using namespace duckdb_yyjson; // NOLINT
|
|
9
9
|
|
10
10
|
namespace duckdb {
|
11
11
|
|
12
|
+
ProfilingInfo::ProfilingInfo(const profiler_settings_t &n_settings, const idx_t depth) : settings(n_settings) {
|
13
|
+
// Expand.
|
14
|
+
if (depth == 0) {
|
15
|
+
settings.insert(MetricsType::QUERY_NAME);
|
16
|
+
} else {
|
17
|
+
settings.insert(MetricsType::OPERATOR_TYPE);
|
18
|
+
}
|
19
|
+
for (const auto &metric : settings) {
|
20
|
+
Expand(expanded_settings, metric);
|
21
|
+
}
|
22
|
+
|
23
|
+
// Reduce.
|
24
|
+
if (depth == 0) {
|
25
|
+
auto op_metrics = DefaultOperatorSettings();
|
26
|
+
for (const auto metric : op_metrics) {
|
27
|
+
settings.erase(metric);
|
28
|
+
}
|
29
|
+
} else {
|
30
|
+
auto root_metrics = DefaultRootSettings();
|
31
|
+
for (const auto metric : root_metrics) {
|
32
|
+
settings.erase(metric);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
ResetMetrics();
|
36
|
+
}
|
37
|
+
|
12
38
|
profiler_settings_t ProfilingInfo::DefaultSettings() {
|
13
39
|
return {MetricsType::QUERY_NAME, MetricsType::BLOCKED_THREAD_TIME, MetricsType::CPU_TIME,
|
14
40
|
MetricsType::EXTRA_INFO, MetricsType::CUMULATIVE_CARDINALITY, MetricsType::OPERATOR_TYPE,
|
15
41
|
MetricsType::OPERATOR_CARDINALITY, MetricsType::CUMULATIVE_ROWS_SCANNED, MetricsType::OPERATOR_ROWS_SCANNED,
|
16
|
-
MetricsType::OPERATOR_TIMING, MetricsType::RESULT_SET_SIZE
|
42
|
+
MetricsType::OPERATOR_TIMING, MetricsType::RESULT_SET_SIZE, MetricsType::LATENCY,
|
43
|
+
MetricsType::ROWS_RETURNED};
|
17
44
|
}
|
18
45
|
|
19
|
-
profiler_settings_t ProfilingInfo::
|
20
|
-
return {MetricsType::
|
21
|
-
MetricsType::
|
46
|
+
profiler_settings_t ProfilingInfo::DefaultRootSettings() {
|
47
|
+
return {MetricsType::QUERY_NAME, MetricsType::BLOCKED_THREAD_TIME, MetricsType::LATENCY,
|
48
|
+
MetricsType::ROWS_RETURNED};
|
22
49
|
}
|
23
50
|
|
24
|
-
profiler_settings_t ProfilingInfo::
|
25
|
-
|
26
|
-
|
27
|
-
auto phase_timings = MetricsUtils::GetPhaseTimingMetrics();
|
28
|
-
|
29
|
-
for (auto &setting : optimizer_settings) {
|
30
|
-
all_settings.insert(setting);
|
31
|
-
}
|
32
|
-
|
33
|
-
for (auto &setting : phase_timings) {
|
34
|
-
all_settings.insert(setting);
|
35
|
-
}
|
36
|
-
|
37
|
-
return all_settings;
|
51
|
+
profiler_settings_t ProfilingInfo::DefaultOperatorSettings() {
|
52
|
+
return {MetricsType::OPERATOR_CARDINALITY, MetricsType::OPERATOR_ROWS_SCANNED, MetricsType::OPERATOR_TIMING,
|
53
|
+
MetricsType::OPERATOR_TYPE};
|
38
54
|
}
|
39
55
|
|
40
56
|
void ProfilingInfo::ResetMetrics() {
|
41
57
|
metrics.clear();
|
42
|
-
|
43
|
-
auto all_settings = AllSettings();
|
44
|
-
|
45
|
-
for (auto &metric : all_settings) {
|
46
|
-
if (!Enabled(metric)) {
|
47
|
-
continue;
|
48
|
-
}
|
49
|
-
|
58
|
+
for (auto &metric : expanded_settings) {
|
50
59
|
if (MetricsUtils::IsOptimizerMetric(metric) || MetricsUtils::IsPhaseTimingMetric(metric)) {
|
51
60
|
metrics[metric] = Value::CreateValue(0.0);
|
52
61
|
continue;
|
@@ -54,24 +63,25 @@ void ProfilingInfo::ResetMetrics() {
|
|
54
63
|
|
55
64
|
switch (metric) {
|
56
65
|
case MetricsType::QUERY_NAME:
|
66
|
+
metrics[metric] = Value::CreateValue("");
|
67
|
+
break;
|
68
|
+
case MetricsType::LATENCY:
|
57
69
|
case MetricsType::BLOCKED_THREAD_TIME:
|
58
70
|
case MetricsType::CPU_TIME:
|
59
|
-
case MetricsType::OPERATOR_TIMING:
|
71
|
+
case MetricsType::OPERATOR_TIMING:
|
60
72
|
metrics[metric] = Value::CreateValue(0.0);
|
61
73
|
break;
|
62
|
-
|
63
|
-
case MetricsType::OPERATOR_TYPE: {
|
74
|
+
case MetricsType::OPERATOR_TYPE:
|
64
75
|
metrics[metric] = Value::CreateValue<uint8_t>(0);
|
65
76
|
break;
|
66
|
-
|
77
|
+
case MetricsType::ROWS_RETURNED:
|
67
78
|
case MetricsType::RESULT_SET_SIZE:
|
68
79
|
case MetricsType::CUMULATIVE_CARDINALITY:
|
69
80
|
case MetricsType::OPERATOR_CARDINALITY:
|
70
81
|
case MetricsType::CUMULATIVE_ROWS_SCANNED:
|
71
|
-
case MetricsType::OPERATOR_ROWS_SCANNED:
|
82
|
+
case MetricsType::OPERATOR_ROWS_SCANNED:
|
72
83
|
metrics[metric] = Value::CreateValue<uint64_t>(0);
|
73
84
|
break;
|
74
|
-
}
|
75
85
|
case MetricsType::EXTRA_INFO:
|
76
86
|
break;
|
77
87
|
default:
|
@@ -80,35 +90,45 @@ void ProfilingInfo::ResetMetrics() {
|
|
80
90
|
}
|
81
91
|
}
|
82
92
|
|
83
|
-
bool ProfilingInfo::Enabled(const MetricsType
|
84
|
-
if (settings.find(
|
93
|
+
bool ProfilingInfo::Enabled(const profiler_settings_t &settings, const MetricsType metric) {
|
94
|
+
if (settings.find(metric) != settings.end()) {
|
85
95
|
return true;
|
86
96
|
}
|
97
|
+
return false;
|
98
|
+
}
|
87
99
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
return
|
95
|
-
|
96
|
-
|
100
|
+
void ProfilingInfo::Expand(profiler_settings_t &settings, const MetricsType metric) {
|
101
|
+
settings.insert(metric);
|
102
|
+
|
103
|
+
switch (metric) {
|
104
|
+
case MetricsType::CPU_TIME:
|
105
|
+
settings.insert(MetricsType::OPERATOR_TIMING);
|
106
|
+
return;
|
107
|
+
case MetricsType::CUMULATIVE_CARDINALITY:
|
108
|
+
settings.insert(MetricsType::OPERATOR_CARDINALITY);
|
109
|
+
return;
|
110
|
+
case MetricsType::CUMULATIVE_ROWS_SCANNED:
|
111
|
+
settings.insert(MetricsType::OPERATOR_ROWS_SCANNED);
|
112
|
+
return;
|
113
|
+
case MetricsType::CUMULATIVE_OPTIMIZER_TIMING:
|
114
|
+
case MetricsType::ALL_OPTIMIZERS: {
|
115
|
+
auto optimizer_metrics = MetricsUtils::GetOptimizerMetrics();
|
116
|
+
for (const auto optimizer_metric : optimizer_metrics) {
|
117
|
+
settings.insert(optimizer_metric);
|
118
|
+
}
|
119
|
+
return;
|
97
120
|
}
|
98
|
-
|
99
|
-
|
100
|
-
return Enabled(MetricsType::CUMULATIVE_OPTIMIZER_TIMING);
|
121
|
+
default:
|
122
|
+
return;
|
101
123
|
}
|
102
|
-
|
103
|
-
return false;
|
104
124
|
}
|
105
125
|
|
106
|
-
string ProfilingInfo::GetMetricAsString(MetricsType
|
107
|
-
if (!Enabled(
|
108
|
-
throw InternalException("Metric %s not enabled", EnumUtil::ToString(
|
126
|
+
string ProfilingInfo::GetMetricAsString(const MetricsType metric) const {
|
127
|
+
if (!Enabled(settings, metric)) {
|
128
|
+
throw InternalException("Metric %s not enabled", EnumUtil::ToString(metric));
|
109
129
|
}
|
110
130
|
|
111
|
-
if (
|
131
|
+
if (metric == MetricsType::EXTRA_INFO) {
|
112
132
|
string result;
|
113
133
|
for (auto &it : extra_info) {
|
114
134
|
if (!result.empty()) {
|
@@ -120,14 +140,12 @@ string ProfilingInfo::GetMetricAsString(MetricsType setting) const {
|
|
120
140
|
}
|
121
141
|
|
122
142
|
// The metric cannot be NULL and must be initialized.
|
123
|
-
D_ASSERT(!metrics.at(
|
124
|
-
|
125
|
-
|
126
|
-
auto type = PhysicalOperatorType(metrics.at(setting).GetValue<uint8_t>());
|
143
|
+
D_ASSERT(!metrics.at(metric).IsNull());
|
144
|
+
if (metric == MetricsType::OPERATOR_TYPE) {
|
145
|
+
auto type = PhysicalOperatorType(metrics.at(metric).GetValue<uint8_t>());
|
127
146
|
return EnumUtil::ToString(type);
|
128
147
|
}
|
129
|
-
|
130
|
-
return metrics.at(setting).ToString();
|
148
|
+
return metrics.at(metric).ToString();
|
131
149
|
}
|
132
150
|
|
133
151
|
void ProfilingInfo::WriteMetricsToJSON(yyjson_mut_doc *doc, yyjson_mut_val *dest) {
|
@@ -169,6 +187,7 @@ void ProfilingInfo::WriteMetricsToJSON(yyjson_mut_doc *doc, yyjson_mut_val *dest
|
|
169
187
|
case MetricsType::QUERY_NAME:
|
170
188
|
yyjson_mut_obj_add_strcpy(doc, dest, key_ptr, metrics[metric].GetValue<string>().c_str());
|
171
189
|
break;
|
190
|
+
case MetricsType::LATENCY:
|
172
191
|
case MetricsType::BLOCKED_THREAD_TIME:
|
173
192
|
case MetricsType::CPU_TIME:
|
174
193
|
case MetricsType::OPERATOR_TIMING: {
|
@@ -179,6 +198,7 @@ void ProfilingInfo::WriteMetricsToJSON(yyjson_mut_doc *doc, yyjson_mut_val *dest
|
|
179
198
|
yyjson_mut_obj_add_strcpy(doc, dest, key_ptr, GetMetricAsString(metric).c_str());
|
180
199
|
break;
|
181
200
|
}
|
201
|
+
case MetricsType::ROWS_RETURNED:
|
182
202
|
case MetricsType::RESULT_SET_SIZE:
|
183
203
|
case MetricsType::CUMULATIVE_CARDINALITY:
|
184
204
|
case MetricsType::OPERATOR_CARDINALITY:
|