duckdb 1.3.3-dev4.0 → 1.3.3
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.
Potentially problematic release.
This version of duckdb might be problematic. Click here for more details.
- package/.github/workflows/NodeJS.yml +20 -8
- package/binding.gyp +1 -9
- package/lib/binding/duckdb.node +0 -0
- package/lib/duckdb.js +2 -0
- package/package.json +2 -1
- package/src/connection.cpp +1 -1
- package/src/duckdb/extension/core_functions/aggregate/algebraic/avg.cpp +0 -4
- package/src/duckdb/extension/core_functions/aggregate/distributive/approx_count.cpp +4 -8
- package/src/duckdb/extension/core_functions/aggregate/distributive/arg_min_max.cpp +12 -16
- package/src/duckdb/extension/core_functions/aggregate/distributive/bitagg.cpp +1 -5
- package/src/duckdb/extension/core_functions/aggregate/distributive/bitstring_agg.cpp +1 -5
- package/src/duckdb/extension/core_functions/aggregate/distributive/bool.cpp +0 -4
- package/src/duckdb/extension/core_functions/aggregate/distributive/kurtosis.cpp +0 -4
- package/src/duckdb/extension/core_functions/aggregate/distributive/product.cpp +0 -4
- package/src/duckdb/extension/core_functions/aggregate/distributive/skew.cpp +0 -4
- package/src/duckdb/extension/core_functions/aggregate/distributive/string_agg.cpp +2 -6
- package/src/duckdb/extension/core_functions/aggregate/distributive/sum.cpp +0 -64
- package/src/duckdb/extension/core_functions/aggregate/holistic/approx_top_k.cpp +3 -7
- package/src/duckdb/extension/core_functions/aggregate/holistic/approximate_quantile.cpp +4 -7
- package/src/duckdb/extension/core_functions/aggregate/holistic/mad.cpp +3 -6
- package/src/duckdb/extension/core_functions/aggregate/holistic/mode.cpp +1 -8
- package/src/duckdb/extension/core_functions/aggregate/holistic/quantile.cpp +46 -7
- package/src/duckdb/extension/core_functions/aggregate/holistic/reservoir_quantile.cpp +15 -9
- package/src/duckdb/extension/core_functions/aggregate/nested/binned_histogram.cpp +8 -12
- package/src/duckdb/extension/core_functions/aggregate/nested/histogram.cpp +5 -7
- package/src/duckdb/extension/core_functions/aggregate/nested/list.cpp +24 -14
- package/src/duckdb/extension/core_functions/aggregate/regression/regr_avg.cpp +0 -5
- package/src/duckdb/extension/core_functions/aggregate/regression/regr_intercept.cpp +0 -3
- package/src/duckdb/extension/core_functions/aggregate/regression/regr_r2.cpp +0 -5
- package/src/duckdb/extension/core_functions/aggregate/regression/regr_sxx_syy.cpp +0 -3
- package/src/duckdb/extension/core_functions/aggregate/regression/regr_sxy.cpp +0 -4
- package/src/duckdb/extension/core_functions/core_functions_extension.cpp +18 -6
- package/src/duckdb/extension/core_functions/function_list.cpp +3 -6
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/algebraic/stddev.hpp +1 -1
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/algebraic_functions.hpp +2 -2
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/distributive_functions.hpp +4 -4
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/holistic_functions.hpp +1 -1
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/quantile_sort_tree.hpp +45 -32
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/quantile_state.hpp +1 -1
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/regression_functions.hpp +8 -8
- package/src/duckdb/extension/core_functions/include/core_functions/aggregate/sum_helpers.hpp +1 -1
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/array_functions.hpp +22 -22
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/blob_functions.hpp +2 -2
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/date_functions.hpp +5 -15
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/generic_functions.hpp +12 -22
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/list_functions.hpp +56 -56
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/map_functions.hpp +2 -2
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/math_functions.hpp +3 -3
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/string_functions.hpp +118 -118
- package/src/duckdb/extension/core_functions/include/core_functions/scalar/struct_functions.hpp +0 -10
- package/src/duckdb/extension/core_functions/include/core_functions_extension.hpp +1 -1
- package/src/duckdb/extension/core_functions/lambda_functions.cpp +4 -4
- package/src/duckdb/extension/core_functions/scalar/array/array_functions.cpp +1 -2
- package/src/duckdb/extension/core_functions/scalar/array/array_value.cpp +3 -7
- package/src/duckdb/extension/core_functions/scalar/bit/bitstring.cpp +0 -7
- package/src/duckdb/extension/core_functions/scalar/blob/base64.cpp +2 -5
- package/src/duckdb/extension/core_functions/scalar/blob/encode.cpp +2 -6
- package/src/duckdb/extension/core_functions/scalar/date/date_diff.cpp +3 -7
- package/src/duckdb/extension/core_functions/scalar/date/date_part.cpp +33 -187
- package/src/duckdb/extension/core_functions/scalar/date/date_sub.cpp +3 -7
- package/src/duckdb/extension/core_functions/scalar/date/date_trunc.cpp +8 -12
- package/src/duckdb/extension/core_functions/scalar/date/epoch.cpp +12 -16
- package/src/duckdb/extension/core_functions/scalar/date/make_date.cpp +7 -11
- package/src/duckdb/extension/core_functions/scalar/date/time_bucket.cpp +3 -7
- package/src/duckdb/extension/core_functions/scalar/date/to_interval.cpp +0 -4
- package/src/duckdb/extension/core_functions/scalar/enum/enum_functions.cpp +6 -6
- package/src/duckdb/extension/core_functions/scalar/generic/binning.cpp +4 -8
- package/src/duckdb/extension/core_functions/scalar/generic/can_implicitly_cast.cpp +2 -6
- package/src/duckdb/extension/core_functions/scalar/generic/cast_to_type.cpp +1 -4
- package/src/duckdb/extension/core_functions/scalar/generic/current_setting.cpp +3 -9
- package/src/duckdb/extension/core_functions/scalar/generic/least.cpp +2 -5
- package/src/duckdb/extension/core_functions/scalar/generic/stats.cpp +2 -5
- package/src/duckdb/extension/core_functions/scalar/generic/system_functions.cpp +9 -13
- package/src/duckdb/extension/core_functions/scalar/generic/typeof.cpp +1 -5
- package/src/duckdb/extension/core_functions/scalar/list/array_slice.cpp +26 -29
- package/src/duckdb/extension/core_functions/scalar/list/flatten.cpp +49 -9
- package/src/duckdb/extension/core_functions/scalar/list/list_aggregates.cpp +34 -17
- package/src/duckdb/extension/core_functions/scalar/list/list_has_any_or_all.cpp +50 -4
- package/src/duckdb/extension/core_functions/scalar/list/list_reduce.cpp +42 -46
- package/src/duckdb/extension/core_functions/scalar/list/list_sort.cpp +51 -48
- package/src/duckdb/extension/core_functions/scalar/list/list_value.cpp +144 -224
- package/src/duckdb/extension/core_functions/scalar/list/range.cpp +1 -5
- package/src/duckdb/extension/core_functions/scalar/map/map.cpp +41 -13
- package/src/duckdb/extension/core_functions/scalar/map/map_concat.cpp +6 -6
- package/src/duckdb/extension/core_functions/scalar/map/map_entries.cpp +42 -6
- package/src/duckdb/extension/core_functions/scalar/map/map_extract.cpp +59 -10
- package/src/duckdb/extension/core_functions/scalar/map/map_from_entries.cpp +32 -7
- package/src/duckdb/extension/core_functions/scalar/map/map_keys_values.cpp +45 -10
- package/src/duckdb/extension/core_functions/scalar/math/numeric.cpp +139 -364
- package/src/duckdb/extension/core_functions/scalar/operators/bitwise.cpp +7 -29
- package/src/duckdb/extension/core_functions/scalar/random/random.cpp +14 -18
- package/src/duckdb/extension/core_functions/scalar/random/setseed.cpp +1 -5
- package/src/duckdb/extension/core_functions/scalar/string/hex.cpp +2 -2
- package/src/duckdb/extension/core_functions/scalar/string/instr.cpp +3 -5
- package/src/duckdb/extension/core_functions/scalar/string/printf.cpp +0 -16
- package/src/duckdb/extension/core_functions/scalar/string/repeat.cpp +17 -2
- package/src/duckdb/extension/core_functions/scalar/struct/struct_insert.cpp +1 -1
- package/src/duckdb/extension/core_functions/scalar/union/union_extract.cpp +3 -7
- package/src/duckdb/extension/core_functions/scalar/union/union_tag.cpp +3 -7
- package/src/duckdb/extension/core_functions/scalar/union/union_value.cpp +3 -7
- package/src/duckdb/extension/icu/icu-current.cpp +5 -5
- package/src/duckdb/extension/icu/icu-dateadd.cpp +11 -11
- package/src/duckdb/extension/icu/icu-datepart.cpp +44 -44
- package/src/duckdb/extension/icu/icu-datesub.cpp +10 -10
- package/src/duckdb/extension/icu/icu-datetrunc.cpp +6 -6
- package/src/duckdb/extension/icu/icu-list-range.cpp +6 -7
- package/src/duckdb/extension/icu/icu-makedate.cpp +11 -8
- package/src/duckdb/extension/icu/icu-strptime.cpp +29 -23
- package/src/duckdb/extension/icu/icu-table-range.cpp +6 -8
- package/src/duckdb/extension/icu/icu-timebucket.cpp +5 -5
- package/src/duckdb/extension/icu/icu-timezone.cpp +30 -24
- package/src/duckdb/extension/icu/icu_extension.cpp +34 -22
- package/src/duckdb/extension/icu/include/icu-casts.hpp +2 -2
- package/src/duckdb/extension/icu/include/icu-current.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-dateadd.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-datepart.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-datesub.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-datetrunc.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-list-range.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-makedate.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-strptime.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-table-range.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-timebucket.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu-timezone.hpp +3 -3
- package/src/duckdb/extension/icu/include/icu_extension.hpp +1 -1
- package/src/duckdb/extension/json/include/json_common.hpp +2 -10
- package/src/duckdb/extension/json/include/json_enums.hpp +1 -3
- package/src/duckdb/extension/json/include/json_extension.hpp +1 -1
- package/src/duckdb/extension/json/include/json_functions.hpp +4 -4
- package/src/duckdb/extension/json/include/json_multi_file_info.hpp +2 -2
- package/src/duckdb/extension/json/include/json_reader.hpp +1 -3
- package/src/duckdb/extension/json/json_enums.cpp +0 -5
- package/src/duckdb/extension/json/json_extension.cpp +38 -27
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +3 -8
- package/src/duckdb/extension/json/json_functions/json_create.cpp +6 -9
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +20 -3
- package/src/duckdb/extension/json/json_functions/json_pretty.cpp +3 -3
- package/src/duckdb/extension/json/json_functions/json_serialize_plan.cpp +4 -6
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +4 -6
- package/src/duckdb/extension/json/json_functions/json_table_in_out.cpp +2 -6
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +3 -5
- package/src/duckdb/extension/json/json_functions/read_json.cpp +3 -4
- package/src/duckdb/extension/json/json_functions.cpp +8 -135
- package/src/duckdb/extension/json/json_multi_file_info.cpp +2 -5
- package/src/duckdb/extension/json/json_reader.cpp +6 -7
- package/src/duckdb/extension/parquet/column_reader.cpp +21 -46
- package/src/duckdb/extension/parquet/column_writer.cpp +105 -16
- package/src/duckdb/extension/parquet/geo_parquet.cpp +171 -231
- package/src/duckdb/extension/parquet/include/column_reader.hpp +2 -0
- package/src/duckdb/extension/parquet/include/column_writer.hpp +1 -2
- package/src/duckdb/extension/parquet/include/geo_parquet.hpp +66 -160
- package/src/duckdb/extension/parquet/include/parquet_column_schema.hpp +4 -6
- package/src/duckdb/extension/parquet/include/parquet_crypto.hpp +3 -0
- package/src/duckdb/extension/parquet/include/parquet_extension.hpp +1 -1
- package/src/duckdb/extension/parquet/include/parquet_file_metadata_cache.hpp +2 -5
- package/src/duckdb/extension/parquet/include/parquet_multi_file_info.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +2 -10
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_encoder.hpp +0 -3
- package/src/duckdb/extension/parquet/include/parquet_statistics.hpp +2 -0
- package/src/duckdb/extension/parquet/include/parquet_timestamp.hpp +6 -10
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +3 -4
- package/src/duckdb/extension/parquet/include/reader/row_number_column_reader.hpp +2 -0
- package/src/duckdb/extension/parquet/include/reader/uuid_column_reader.hpp +13 -3
- package/src/duckdb/extension/parquet/include/resizable_buffer.hpp +2 -0
- package/src/duckdb/extension/parquet/include/thrift_tools.hpp +3 -3
- package/src/duckdb/extension/parquet/include/writer/array_column_writer.hpp +1 -2
- package/src/duckdb/extension/parquet/include/writer/list_column_writer.hpp +1 -2
- package/src/duckdb/extension/parquet/include/writer/parquet_write_operators.hpp +10 -47
- package/src/duckdb/extension/parquet/include/writer/parquet_write_stats.hpp +1 -55
- package/src/duckdb/extension/parquet/include/writer/primitive_column_writer.hpp +3 -4
- package/src/duckdb/extension/parquet/include/writer/struct_column_writer.hpp +1 -2
- package/src/duckdb/extension/parquet/include/writer/templated_column_writer.hpp +3 -6
- package/src/duckdb/extension/parquet/include/zstd_file_system.hpp +3 -1
- package/src/duckdb/extension/parquet/parquet_crypto.cpp +11 -11
- package/src/duckdb/extension/parquet/parquet_extension.cpp +68 -84
- package/src/duckdb/extension/parquet/parquet_file_metadata_cache.cpp +4 -4
- package/src/duckdb/extension/parquet/parquet_float16.cpp +3 -0
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +17 -115
- package/src/duckdb/extension/parquet/parquet_multi_file_info.cpp +10 -25
- package/src/duckdb/extension/parquet/parquet_reader.cpp +56 -181
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +8 -26
- package/src/duckdb/extension/parquet/parquet_timestamp.cpp +4 -14
- package/src/duckdb/extension/parquet/parquet_writer.cpp +16 -117
- package/src/duckdb/extension/parquet/reader/decimal_column_reader.cpp +1 -1
- package/src/duckdb/extension/parquet/writer/array_column_writer.cpp +2 -5
- package/src/duckdb/extension/parquet/writer/enum_column_writer.cpp +1 -1
- package/src/duckdb/extension/parquet/writer/list_column_writer.cpp +3 -6
- package/src/duckdb/extension/parquet/writer/primitive_column_writer.cpp +8 -24
- package/src/duckdb/extension/parquet/writer/struct_column_writer.cpp +2 -4
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +6 -7
- package/src/duckdb/src/catalog/catalog.cpp +62 -92
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +8 -8
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +8 -14
- package/src/duckdb/src/catalog/catalog_set.cpp +0 -1
- package/src/duckdb/src/catalog/default/default_functions.cpp +4 -4
- package/src/duckdb/src/catalog/default/default_table_functions.cpp +4 -5
- package/src/duckdb/src/catalog/default/default_views.cpp +1 -1
- package/src/duckdb/src/catalog/duck_catalog.cpp +0 -28
- package/src/duckdb/src/common/adbc/adbc.cpp +125 -243
- package/src/duckdb/src/common/adbc/driver_manager.cpp +3 -3
- package/src/duckdb/src/common/arrow/appender/bool_data.cpp +7 -6
- package/src/duckdb/src/common/arrow/appender/fixed_size_list_data.cpp +1 -1
- package/src/duckdb/src/common/arrow/appender/struct_data.cpp +1 -1
- package/src/duckdb/src/common/arrow/appender/union_data.cpp +1 -0
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +17 -13
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +6 -14
- package/src/duckdb/src/common/arrow/arrow_type_extension.cpp +6 -6
- package/src/duckdb/src/common/arrow/physical_arrow_collector.cpp +10 -16
- package/src/duckdb/src/common/arrow/schema_metadata.cpp +2 -2
- package/src/duckdb/src/common/box_renderer.cpp +32 -83
- package/src/duckdb/src/common/complex_json.cpp +5 -20
- package/src/duckdb/src/common/compressed_file_system.cpp +5 -6
- package/src/duckdb/src/common/encryption_state.cpp +9 -56
- package/src/duckdb/src/common/enum_util.cpp +51 -405
- package/src/duckdb/src/common/enums/expression_type.cpp +0 -2
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +0 -2
- package/src/duckdb/src/common/enums/metric_type.cpp +0 -6
- package/src/duckdb/src/common/enums/optimizer_type.cpp +0 -1
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +0 -2
- package/src/duckdb/src/common/enums/statement_type.cpp +0 -2
- package/src/duckdb/src/common/error_data.cpp +0 -11
- package/src/duckdb/src/common/exception_format_value.cpp +1 -15
- package/src/duckdb/src/common/extra_type_info.cpp +0 -43
- package/src/duckdb/src/common/file_buffer.cpp +8 -11
- package/src/duckdb/src/common/file_system.cpp +12 -82
- package/src/duckdb/src/common/gzip_file_system.cpp +11 -13
- package/src/duckdb/src/common/local_file_system.cpp +16 -25
- package/src/duckdb/src/common/multi_file/base_file_reader.cpp +0 -4
- package/src/duckdb/src/common/multi_file/multi_file_column_mapper.cpp +11 -7
- package/src/duckdb/src/common/multi_file/multi_file_function.cpp +0 -8
- package/src/duckdb/src/common/multi_file/multi_file_list.cpp +4 -8
- package/src/duckdb/src/common/multi_file/multi_file_reader.cpp +5 -9
- package/src/duckdb/src/common/operator/cast_operators.cpp +6 -147
- package/src/duckdb/src/common/operator/string_cast.cpp +12 -41
- package/src/duckdb/src/common/pipe_file_system.cpp +5 -10
- package/src/duckdb/src/common/progress_bar/progress_bar.cpp +2 -2
- package/src/duckdb/src/common/progress_bar/terminal_progress_bar_display.cpp +7 -81
- package/src/duckdb/src/common/radix_partitioning.cpp +2 -2
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +11 -8
- package/src/duckdb/src/common/row_operations/row_external.cpp +7 -0
- package/src/duckdb/src/common/row_operations/row_gather.cpp +5 -0
- package/src/duckdb/src/common/row_operations/row_matcher.cpp +37 -55
- package/src/duckdb/src/common/row_operations/row_scatter.cpp +6 -0
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +0 -4
- package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +0 -4
- package/src/duckdb/src/common/serializer/memory_stream.cpp +0 -4
- package/src/duckdb/src/common/sort/partition_state.cpp +3 -3
- package/src/duckdb/src/common/string_util.cpp +44 -64
- package/src/duckdb/src/common/tree_renderer/text_tree_renderer.cpp +3 -40
- package/src/duckdb/src/common/tree_renderer.cpp +0 -3
- package/src/duckdb/src/common/types/column/column_data_allocator.cpp +29 -27
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +68 -216
- package/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +2 -3
- package/src/duckdb/src/common/types/conflict_info.cpp +2 -1
- package/src/duckdb/src/common/types/conflict_manager.cpp +207 -82
- package/src/duckdb/src/common/types/data_chunk.cpp +3 -10
- package/src/duckdb/src/common/types/date.cpp +10 -8
- package/src/duckdb/src/common/types/hash.cpp +7 -7
- package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +29 -38
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +54 -272
- package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +45 -156
- package/src/duckdb/src/common/types/row/tuple_data_iterator.cpp +5 -5
- package/src/duckdb/src/common/types/row/tuple_data_layout.cpp +18 -122
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +83 -466
- package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +28 -8
- package/src/duckdb/src/common/types/time.cpp +2 -2
- package/src/duckdb/src/common/types/timestamp.cpp +14 -26
- package/src/duckdb/src/common/types/uuid.cpp +2 -33
- package/src/duckdb/src/common/types/value.cpp +16 -79
- package/src/duckdb/src/common/types/vector.cpp +22 -190
- package/src/duckdb/src/common/types/vector_buffer.cpp +0 -4
- package/src/duckdb/src/common/types/vector_cache.cpp +0 -4
- package/src/duckdb/src/common/types.cpp +22 -110
- package/src/duckdb/src/common/value_operations/comparison_operations.cpp +27 -24
- package/src/duckdb/src/common/vector_operations/boolean_operators.cpp +9 -12
- package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +4 -5
- package/src/duckdb/src/common/vector_operations/generators.cpp +1 -1
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +135 -70
- package/src/duckdb/src/common/vector_operations/null_operations.cpp +1 -1
- package/src/duckdb/src/common/vector_operations/vector_copy.cpp +2 -5
- package/src/duckdb/src/common/vector_operations/vector_hash.cpp +55 -110
- package/src/duckdb/src/common/vector_operations/vector_storage.cpp +10 -14
- package/src/duckdb/src/common/virtual_file_system.cpp +3 -12
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +50 -88
- package/src/duckdb/src/execution/column_binding_resolver.cpp +6 -7
- package/src/duckdb/src/execution/expression_executor/execute_function.cpp +2 -113
- package/src/duckdb/src/execution/expression_executor.cpp +4 -44
- package/src/duckdb/src/execution/index/art/art.cpp +216 -78
- package/src/duckdb/src/execution/index/art/art_key.cpp +23 -0
- package/src/duckdb/src/execution/index/art/art_merger.cpp +4 -3
- package/src/duckdb/src/execution/index/art/base_leaf.cpp +11 -10
- package/src/duckdb/src/execution/index/art/base_node.cpp +75 -103
- package/src/duckdb/src/execution/index/art/iterator.cpp +3 -3
- package/src/duckdb/src/execution/index/art/leaf.cpp +11 -9
- package/src/duckdb/src/execution/index/art/node.cpp +53 -54
- package/src/duckdb/src/execution/index/art/node256.cpp +56 -30
- package/src/duckdb/src/execution/index/art/node256_leaf.cpp +30 -43
- package/src/duckdb/src/execution/index/art/node48.cpp +101 -69
- package/src/duckdb/src/execution/index/art/plan_art.cpp +1 -2
- package/src/duckdb/src/execution/index/art/prefix.cpp +125 -115
- package/src/duckdb/src/execution/index/bound_index.cpp +10 -39
- package/src/duckdb/src/execution/index/fixed_size_allocator.cpp +8 -23
- package/src/duckdb/src/execution/index/fixed_size_buffer.cpp +23 -35
- package/src/duckdb/src/execution/index/unbound_index.cpp +6 -26
- package/src/duckdb/src/execution/join_hashtable.cpp +55 -52
- package/src/duckdb/src/execution/nested_loop_join/nested_loop_join_inner.cpp +0 -3
- package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +4 -6
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +18 -27
- package/src/duckdb/src/execution/operator/aggregate/physical_partitioned_aggregate.cpp +2 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +2 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +2 -8
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +4 -6
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +387 -433
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +4 -5
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +4 -12
- package/src/duckdb/src/execution/operator/csv_scanner/encode/csv_encoder.cpp +7 -8
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +5 -7
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +2 -15
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +4 -4
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_multi_file_info.cpp +3 -12
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +2 -7
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +0 -4
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +12 -14
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +1 -2
- package/src/duckdb/src/execution/operator/helper/physical_buffered_batch_collector.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +2 -3
- package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +3 -3
- package/src/duckdb/src/execution/operator/helper/physical_limit_percent.cpp +3 -4
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +2 -3
- package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +9 -29
- package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +20 -23
- package/src/duckdb/src/execution/operator/helper/physical_set.cpp +11 -28
- package/src/duckdb/src/execution/operator/helper/physical_set_variable.cpp +2 -3
- package/src/duckdb/src/execution/operator/helper/physical_streaming_limit.cpp +3 -4
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +3 -3
- package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +3 -7
- package/src/duckdb/src/execution/operator/helper/physical_verify_vector.cpp +2 -4
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +10 -11
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +2 -3
- package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +4 -4
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +3 -4
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +8 -13
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +14 -15
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp +4 -5
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +7 -7
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +21 -20
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +3 -4
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +6 -18
- package/src/duckdb/src/execution/operator/join/physical_right_delim_join.cpp +4 -5
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +203 -62
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +4 -5
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +3 -5
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +7 -9
- package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +5 -7
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +7 -12
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +5 -34
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +20 -6
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +74 -91
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +9 -11
- package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +4 -7
- package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +36 -3
- package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +4 -26
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +3 -5
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +7 -9
- package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +3 -3
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +5 -6
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +9 -11
- package/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp +4 -5
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +3 -3
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +2 -3
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +2 -3
- package/src/duckdb/src/execution/operator/set/physical_cte.cpp +4 -5
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +3 -5
- package/src/duckdb/src/execution/operator/set/physical_union.cpp +3 -3
- package/src/duckdb/src/execution/physical_operator.cpp +32 -42
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +12 -24
- package/src/duckdb/src/execution/physical_plan/plan_asof_join.cpp +3 -5
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +18 -12
- package/src/duckdb/src/execution/physical_plan/plan_get.cpp +1 -3
- package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +10 -11
- package/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +18 -16
- package/src/duckdb/src/execution/physical_plan_generator.cpp +5 -8
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +27 -16
- package/src/duckdb/src/execution/sample/base_reservoir_sample.cpp +22 -22
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +11 -14
- package/src/duckdb/src/function/aggregate/distributive/first_last_any.cpp +19 -23
- package/src/duckdb/src/function/aggregate/distributive/minmax.cpp +7 -14
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +234 -185
- package/src/duckdb/src/function/cast/blob_cast.cpp +0 -3
- package/src/duckdb/src/function/cast/cast_function_set.cpp +4 -24
- package/src/duckdb/src/function/cast/decimal_cast.cpp +3 -3
- package/src/duckdb/src/function/cast/default_casts.cpp +4 -12
- package/src/duckdb/src/function/cast/enum_casts.cpp +3 -4
- package/src/duckdb/src/function/cast/numeric_casts.cpp +3 -3
- package/src/duckdb/src/function/cast/string_cast.cpp +11 -14
- package/src/duckdb/src/function/cast/struct_cast.cpp +2 -127
- package/src/duckdb/src/function/cast/time_casts.cpp +0 -18
- package/src/duckdb/src/function/cast/union_casts.cpp +6 -7
- package/src/duckdb/src/function/cast/uuid_casts.cpp +0 -3
- package/src/duckdb/src/function/cast_rules.cpp +4 -38
- package/src/duckdb/src/function/copy_function.cpp +0 -15
- package/src/duckdb/src/function/function.cpp +0 -2
- package/src/duckdb/src/function/function_binder.cpp +13 -239
- package/src/duckdb/src/function/function_list.cpp +0 -8
- package/src/duckdb/src/function/macro_function.cpp +70 -263
- package/src/duckdb/src/function/pragma/pragma_functions.cpp +38 -6
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +22 -37
- package/src/duckdb/src/function/register_function_list.cpp +5 -5
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +34 -43
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +38 -61
- package/src/duckdb/src/function/scalar/create_sort_key.cpp +154 -374
- package/src/duckdb/src/function/scalar/date/strftime.cpp +28 -31
- package/src/duckdb/src/function/scalar/generic/constant_or_null.cpp +14 -18
- package/src/duckdb/src/function/scalar/generic/error.cpp +7 -18
- package/src/duckdb/src/function/scalar/generic/getvariable.cpp +2 -5
- package/src/duckdb/src/function/scalar/list/contains_or_position.cpp +52 -4
- package/src/duckdb/src/function/scalar/list/list_extract.cpp +12 -5
- package/src/duckdb/src/function/scalar/list/list_resize.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/list_select.cpp +27 -11
- package/src/duckdb/src/function/scalar/map/map_contains.cpp +31 -5
- package/src/duckdb/src/function/scalar/operator/add.cpp +1 -6
- package/src/duckdb/src/function/scalar/operator/arithmetic.cpp +10 -130
- package/src/duckdb/src/function/scalar/operator/multiply.cpp +2 -4
- package/src/duckdb/src/function/scalar/operator/subtract.cpp +1 -3
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +3 -7
- package/src/duckdb/src/function/scalar/strftime_format.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +0 -4
- package/src/duckdb/src/function/scalar/string/concat.cpp +19 -18
- package/src/duckdb/src/function/scalar/string/contains.cpp +7 -14
- package/src/duckdb/src/function/scalar/string/length.cpp +9 -13
- package/src/duckdb/src/function/scalar/string/like.cpp +143 -146
- package/src/duckdb/src/function/scalar/string/md5.cpp +2 -6
- package/src/duckdb/src/function/scalar/string/nfc_normalize.cpp +1 -5
- package/src/duckdb/src/function/scalar/string/prefix.cpp +8 -11
- package/src/duckdb/src/function/scalar/string/regexp_escape.cpp +1 -5
- package/src/duckdb/src/function/scalar/string/sha1.cpp +1 -5
- package/src/duckdb/src/function/scalar/string/sha256.cpp +1 -5
- package/src/duckdb/src/function/scalar/string/string_split.cpp +3 -7
- package/src/duckdb/src/function/scalar/string/strip_accents.cpp +1 -5
- package/src/duckdb/src/function/scalar/string/substring.cpp +6 -10
- package/src/duckdb/src/function/scalar/string/suffix.cpp +8 -10
- package/src/duckdb/src/function/scalar/struct/remap_struct.cpp +17 -20
- package/src/duckdb/src/function/scalar/struct/struct_concat.cpp +1 -1
- package/src/duckdb/src/function/scalar/struct/struct_pack.cpp +2 -2
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +31 -34
- package/src/duckdb/src/function/scalar/system/current_connection_id.cpp +1 -5
- package/src/duckdb/src/function/scalar/system/current_query_id.cpp +1 -5
- package/src/duckdb/src/function/scalar/system/current_transaction_id.cpp +1 -5
- package/src/duckdb/src/function/scalar/system/parse_log_message.cpp +1 -5
- package/src/duckdb/src/function/scalar/system/write_log.cpp +13 -11
- package/src/duckdb/src/function/scalar_macro_function.cpp +11 -8
- package/src/duckdb/src/function/table/arrow/arrow_array_scan_state.cpp +3 -2
- package/src/duckdb/src/function/table/arrow/arrow_duck_schema.cpp +2 -27
- package/src/duckdb/src/function/table/arrow.cpp +17 -37
- package/src/duckdb/src/function/table/arrow_conversion.cpp +236 -186
- package/src/duckdb/src/function/table/copy_csv.cpp +245 -76
- package/src/duckdb/src/function/table/read_file.cpp +220 -90
- package/src/duckdb/src/function/table/sniff_csv.cpp +1 -0
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +7 -3
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +5 -20
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +5 -10
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +22 -6
- package/src/duckdb/src/function/table/system/duckdb_log.cpp +5 -41
- package/src/duckdb/src/function/table/system/duckdb_log_contexts.cpp +6 -15
- package/src/duckdb/src/function/table/system/duckdb_settings.cpp +6 -29
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +0 -4
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +2 -2
- package/src/duckdb/src/function/table/system/test_all_types.cpp +6 -30
- package/src/duckdb/src/function/table/system_functions.cpp +0 -2
- package/src/duckdb/src/function/table/table_scan.cpp +48 -82
- package/src/duckdb/src/function/table/version/pragma_version.cpp +4 -7
- package/src/duckdb/src/function/window/window_aggregate_function.cpp +46 -56
- package/src/duckdb/src/function/window/window_aggregator.cpp +19 -33
- package/src/duckdb/src/function/window/window_boundaries_state.cpp +2 -12
- package/src/duckdb/src/function/window/window_collection.cpp +0 -30
- package/src/duckdb/src/function/window/window_constant_aggregator.cpp +24 -32
- package/src/duckdb/src/function/window/window_custom_aggregator.cpp +40 -54
- package/src/duckdb/src/function/window/window_distinct_aggregator.cpp +251 -200
- package/src/duckdb/src/function/window/window_executor.cpp +36 -44
- package/src/duckdb/src/function/window/window_index_tree.cpp +16 -26
- package/src/duckdb/src/function/window/window_merge_sort_tree.cpp +151 -98
- package/src/duckdb/src/function/window/window_naive_aggregator.cpp +72 -94
- package/src/duckdb/src/function/window/window_rank_function.cpp +63 -57
- package/src/duckdb/src/function/window/window_rownumber_function.cpp +47 -45
- package/src/duckdb/src/function/window/window_segment_tree.cpp +22 -28
- package/src/duckdb/src/function/window/window_token_tree.cpp +41 -46
- package/src/duckdb/src/function/window/window_value_function.cpp +93 -632
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +5 -24
- package/src/duckdb/src/include/duckdb/catalog/default/builtin_types/types.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +0 -16
- package/src/duckdb/src/include/duckdb/common/adbc/adbc.hpp +1 -68
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +0 -3
- package/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp +55 -31
- package/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/appender/list_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/appender/list_view_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp +6 -6
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_wrapper.hpp +0 -10
- package/src/duckdb/src/include/duckdb/common/arrow/physical_arrow_batch_collector.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/arrow/physical_arrow_collector.hpp +4 -3
- package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/chrono.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/complex_json.hpp +4 -15
- package/src/duckdb/src/include/duckdb/common/compressed_file_system.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/encryption_state.hpp +9 -25
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +0 -120
- package/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp +1 -3
- package/src/duckdb/src/include/duckdb/common/enums/debug_vector_verification.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/enums/explain_format.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/enums/file_glob_options.hpp +3 -11
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/enums/metric_type.hpp +0 -3
- package/src/duckdb/src/include/duckdb/common/enums/optimizer_type.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/enums/undo_flags.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/error_data.hpp +2 -4
- package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +1 -9
- package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +1 -25
- package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +6 -15
- package/src/duckdb/src/include/duckdb/common/file_open_flags.hpp +0 -14
- package/src/duckdb/src/include/duckdb/common/file_opener.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +6 -14
- package/src/duckdb/src/include/duckdb/common/fsst.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/helper.hpp +3 -21
- package/src/duckdb/src/include/duckdb/common/local_file_system.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/multi_file/base_file_reader.hpp +0 -4
- package/src/duckdb/src/include/duckdb/common/multi_file/multi_file_function.hpp +14 -43
- package/src/duckdb/src/include/duckdb/common/multi_file/multi_file_list.hpp +3 -4
- package/src/duckdb/src/include/duckdb/common/multi_file/multi_file_reader.hpp +3 -10
- package/src/duckdb/src/include/duckdb/common/multi_file/multi_file_states.hpp +0 -2
- package/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +0 -57
- package/src/duckdb/src/include/duckdb/common/opener_file_system.hpp +3 -7
- package/src/duckdb/src/include/duckdb/common/operator/cast_operators.hpp +0 -84
- package/src/duckdb/src/include/duckdb/common/operator/string_cast.hpp +0 -6
- package/src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp +2 -18
- package/src/duckdb/src/include/duckdb/common/owning_string_map.hpp +0 -8
- package/src/duckdb/src/include/duckdb/common/pipe_file_system.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/progress_bar/display/terminal_progress_bar_display.hpp +5 -44
- package/src/duckdb/src/include/duckdb/common/progress_bar/progress_bar.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/row_operations/row_matcher.hpp +14 -8
- package/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +0 -2
- package/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +2 -17
- package/src/duckdb/src/include/duckdb/common/serializer/memory_stream.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/serializer/read_stream.hpp +1 -9
- package/src/duckdb/src/include/duckdb/common/tree_renderer/text_tree_renderer.hpp +0 -5
- package/src/duckdb/src/include/duckdb/common/type_util.hpp +4 -34
- package/src/duckdb/src/include/duckdb/common/type_visitor.hpp +6 -36
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_allocator.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_segment.hpp +2 -4
- package/src/duckdb/src/include/duckdb/common/types/conflict_manager.hpp +56 -202
- package/src/duckdb/src/include/duckdb/common/types/constraint_conflict_info.hpp +5 -7
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +1 -3
- package/src/duckdb/src/include/duckdb/common/types/date.hpp +5 -9
- package/src/duckdb/src/include/duckdb/common/types/datetime.hpp +2 -11
- package/src/duckdb/src/include/duckdb/common/types/hash.hpp +10 -22
- package/src/duckdb/src/include/duckdb/common/types/hugeint.hpp +6 -6
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/row/row_data_collection.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_allocator.hpp +0 -7
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +2 -26
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_layout.hpp +5 -43
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +11 -4
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_states.hpp +1 -10
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +58 -8
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +1 -7
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +3 -7
- package/src/duckdb/src/include/duckdb/common/types/uhugeint.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/types/uuid.hpp +0 -5
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +5 -14
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +2 -15
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +5 -118
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +0 -8
- package/src/duckdb/src/include/duckdb/common/types.hpp +6 -26
- package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +11 -50
- package/src/duckdb/src/include/duckdb/common/virtual_file_system.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/winapi.hpp +4 -0
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +6 -8
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +0 -4
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +2 -21
- package/src/duckdb/src/include/duckdb/execution/ht_entry.hpp +0 -4
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +16 -15
- package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +13 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art_merger.hpp +0 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/art_operator.hpp +1 -113
- package/src/duckdb/src/include/duckdb/execution/index/art/art_scanner.hpp +2 -5
- package/src/duckdb/src/include/duckdb/execution/index/art/base_leaf.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/index/art/base_node.hpp +15 -18
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +3 -30
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +8 -30
- package/src/duckdb/src/include/duckdb/execution/index/art/node256_leaf.hpp +5 -8
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +9 -36
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +20 -9
- package/src/duckdb/src/include/duckdb/execution/index/bound_index.hpp +6 -8
- package/src/duckdb/src/include/duckdb/execution/index/fixed_size_allocator.hpp +4 -21
- package/src/duckdb/src/include/duckdb/execution/index/fixed_size_buffer.hpp +11 -95
- package/src/duckdb/src/include/duckdb/execution/index/unbound_index.hpp +11 -22
- package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +1 -6
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/distinct_aggregate_data.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +8 -12
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_partitioned_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_handle.hpp +0 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_multi_file_info.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/encode/csv_encoder.hpp +0 -3
- package/src/duckdb/src/include/duckdb/execution/operator/filter/physical_filter.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_buffered_batch_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_buffered_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_create_secret.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reset.hpp +4 -5
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +3 -6
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set_variable.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_limit.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_sample.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_transaction.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_update_extensions.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_verify_vector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +2 -3
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_comparison_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +4 -5
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_left_delim_join.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +5 -6
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_range_join.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_right_delim_join.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +9 -13
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_database.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_pivot.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_projection.hpp +7 -2
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_tableinout_function.hpp +1 -6
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_unnest.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_positional_scan.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_art_index.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_table.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_union.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +22 -23
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -7
- package/src/duckdb/src/include/duckdb/execution/radix_partitioned_hashtable.hpp +1 -4
- package/src/duckdb/src/include/duckdb/execution/reservoir_sample.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +11 -36
- package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -1
- package/src/duckdb/src/include/duckdb/function/cast/bound_cast_data.hpp +0 -28
- package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +1 -6
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +1 -5
- package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +3 -2
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +10 -28
- package/src/duckdb/src/include/duckdb/function/create_sort_key.hpp +0 -13
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +0 -3
- package/src/duckdb/src/include/duckdb/function/function_list.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +3 -25
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +6 -18
- package/src/duckdb/src/include/duckdb/function/pragma/pragma_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/register_function_list_helper.hpp +2 -34
- package/src/duckdb/src/include/duckdb/function/scalar/compressed_materialization_functions.hpp +0 -10
- package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +5 -5
- package/src/duckdb/src/include/duckdb/function/scalar/list_functions.hpp +19 -19
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +103 -103
- package/src/duckdb/src/include/duckdb/function/scalar/struct_functions.hpp +0 -32
- package/src/duckdb/src/include/duckdb/function/scalar/system_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_duck_schema.hpp +2 -8
- package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_type_info.hpp +0 -2
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +11 -26
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +12 -2
- package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +1 -9
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +5 -8
- package/src/duckdb/src/include/duckdb/function/window/window_aggregate_function.hpp +10 -10
- package/src/duckdb/src/include/duckdb/function/window/window_aggregator.hpp +48 -25
- package/src/duckdb/src/include/duckdb/function/window/window_collection.hpp +0 -142
- package/src/duckdb/src/include/duckdb/function/window/window_constant_aggregator.hpp +12 -11
- package/src/duckdb/src/include/duckdb/function/window/window_custom_aggregator.hpp +8 -8
- package/src/duckdb/src/include/duckdb/function/window/window_distinct_aggregator.hpp +10 -10
- package/src/duckdb/src/include/duckdb/function/window/window_executor.hpp +40 -26
- package/src/duckdb/src/include/duckdb/function/window/window_index_tree.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/window/window_merge_sort_tree.hpp +30 -32
- package/src/duckdb/src/include/duckdb/function/window/window_naive_aggregator.hpp +3 -5
- package/src/duckdb/src/include/duckdb/function/window/window_rank_function.hpp +16 -17
- package/src/duckdb/src/include/duckdb/function/window/window_rownumber_function.hpp +9 -10
- package/src/duckdb/src/include/duckdb/function/window/window_segment_tree.hpp +8 -8
- package/src/duckdb/src/include/duckdb/function/window/window_token_tree.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/window/window_value_function.hpp +21 -44
- package/src/duckdb/src/include/duckdb/logging/log_manager.hpp +4 -12
- package/src/duckdb/src/include/duckdb/logging/log_storage.hpp +50 -271
- package/src/duckdb/src/include/duckdb/main/appender.hpp +16 -37
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +4 -18
- package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +6 -23
- package/src/duckdb/src/include/duckdb/main/capi/extension_api.hpp +8 -92
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +70 -11
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +5 -28
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +23 -21
- package/src/duckdb/src/include/duckdb/main/client_properties.hpp +19 -3
- package/src/duckdb/src/include/duckdb/main/config.hpp +111 -48
- package/src/duckdb/src/include/duckdb/main/database.hpp +27 -23
- package/src/duckdb/src/include/duckdb/main/database_file_opener.hpp +0 -1
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +21 -19
- package/src/duckdb/src/include/duckdb/main/database_path_and_type.hpp +1 -3
- package/src/duckdb/src/include/duckdb/main/db_instance_cache.hpp +4 -8
- package/src/duckdb/src/include/duckdb/main/error_manager.hpp +1 -3
- package/src/duckdb/src/include/duckdb/main/extension.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +0 -35
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +77 -6
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +23 -41
- package/src/duckdb/src/include/duckdb/main/relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +0 -1
- package/src/duckdb/src/include/duckdb/main/secret/secret_manager.hpp +18 -18
- package/src/duckdb/src/include/duckdb/main/settings.hpp +184 -168
- package/src/duckdb/src/include/duckdb/main/valid_checker.hpp +2 -5
- package/src/duckdb/src/include/duckdb/optimizer/build_probe_side_optimizer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/column_lifetime_analyzer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/compressed_materialization.hpp +0 -4
- package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +1 -4
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +0 -3
- package/src/duckdb/src/include/duckdb/optimizer/late_materialization.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +3 -9
- package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +1 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +8 -18
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +4 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +4 -6
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_expression_iterator.hpp +0 -14
- package/src/duckdb/src/include/duckdb/parser/parser.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/qualified_name.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/query_node/cte_node.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/statement/update_statement.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp +9 -4
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/tableref/list.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/showref.hpp +1 -5
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +0 -4
- package/src/duckdb/src/include/duckdb/parser/tokens.hpp +0 -3
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -9
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +0 -5
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +8 -45
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +0 -1
- package/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +0 -3
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_check_constraint.hpp +0 -8
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_foreign_key_constraint.hpp +0 -4
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_not_null_constraint.hpp +0 -4
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_unique_constraint.hpp +0 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +1 -3
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +8 -3
- package/src/duckdb/src/include/duckdb/planner/expression_iterator.hpp +0 -18
- package/src/duckdb/src/include/duckdb/planner/extension_callback.hpp +0 -8
- package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +0 -1
- package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +0 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +0 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +22 -28
- package/src/duckdb/src/include/duckdb/planner/operator/logical_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_cte_node.hpp +0 -2
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +0 -26
- package/src/duckdb/src/include/duckdb/storage/block.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/block_manager.hpp +8 -24
- package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +1 -3
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +36 -55
- package/src/duckdb/src/include/duckdb/storage/caching_file_system.hpp +4 -10
- package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +6 -19
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_reader.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +8 -15
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +8 -6
- package/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp +1 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +2 -4
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/packed_data.hpp +1 -3
- package/src/duckdb/src/include/duckdb/storage/compression/dict_fsst/compression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/dict_fsst/decompression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas.hpp +1 -1
- 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 +2 -7
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +0 -5
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +9 -14
- package/src/duckdb/src/include/duckdb/storage/external_file_cache.hpp +5 -6
- package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +2 -7
- package/src/duckdb/src/include/duckdb/storage/magic_bytes.hpp +1 -2
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +0 -15
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_reader.hpp +0 -7
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_writer.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +3 -10
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +3 -14
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +20 -65
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +6 -6
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +20 -80
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +17 -43
- package/src/duckdb/src/include/duckdb/storage/storage_options.hpp +0 -21
- package/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +1 -7
- package/src/duckdb/src/include/duckdb/storage/table/column_data_checkpointer.hpp +2 -5
- package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +7 -10
- package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/table/persistent_table_data.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -17
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +1 -11
- package/src/duckdb/src/include/duckdb/storage/table/row_group_segment_tree.hpp +0 -5
- package/src/duckdb/src/include/duckdb/storage/table/segment_lock.hpp +0 -4
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +14 -34
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +46 -55
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +0 -3
- package/src/duckdb/src/include/duckdb/storage/temporary_file_manager.hpp +6 -17
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +1 -2
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +0 -3
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp +0 -1
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +1 -3
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +1 -22
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer_allocator.hpp +0 -2
- package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +7 -14
- package/src/duckdb/src/include/duckdb.h +121 -537
- package/src/duckdb/src/include/duckdb_extension.h +14 -122
- package/src/duckdb/src/logging/log_manager.cpp +15 -59
- package/src/duckdb/src/logging/log_storage.cpp +128 -672
- package/src/duckdb/src/main/appender.cpp +88 -129
- package/src/duckdb/src/main/attached_database.cpp +52 -47
- package/src/duckdb/src/main/capi/aggregate_function-c.cpp +9 -18
- package/src/duckdb/src/main/capi/appender-c.cpp +28 -82
- package/src/duckdb/src/main/capi/arrow-c.cpp +17 -181
- package/src/duckdb/src/main/capi/config-c.cpp +3 -18
- package/src/duckdb/src/main/capi/data_chunk-c.cpp +10 -22
- package/src/duckdb/src/main/capi/duckdb-c.cpp +21 -64
- package/src/duckdb/src/main/capi/duckdb_value-c.cpp +7 -13
- package/src/duckdb/src/main/capi/helper-c.cpp +39 -227
- package/src/duckdb/src/main/capi/logical_types-c.cpp +28 -48
- package/src/duckdb/src/main/capi/prepared-c.cpp +10 -68
- package/src/duckdb/src/main/capi/profiling_info-c.cpp +4 -6
- package/src/duckdb/src/main/capi/result-c.cpp +95 -16
- package/src/duckdb/src/main/capi/scalar_function-c.cpp +1 -43
- package/src/duckdb/src/main/capi/table_function-c.cpp +0 -9
- package/src/duckdb/src/main/client_config.cpp +0 -21
- package/src/duckdb/src/main/client_context.cpp +77 -153
- package/src/duckdb/src/main/client_context_file_opener.cpp +0 -1
- package/src/duckdb/src/main/client_data.cpp +1 -139
- package/src/duckdb/src/main/client_verify.cpp +6 -14
- package/src/duckdb/src/main/config.cpp +121 -214
- package/src/duckdb/src/main/database.cpp +58 -31
- package/src/duckdb/src/main/database_manager.cpp +108 -134
- package/src/duckdb/src/main/database_path_and_type.cpp +3 -4
- package/src/duckdb/src/main/db_instance_cache.cpp +35 -64
- package/src/duckdb/src/main/error_manager.cpp +1 -2
- package/src/duckdb/src/main/extension/extension_helper.cpp +22 -3
- package/src/duckdb/src/main/extension/extension_install.cpp +6 -6
- package/src/duckdb/src/main/extension/extension_load.cpp +9 -24
- package/src/duckdb/src/main/http/http_util.cpp +5 -18
- package/src/duckdb/src/main/profiling_info.cpp +2 -8
- package/src/duckdb/src/main/query_profiler.cpp +30 -65
- package/src/duckdb/src/main/query_result.cpp +1 -1
- package/src/duckdb/src/main/relation/query_relation.cpp +0 -23
- package/src/duckdb/src/main/secret/secret_manager.cpp +7 -8
- package/src/duckdb/src/main/settings/autogenerated_settings.cpp +645 -50
- package/src/duckdb/src/main/settings/custom_settings.cpp +152 -111
- package/src/duckdb/src/main/valid_checker.cpp +4 -10
- package/src/duckdb/src/optimizer/build_probe_side_optimizer.cpp +5 -7
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +7 -7
- package/src/duckdb/src/optimizer/compressed_materialization/compress_comparison_join.cpp +7 -11
- package/src/duckdb/src/optimizer/compressed_materialization.cpp +39 -56
- package/src/duckdb/src/optimizer/empty_result_pullup.cpp +1 -8
- package/src/duckdb/src/optimizer/filter_combiner.cpp +7 -5
- package/src/duckdb/src/optimizer/filter_pushdown.cpp +0 -3
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +2 -18
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +0 -1
- package/src/duckdb/src/optimizer/join_order/plan_enumerator.cpp +3 -4
- package/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp +15 -11
- package/src/duckdb/src/optimizer/join_order/relation_manager.cpp +23 -40
- package/src/duckdb/src/optimizer/late_materialization.cpp +23 -16
- package/src/duckdb/src/optimizer/optimizer.cpp +0 -15
- package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +20 -15
- package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +13 -11
- package/src/duckdb/src/optimizer/pushdown/pushdown_projection.cpp +26 -20
- package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +14 -11
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +1 -2
- package/src/duckdb/src/optimizer/rule/join_dependent_filter.cpp +9 -3
- package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +6 -1
- package/src/duckdb/src/optimizer/rule/timestamp_comparison.cpp +6 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_aggregate.cpp +1 -33
- package/src/duckdb/src/parallel/event.cpp +3 -1
- package/src/duckdb/src/parallel/executor.cpp +7 -0
- package/src/duckdb/src/parallel/pipeline.cpp +2 -2
- package/src/duckdb/src/parallel/pipeline_executor.cpp +2 -2
- package/src/duckdb/src/parallel/task_scheduler.cpp +34 -146
- package/src/duckdb/src/parallel/thread_context.cpp +9 -2
- package/src/duckdb/src/parser/column_definition.cpp +6 -3
- package/src/duckdb/src/parser/expression/window_expression.cpp +0 -3
- package/src/duckdb/src/parser/parsed_data/attach_info.cpp +35 -8
- package/src/duckdb/src/parser/parsed_data/copy_info.cpp +7 -27
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +13 -8
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +0 -16
- package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +17 -7
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +14 -1
- package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +12 -1
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +13 -1
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +0 -22
- package/src/duckdb/src/parser/parser.cpp +0 -5
- package/src/duckdb/src/parser/qualified_name.cpp +0 -26
- package/src/duckdb/src/parser/query_node/cte_node.cpp +0 -1
- package/src/duckdb/src/parser/query_node/select_node.cpp +0 -1
- package/src/duckdb/src/parser/query_node.cpp +0 -1
- package/src/duckdb/src/parser/statement/export_statement.cpp +3 -1
- package/src/duckdb/src/parser/statement/update_statement.cpp +16 -19
- package/src/duckdb/src/parser/tableref/column_data_ref.cpp +1 -26
- package/src/duckdb/src/parser/tableref/joinref.cpp +2 -3
- package/src/duckdb/src/parser/tableref/showref.cpp +0 -14
- package/src/duckdb/src/parser/tableref/table_function.cpp +1 -6
- package/src/duckdb/src/parser/transform/expression/transform_expression.cpp +1 -0
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +1 -6
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +11 -8
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +0 -3
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +5 -7
- package/src/duckdb/src/parser/transform/statement/transform_attach.cpp +4 -4
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +80 -16
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +22 -27
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +1 -0
- package/src/duckdb/src/parser/transform/statement/transform_explain.cpp +2 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +14 -22
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +0 -2
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +4 -22
- package/src/duckdb/src/parser/transform/tableref/transform_from.cpp +1 -3
- package/src/duckdb/src/parser/transform/tableref/transform_join.cpp +6 -12
- package/src/duckdb/src/parser/transform/tableref/transform_table_function.cpp +3 -3
- package/src/duckdb/src/parser/transformer.cpp +7 -8
- package/src/duckdb/src/planner/bind_context.cpp +2 -19
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +6 -13
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +0 -3
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +4 -18
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +25 -8
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +4 -31
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +0 -2
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +11 -48
- package/src/duckdb/src/planner/binder/query_node/bind_cte_node.cpp +1 -9
- package/src/duckdb/src/planner/binder/query_node/bind_recursive_cte_node.cpp +0 -4
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +6 -6
- package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +26 -11
- package/src/duckdb/src/planner/binder/query_node/plan_cte_node.cpp +3 -4
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +4 -10
- package/src/duckdb/src/planner/binder/statement/bind_attach.cpp +0 -15
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +58 -239
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +55 -157
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +25 -30
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +3 -28
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +0 -36
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +322 -282
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +14 -23
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +27 -37
- package/src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp +1 -4
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +36 -120
- package/src/duckdb/src/planner/binder/tableref/bind_showref.cpp +0 -30
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +1 -72
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +12 -7
- package/src/duckdb/src/planner/binder/tableref/plan_table_function.cpp +1 -15
- package/src/duckdb/src/planner/binder.cpp +175 -42
- package/src/duckdb/src/planner/bound_result_modifier.cpp +0 -8
- package/src/duckdb/src/planner/collation_binding.cpp +1 -2
- package/src/duckdb/src/planner/expression.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +2 -4
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +6 -8
- package/src/duckdb/src/planner/expression_iterator.cpp +0 -31
- package/src/duckdb/src/planner/logical_operator_visitor.cpp +4 -18
- package/src/duckdb/src/planner/operator/logical_aggregate.cpp +1 -2
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +2 -4
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +0 -3
- package/src/duckdb/src/planner/operator/logical_get.cpp +2 -7
- package/src/duckdb/src/planner/operator/logical_insert.cpp +2 -5
- package/src/duckdb/src/planner/operator/logical_join.cpp +7 -6
- package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +0 -1
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +0 -8
- package/src/duckdb/src/planner/planner.cpp +2 -4
- package/src/duckdb/src/planner/pragma_handler.cpp +1 -1
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +7 -76
- package/src/duckdb/src/planner/table_binding.cpp +12 -6
- package/src/duckdb/src/storage/block.cpp +1 -2
- package/src/duckdb/src/storage/buffer/block_handle.cpp +4 -7
- package/src/duckdb/src/storage/buffer/block_manager.cpp +6 -14
- package/src/duckdb/src/storage/buffer/buffer_pool.cpp +2 -2
- package/src/duckdb/src/storage/buffer_manager.cpp +13 -45
- package/src/duckdb/src/storage/caching_file_system.cpp +12 -20
- package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +3 -26
- package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +1 -3
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +35 -56
- package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +1 -1
- package/src/duckdb/src/storage/checkpoint_manager.cpp +11 -12
- package/src/duckdb/src/storage/compression/bitpacking.cpp +1 -4
- package/src/duckdb/src/storage/compression/dict_fsst/compression.cpp +25 -48
- package/src/duckdb/src/storage/compression/dict_fsst/decompression.cpp +13 -10
- package/src/duckdb/src/storage/compression/dict_fsst.cpp +2 -2
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +5 -10
- package/src/duckdb/src/storage/compression/fsst.cpp +2 -3
- package/src/duckdb/src/storage/compression/rle.cpp +1 -1
- package/src/duckdb/src/storage/compression/zstd.cpp +6 -5
- package/src/duckdb/src/storage/data_table.cpp +144 -167
- package/src/duckdb/src/storage/external_file_cache.cpp +6 -6
- package/src/duckdb/src/storage/local_storage.cpp +68 -132
- package/src/duckdb/src/storage/magic_bytes.cpp +2 -3
- package/src/duckdb/src/storage/metadata/metadata_manager.cpp +17 -88
- package/src/duckdb/src/storage/metadata/metadata_reader.cpp +3 -26
- package/src/duckdb/src/storage/metadata/metadata_writer.cpp +0 -7
- package/src/duckdb/src/storage/open_file_storage_extension.cpp +3 -3
- package/src/duckdb/src/storage/optimistic_data_writer.cpp +3 -5
- package/src/duckdb/src/storage/partial_block_manager.cpp +5 -26
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +22 -72
- package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +3 -9
- package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +0 -2
- package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +2 -12
- package/src/duckdb/src/storage/serialization/serialize_types.cpp +0 -14
- package/src/duckdb/src/storage/single_file_block_manager.cpp +86 -381
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +30 -86
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +3 -3
- package/src/duckdb/src/storage/statistics/string_stats.cpp +2 -2
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +1 -1
- package/src/duckdb/src/storage/storage_info.cpp +7 -13
- package/src/duckdb/src/storage/storage_manager.cpp +35 -110
- package/src/duckdb/src/storage/table/array_column_data.cpp +0 -4
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +15 -22
- package/src/duckdb/src/storage/table/column_data.cpp +14 -53
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +17 -17
- package/src/duckdb/src/storage/table/column_segment.cpp +21 -23
- package/src/duckdb/src/storage/table/list_column_data.cpp +1 -6
- package/src/duckdb/src/storage/table/row_group.cpp +154 -226
- package/src/duckdb/src/storage/table/row_group_collection.cpp +47 -146
- package/src/duckdb/src/storage/table/row_version_manager.cpp +1 -1
- package/src/duckdb/src/storage/table/standard_column_data.cpp +2 -14
- package/src/duckdb/src/storage/table/struct_column_data.cpp +0 -15
- package/src/duckdb/src/storage/table/update_segment.cpp +5 -111
- package/src/duckdb/src/storage/table_index_list.cpp +73 -137
- package/src/duckdb/src/storage/temporary_file_manager.cpp +28 -103
- package/src/duckdb/src/storage/wal_replay.cpp +36 -158
- package/src/duckdb/src/storage/write_ahead_log.cpp +17 -102
- package/src/duckdb/src/transaction/commit_state.cpp +0 -2
- package/src/duckdb/src/transaction/duck_transaction.cpp +2 -12
- package/src/duckdb/src/transaction/duck_transaction_manager.cpp +35 -66
- package/src/duckdb/src/transaction/meta_transaction.cpp +23 -85
- package/src/duckdb/src/transaction/rollback_state.cpp +0 -7
- package/src/duckdb/src/transaction/transaction_context.cpp +4 -3
- package/src/duckdb/src/transaction/undo_buffer.cpp +4 -5
- package/src/duckdb/src/transaction/undo_buffer_allocator.cpp +0 -1
- package/src/duckdb/src/transaction/wal_write_state.cpp +0 -2
- package/src/duckdb/src/verification/prepared_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/statement_verifier.cpp +5 -10
- package/src/duckdb/third_party/brotli/common/shared_dictionary.cpp +4 -4
- package/src/duckdb/third_party/fmt/include/fmt/core.h +12 -6
- package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +1 -5
- package/src/duckdb/third_party/fmt/include/fmt/format.h +24 -34
- package/src/duckdb/third_party/fmt/include/fmt/printf.h +21 -49
- package/src/duckdb/third_party/httplib/httplib.hpp +5 -13
- package/src/duckdb/third_party/jaro_winkler/details/jaro_impl.hpp +4 -4
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +0 -3
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +1 -56
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +733 -744
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +1 -6
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +18623 -19067
- 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/block_cipher.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/build_info.h +4 -4
- 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/gcm_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/mbedtls_config.h +1 -5
- 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/sha3.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/mbedtls_wrapper.hpp +7 -16
- 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/psa/crypto_config.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/aes.cpp +1 -1
- package/src/duckdb/third_party/mbedtls/library/aesce.h +1 -136
- package/src/duckdb/third_party/mbedtls/library/alignment.h +9 -9
- package/src/duckdb/third_party/mbedtls/library/asn1parse.cpp +1 -1
- package/src/duckdb/third_party/mbedtls/library/asn1write.cpp +3 -6
- package/src/duckdb/third_party/mbedtls/library/base64.cpp +24 -48
- package/src/duckdb/third_party/mbedtls/library/base64_internal.h +1 -45
- package/src/duckdb/third_party/mbedtls/library/bignum.cpp +3 -3
- package/src/duckdb/third_party/mbedtls/library/bignum_core.cpp +14 -16
- package/src/duckdb/third_party/mbedtls/library/bignum_core.h +18 -10
- package/src/duckdb/third_party/mbedtls/library/block_cipher_internal.h +1 -99
- package/src/duckdb/third_party/mbedtls/library/check_crypto_config.h +1 -141
- package/src/duckdb/third_party/mbedtls/library/cipher.cpp +12 -18
- package/src/duckdb/third_party/mbedtls/library/cipher_wrap.cpp +10 -110
- package/src/duckdb/third_party/mbedtls/library/cipher_wrap.h +1 -1
- package/src/duckdb/third_party/mbedtls/library/common.h +4 -20
- package/src/duckdb/third_party/mbedtls/library/constant_time.cpp +1 -1
- package/src/duckdb/third_party/mbedtls/library/constant_time_impl.h +43 -28
- package/src/duckdb/third_party/mbedtls/library/constant_time_internal.h +24 -24
- package/src/duckdb/third_party/mbedtls/library/ctr.h +1 -35
- package/src/duckdb/third_party/mbedtls/library/gcm.cpp +2 -2
- package/src/duckdb/third_party/mbedtls/library/md.cpp +11 -11
- package/src/duckdb/third_party/mbedtls/library/md_psa.h +1 -1
- package/src/duckdb/third_party/mbedtls/library/oid.cpp +2 -2
- package/src/duckdb/third_party/mbedtls/library/pem.cpp +2 -5
- package/src/duckdb/third_party/mbedtls/library/pk.cpp +5 -1
- package/src/duckdb/third_party/mbedtls/library/pk_internal.h +4 -4
- package/src/duckdb/third_party/mbedtls/library/pk_wrap.cpp +18 -16
- package/src/duckdb/third_party/mbedtls/library/pkwrite.h +1 -121
- package/src/duckdb/third_party/mbedtls/library/psa_crypto_core.h +1 -995
- package/src/duckdb/third_party/mbedtls/library/psa_util_internal.h +1 -100
- package/src/duckdb/third_party/mbedtls/library/rsa.cpp +4 -4
- package/src/duckdb/third_party/mbedtls/mbedtls_wrapper.cpp +42 -114
- package/src/duckdb/third_party/parquet/parquet_types.cpp +773 -2344
- package/src/duckdb/third_party/parquet/parquet_types.h +4 -400
- package/src/duckdb/third_party/snappy/snappy-stubs-internal.h +18 -18
- package/src/duckdb/third_party/snappy/snappy.cc +6 -6
- package/src/duckdb/third_party/thrift/thrift/protocol/TCompactProtocol.h +4 -4
- package/src/duckdb/third_party/thrift/thrift/protocol/TCompactProtocol.tcc +36 -36
- package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +1 -1
- package/src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp +1 -1
- package/src/duckdb/ub_extension_core_functions_scalar_generic.cpp +0 -2
- package/src/duckdb/ub_extension_core_functions_scalar_struct.cpp +0 -2
- package/src/duckdb/ub_extension_parquet_reader.cpp +0 -2
- package/src/duckdb/ub_src_common.cpp +0 -8
- package/src/duckdb/ub_src_common_arrow_appender.cpp +0 -2
- package/src/duckdb/ub_src_common_progress_bar.cpp +0 -2
- package/src/duckdb/ub_src_common_tree_renderer.cpp +0 -2
- package/src/duckdb/ub_src_common_types.cpp +1 -1
- package/src/duckdb/ub_src_common_types_row.cpp +0 -2
- package/src/duckdb/ub_src_execution_index_art.cpp +9 -11
- package/src/duckdb/ub_src_execution_operator_persistent.cpp +0 -2
- package/src/duckdb/ub_src_execution_physical_plan.cpp +0 -2
- package/src/duckdb/ub_src_function.cpp +0 -2
- package/src/duckdb/ub_src_function_cast.cpp +1 -1
- package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -2
- package/src/duckdb/ub_src_function_table.cpp +0 -2
- package/src/duckdb/ub_src_function_table_system.cpp +0 -4
- package/src/duckdb/ub_src_main.cpp +0 -4
- package/src/duckdb/ub_src_main_capi.cpp +0 -4
- package/src/duckdb/ub_src_optimizer.cpp +0 -2
- package/src/duckdb/ub_src_optimizer_pushdown.cpp +0 -2
- package/src/duckdb/ub_src_optimizer_rule.cpp +0 -2
- package/src/duckdb/ub_src_parser_statement.cpp +0 -2
- package/src/duckdb/ub_src_parser_tableref.cpp +0 -2
- package/src/duckdb/ub_src_parser_transform_statement.cpp +0 -2
- package/src/duckdb/ub_src_planner.cpp +0 -2
- package/src/duckdb/ub_src_planner_binder_statement.cpp +0 -2
- package/src/duckdb/ub_src_planner_binder_tableref.cpp +0 -2
- package/src/duckdb/ub_src_planner_expression_binder.cpp +0 -2
- package/src/duckdb/ub_src_planner_operator.cpp +0 -2
- package/src/duckdb/ub_src_storage_table.cpp +0 -4
- package/test/columns.test.ts +1 -1
- package/test/exec.test.ts +3 -3
- package/test/jsdoc.test.ts +1 -2
- package/test/syntax_error.test.ts +1 -1
- package/test/test_all_types.test.ts +1 -1
- package/src/duckdb/extension/core_functions/scalar/generic/replace_type.cpp +0 -34
- package/src/duckdb/extension/core_functions/scalar/struct/struct_update.cpp +0 -161
- package/src/duckdb/extension/parquet/include/reader/variant/variant_binary_decoder.hpp +0 -150
- package/src/duckdb/extension/parquet/include/reader/variant/variant_shredded_conversion.hpp +0 -23
- package/src/duckdb/extension/parquet/include/reader/variant/variant_value.hpp +0 -54
- package/src/duckdb/extension/parquet/include/reader/variant_column_reader.hpp +0 -44
- package/src/duckdb/extension/parquet/reader/variant/variant_binary_decoder.cpp +0 -367
- package/src/duckdb/extension/parquet/reader/variant/variant_shredded_conversion.cpp +0 -565
- package/src/duckdb/extension/parquet/reader/variant/variant_value.cpp +0 -85
- package/src/duckdb/extension/parquet/reader/variant_column_reader.cpp +0 -161
- package/src/duckdb/src/common/arrow/appender/append_data.cpp +0 -29
- package/src/duckdb/src/common/bignum.cpp +0 -362
- package/src/duckdb/src/common/csv_writer.cpp +0 -381
- package/src/duckdb/src/common/encryption_functions.cpp +0 -228
- package/src/duckdb/src/common/encryption_key_manager.cpp +0 -143
- package/src/duckdb/src/common/progress_bar/unscented_kalman_filter.cpp +0 -288
- package/src/duckdb/src/common/sorting/hashed_sort.cpp +0 -724
- package/src/duckdb/src/common/sorting/sort.cpp +0 -513
- package/src/duckdb/src/common/sorting/sorted_run.cpp +0 -341
- package/src/duckdb/src/common/sorting/sorted_run_merger.cpp +0 -969
- package/src/duckdb/src/common/tree_renderer/yaml_tree_renderer.cpp +0 -144
- package/src/duckdb/src/common/types/bignum.cpp +0 -350
- package/src/duckdb/src/common/types/row/block_iterator.cpp +0 -34
- package/src/duckdb/src/execution/index/art/art_builder.cpp +0 -91
- package/src/duckdb/src/execution/operator/persistent/physical_merge_into.cpp +0 -516
- package/src/duckdb/src/execution/physical_plan/plan_merge_into.cpp +0 -132
- package/src/duckdb/src/function/cast/bignum_casts.cpp +0 -315
- package/src/duckdb/src/function/cast/variant/from_variant.cpp +0 -697
- package/src/duckdb/src/function/cast/variant/to_json.cpp +0 -272
- package/src/duckdb/src/function/cast/variant/to_variant.cpp +0 -193
- package/src/duckdb/src/function/copy_blob.cpp +0 -157
- package/src/duckdb/src/function/scalar/struct/struct_contains.cpp +0 -255
- package/src/duckdb/src/function/scalar/variant/variant_extract.cpp +0 -234
- package/src/duckdb/src/function/scalar/variant/variant_typeof.cpp +0 -70
- package/src/duckdb/src/function/scalar/variant/variant_utils.cpp +0 -412
- package/src/duckdb/src/function/table/direct_file_reader.cpp +0 -172
- package/src/duckdb/src/function/table/system/duckdb_approx_database_count.cpp +0 -43
- package/src/duckdb/src/function/table/system/logging_utils.cpp +0 -154
- package/src/duckdb/src/include/duckdb/common/arena_linked_list.hpp +0 -169
- package/src/duckdb/src/include/duckdb/common/bignum.hpp +0 -85
- package/src/duckdb/src/include/duckdb/common/csv_writer.hpp +0 -153
- package/src/duckdb/src/include/duckdb/common/encryption_functions.hpp +0 -54
- package/src/duckdb/src/include/duckdb/common/encryption_key_manager.hpp +0 -80
- package/src/duckdb/src/include/duckdb/common/enums/arrow_format_version.hpp +0 -33
- package/src/duckdb/src/include/duckdb/common/enums/checkpoint_abort.hpp +0 -22
- package/src/duckdb/src/include/duckdb/common/enums/copy_option_mode.hpp +0 -17
- package/src/duckdb/src/include/duckdb/common/enums/merge_action_type.hpp +0 -19
- package/src/duckdb/src/include/duckdb/common/enums/ordinality_request_type.hpp +0 -16
- package/src/duckdb/src/include/duckdb/common/enums/thread_pin_mode.hpp +0 -17
- package/src/duckdb/src/include/duckdb/common/enums/tuple_data_layout_enums.hpp +0 -25
- package/src/duckdb/src/include/duckdb/common/operator/interpolate.hpp +0 -39
- package/src/duckdb/src/include/duckdb/common/progress_bar/unscented_kalman_filter.hpp +0 -65
- package/src/duckdb/src/include/duckdb/common/serializer/varint.hpp +0 -62
- package/src/duckdb/src/include/duckdb/common/sorting/hashed_sort.hpp +0 -76
- package/src/duckdb/src/include/duckdb/common/sorting/sort.hpp +0 -85
- package/src/duckdb/src/include/duckdb/common/sorting/sort_key.hpp +0 -442
- package/src/duckdb/src/include/duckdb/common/sorting/sort_projection_column.hpp +0 -21
- package/src/duckdb/src/include/duckdb/common/sorting/sorted_run.hpp +0 -55
- package/src/duckdb/src/include/duckdb/common/sorting/sorted_run_merger.hpp +0 -62
- package/src/duckdb/src/include/duckdb/common/tree_renderer/yaml_tree_renderer.hpp +0 -40
- package/src/duckdb/src/include/duckdb/common/types/bignum.hpp +0 -159
- package/src/duckdb/src/include/duckdb/common/types/double_na_equal.hpp +0 -65
- package/src/duckdb/src/include/duckdb/common/types/row/block_iterator.hpp +0 -360
- package/src/duckdb/src/include/duckdb/common/types/string.hpp +0 -338
- package/src/duckdb/src/include/duckdb/common/types/variant.hpp +0 -202
- package/src/duckdb/src/include/duckdb/execution/index/art/art_builder.hpp +0 -55
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_merge_into.hpp +0 -87
- package/src/duckdb/src/include/duckdb/function/cast/variant/array_to_variant.hpp +0 -66
- package/src/duckdb/src/include/duckdb/function/cast/variant/json_to_variant.hpp +0 -283
- package/src/duckdb/src/include/duckdb/function/cast/variant/list_to_variant.hpp +0 -70
- package/src/duckdb/src/include/duckdb/function/cast/variant/primitive_to_variant.hpp +0 -399
- package/src/duckdb/src/include/duckdb/function/cast/variant/struct_to_variant.hpp +0 -111
- package/src/duckdb/src/include/duckdb/function/cast/variant/to_variant.hpp +0 -66
- package/src/duckdb/src/include/duckdb/function/cast/variant/to_variant_fwd.hpp +0 -179
- package/src/duckdb/src/include/duckdb/function/cast/variant/union_to_variant.hpp +0 -59
- package/src/duckdb/src/include/duckdb/function/cast/variant/variant_to_variant.hpp +0 -275
- package/src/duckdb/src/include/duckdb/function/scalar/variant_functions.hpp +0 -38
- package/src/duckdb/src/include/duckdb/function/scalar/variant_utils.hpp +0 -85
- package/src/duckdb/src/include/duckdb/function/table/direct_file_reader.hpp +0 -39
- package/src/duckdb/src/include/duckdb/function/table/read_file.hpp +0 -83
- package/src/duckdb/src/include/duckdb/main/database_file_path_manager.hpp +0 -39
- package/src/duckdb/src/include/duckdb/main/extension/extension_loader.hpp +0 -120
- package/src/duckdb/src/include/duckdb/main/extension_manager.hpp +0 -59
- package/src/duckdb/src/include/duckdb/main/setting_info.hpp +0 -109
- package/src/duckdb/src/include/duckdb/optimizer/cte_inlining.hpp +0 -50
- package/src/duckdb/src/include/duckdb/optimizer/rule/date_trunc_simplification.hpp +0 -73
- package/src/duckdb/src/include/duckdb/parser/statement/merge_into_statement.hpp +0 -72
- package/src/duckdb/src/include/duckdb/parser/tableref/bound_ref_wrapper.hpp +0 -38
- package/src/duckdb/src/include/duckdb/planner/expression_binder/projection_binder.hpp +0 -37
- package/src/duckdb/src/include/duckdb/planner/logical_operator_deep_copy.hpp +0 -67
- package/src/duckdb/src/include/duckdb/planner/operator/logical_merge_into.hpp +0 -75
- package/src/duckdb/src/include/duckdb/storage/table/in_memory_checkpoint.hpp +0 -93
- package/src/duckdb/src/include/duckdb/storage/table/row_id_column_data.hpp +0 -68
- package/src/duckdb/src/include/duckdb/verification/explain_statement_verifier.hpp +0 -23
- package/src/duckdb/src/main/capi/error_data-c.cpp +0 -46
- package/src/duckdb/src/main/capi/expression-c.cpp +0 -57
- package/src/duckdb/src/main/database_file_path_manager.cpp +0 -42
- package/src/duckdb/src/main/extension/extension_loader.cpp +0 -234
- package/src/duckdb/src/main/extension_manager.cpp +0 -115
- package/src/duckdb/src/optimizer/cte_inlining.cpp +0 -225
- package/src/duckdb/src/optimizer/pushdown/pushdown_outer_join.cpp +0 -201
- package/src/duckdb/src/optimizer/rule/date_trunc_simplification.cpp +0 -446
- package/src/duckdb/src/parser/statement/merge_into_statement.cpp +0 -167
- package/src/duckdb/src/parser/tableref/bound_ref_wrapper.cpp +0 -29
- package/src/duckdb/src/parser/transform/statement/transform_merge_into.cpp +0 -111
- package/src/duckdb/src/planner/binder/statement/bind_merge_into.cpp +0 -335
- package/src/duckdb/src/planner/binder/tableref/bind_bound_table_ref.cpp +0 -13
- package/src/duckdb/src/planner/expression_binder/projection_binder.cpp +0 -46
- package/src/duckdb/src/planner/logical_operator_deep_copy.cpp +0 -264
- package/src/duckdb/src/planner/operator/logical_merge_into.cpp +0 -43
- package/src/duckdb/src/storage/table/in_memory_checkpoint.cpp +0 -136
- package/src/duckdb/src/storage/table/row_id_column_data.cpp +0 -173
- package/src/duckdb/src/verification/explain_statement_verifier.cpp +0 -16
- package/src/duckdb/third_party/mbedtls/include/psa/build_info.h +0 -20
- package/src/duckdb/third_party/mbedtls/include/psa/crypto_se_driver.h +0 -1
- package/src/duckdb/third_party/mbedtls/library/cipher_invasive.h +0 -1
- package/src/duckdb/third_party/pdqsort/pdqsort.h +0 -550
- package/src/duckdb/third_party/ska_sort/ska_sort.hpp +0 -1494
- package/src/duckdb/third_party/vergesort/detail/insertion_sort.h +0 -56
- package/src/duckdb/third_party/vergesort/detail/is_sorted_until.h +0 -51
- package/src/duckdb/third_party/vergesort/detail/iter_sort3.h +0 -48
- package/src/duckdb/third_party/vergesort/detail/log2.h +0 -41
- package/src/duckdb/third_party/vergesort/detail/prevnext.h +0 -68
- package/src/duckdb/third_party/vergesort/detail/quicksort.h +0 -138
- package/src/duckdb/third_party/vergesort/vergesort.h +0 -352
- package/src/duckdb/ub_extension_parquet_reader_variant.cpp +0 -6
- package/src/duckdb/ub_src_common_sorting.cpp +0 -8
- package/src/duckdb/ub_src_function_cast_variant.cpp +0 -6
- package/src/duckdb/ub_src_function_scalar_variant.cpp +0 -6
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
#include "duckdb/common/operator/decimal_cast_operators.hpp"
|
|
2
|
+
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
|
3
|
+
#include "duckdb/common/algorithm.hpp"
|
|
2
4
|
#include "duckdb/common/likely.hpp"
|
|
3
5
|
#include "duckdb/common/operator/abs.hpp"
|
|
4
6
|
#include "duckdb/common/operator/multiply.hpp"
|
|
7
|
+
#include "duckdb/common/operator/numeric_binary_operators.hpp"
|
|
5
8
|
#include "duckdb/common/types/bit.hpp"
|
|
6
9
|
#include "duckdb/common/types/cast_helpers.hpp"
|
|
7
10
|
#include "duckdb/common/types/hugeint.hpp"
|
|
11
|
+
#include "duckdb/common/types/uhugeint.hpp"
|
|
12
|
+
#include "duckdb/common/types/validity_mask.hpp"
|
|
13
|
+
#include "duckdb/common/types/vector.hpp"
|
|
8
14
|
#include "duckdb/common/vector_operations/unary_executor.hpp"
|
|
9
15
|
#include "core_functions/scalar/math_functions.hpp"
|
|
10
16
|
#include "duckdb/execution/expression_executor.hpp"
|
|
@@ -12,6 +18,9 @@
|
|
|
12
18
|
|
|
13
19
|
#include <cmath>
|
|
14
20
|
#include <cstdint>
|
|
21
|
+
#include <errno.h>
|
|
22
|
+
#include <limits>
|
|
23
|
+
#include <type_traits>
|
|
15
24
|
|
|
16
25
|
namespace duckdb {
|
|
17
26
|
|
|
@@ -43,9 +52,6 @@ static scalar_function_t GetScalarIntegerUnaryFunctionFixedReturn(const LogicalT
|
|
|
43
52
|
//===--------------------------------------------------------------------===//
|
|
44
53
|
// nextafter
|
|
45
54
|
//===--------------------------------------------------------------------===//
|
|
46
|
-
|
|
47
|
-
namespace {
|
|
48
|
-
|
|
49
55
|
struct NextAfterOperator {
|
|
50
56
|
template <class TA, class TB, class TR>
|
|
51
57
|
static inline TR Operation(TA base, TB exponent) {
|
|
@@ -62,8 +68,6 @@ struct NextAfterOperator {
|
|
|
62
68
|
}
|
|
63
69
|
};
|
|
64
70
|
|
|
65
|
-
} // namespace
|
|
66
|
-
|
|
67
71
|
ScalarFunctionSet NextAfterFun::GetFunctions() {
|
|
68
72
|
ScalarFunctionSet next_after_fun;
|
|
69
73
|
next_after_fun.AddFunction(
|
|
@@ -200,9 +204,6 @@ ScalarFunctionSet AbsOperatorFun::GetFunctions() {
|
|
|
200
204
|
//===--------------------------------------------------------------------===//
|
|
201
205
|
// bit_count
|
|
202
206
|
//===--------------------------------------------------------------------===//
|
|
203
|
-
|
|
204
|
-
namespace {
|
|
205
|
-
|
|
206
207
|
struct BitCntOperator {
|
|
207
208
|
template <class TA, class TR>
|
|
208
209
|
static inline TR Operation(TA input) {
|
|
@@ -235,11 +236,10 @@ struct BitStringBitCntOperator {
|
|
|
235
236
|
template <class TA, class TR>
|
|
236
237
|
static inline TR Operation(TA input) {
|
|
237
238
|
TR count = Bit::BitCount(input);
|
|
238
|
-
return
|
|
239
|
+
return count;
|
|
239
240
|
}
|
|
240
241
|
};
|
|
241
242
|
|
|
242
|
-
} // namespace
|
|
243
243
|
ScalarFunctionSet BitCountFun::GetFunctions() {
|
|
244
244
|
ScalarFunctionSet functions;
|
|
245
245
|
functions.AddFunction(ScalarFunction({LogicalType::TINYINT}, LogicalType::TINYINT,
|
|
@@ -253,15 +253,13 @@ ScalarFunctionSet BitCountFun::GetFunctions() {
|
|
|
253
253
|
functions.AddFunction(ScalarFunction({LogicalType::HUGEINT}, LogicalType::TINYINT,
|
|
254
254
|
ScalarFunction::UnaryFunction<hugeint_t, int8_t, HugeIntBitCntOperator>));
|
|
255
255
|
functions.AddFunction(ScalarFunction({LogicalType::BIT}, LogicalType::BIGINT,
|
|
256
|
-
ScalarFunction::UnaryFunction<string_t,
|
|
256
|
+
ScalarFunction::UnaryFunction<string_t, idx_t, BitStringBitCntOperator>));
|
|
257
257
|
return functions;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
//===--------------------------------------------------------------------===//
|
|
261
261
|
// sign
|
|
262
262
|
//===--------------------------------------------------------------------===//
|
|
263
|
-
namespace {
|
|
264
|
-
|
|
265
263
|
struct SignOperator {
|
|
266
264
|
template <class TA, class TR>
|
|
267
265
|
static TR Operation(TA input) {
|
|
@@ -297,7 +295,6 @@ int8_t SignOperator::Operation(double input) {
|
|
|
297
295
|
}
|
|
298
296
|
}
|
|
299
297
|
|
|
300
|
-
} // namespace
|
|
301
298
|
ScalarFunctionSet SignFun::GetFunctions() {
|
|
302
299
|
ScalarFunctionSet sign;
|
|
303
300
|
for (auto &type : LogicalType::Numeric()) {
|
|
@@ -315,14 +312,12 @@ ScalarFunctionSet SignFun::GetFunctions() {
|
|
|
315
312
|
//===--------------------------------------------------------------------===//
|
|
316
313
|
// ceil
|
|
317
314
|
//===--------------------------------------------------------------------===//
|
|
318
|
-
namespace {
|
|
319
315
|
struct CeilOperator {
|
|
320
316
|
template <class TA, class TR>
|
|
321
317
|
static inline TR Operation(TA left) {
|
|
322
318
|
return std::ceil(left);
|
|
323
319
|
}
|
|
324
320
|
};
|
|
325
|
-
} // namespace
|
|
326
321
|
|
|
327
322
|
template <class T, class POWERS_OF_TEN, class OP>
|
|
328
323
|
static void GenericRoundFunctionDecimal(DataChunk &input, ExpressionState &state, Vector &result) {
|
|
@@ -331,8 +326,8 @@ static void GenericRoundFunctionDecimal(DataChunk &input, ExpressionState &state
|
|
|
331
326
|
}
|
|
332
327
|
|
|
333
328
|
template <class OP>
|
|
334
|
-
|
|
335
|
-
|
|
329
|
+
unique_ptr<FunctionData> BindGenericRoundFunctionDecimal(ClientContext &context, ScalarFunction &bound_function,
|
|
330
|
+
vector<unique_ptr<Expression>> &arguments) {
|
|
336
331
|
// ceil essentially removes the scale
|
|
337
332
|
auto &decimal_type = arguments[0]->return_type;
|
|
338
333
|
auto scale = DecimalType::GetScale(decimal_type);
|
|
@@ -360,7 +355,6 @@ static unique_ptr<FunctionData> BindGenericRoundFunctionDecimal(ClientContext &c
|
|
|
360
355
|
return nullptr;
|
|
361
356
|
}
|
|
362
357
|
|
|
363
|
-
namespace {
|
|
364
358
|
struct CeilDecimalOperator {
|
|
365
359
|
template <class T, class POWERS_OF_TEN_CLASS>
|
|
366
360
|
static void Operation(DataChunk &input, uint8_t scale, Vector &result) {
|
|
@@ -376,7 +370,6 @@ struct CeilDecimalOperator {
|
|
|
376
370
|
});
|
|
377
371
|
}
|
|
378
372
|
};
|
|
379
|
-
} // namespace
|
|
380
373
|
|
|
381
374
|
ScalarFunctionSet CeilFun::GetFunctions() {
|
|
382
375
|
ScalarFunctionSet ceil;
|
|
@@ -408,7 +401,6 @@ ScalarFunctionSet CeilFun::GetFunctions() {
|
|
|
408
401
|
//===--------------------------------------------------------------------===//
|
|
409
402
|
// floor
|
|
410
403
|
//===--------------------------------------------------------------------===//
|
|
411
|
-
namespace {
|
|
412
404
|
struct FloorOperator {
|
|
413
405
|
template <class TA, class TR>
|
|
414
406
|
static inline TR Operation(TA left) {
|
|
@@ -431,7 +423,6 @@ struct FloorDecimalOperator {
|
|
|
431
423
|
});
|
|
432
424
|
}
|
|
433
425
|
};
|
|
434
|
-
} // namespace
|
|
435
426
|
|
|
436
427
|
ScalarFunctionSet FloorFun::GetFunctions() {
|
|
437
428
|
ScalarFunctionSet floor;
|
|
@@ -463,118 +454,6 @@ ScalarFunctionSet FloorFun::GetFunctions() {
|
|
|
463
454
|
//===--------------------------------------------------------------------===//
|
|
464
455
|
// trunc
|
|
465
456
|
//===--------------------------------------------------------------------===//
|
|
466
|
-
namespace {
|
|
467
|
-
|
|
468
|
-
struct RoundPrecisionFunctionData : public FunctionData {
|
|
469
|
-
explicit RoundPrecisionFunctionData(int32_t target_scale) : target_scale(target_scale) {
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
int32_t target_scale;
|
|
473
|
-
|
|
474
|
-
unique_ptr<FunctionData> Copy() const override {
|
|
475
|
-
return make_uniq<RoundPrecisionFunctionData>(target_scale);
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
bool Equals(const FunctionData &other_p) const override {
|
|
479
|
-
auto &other = other_p.Cast<RoundPrecisionFunctionData>();
|
|
480
|
-
return target_scale == other.target_scale;
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
template <class T, class POWERS_OF_TEN, class OP>
|
|
485
|
-
static void GenericRoundPrecisionDecimal(DataChunk &input, ExpressionState &state, Vector &result) {
|
|
486
|
-
OP::template Operation<T, POWERS_OF_TEN>(input, state, result);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
template <typename NEGOP, typename POSOP>
|
|
490
|
-
static unique_ptr<FunctionData> BindDecimalRoundPrecision(ClientContext &context, ScalarFunction &bound_function,
|
|
491
|
-
vector<unique_ptr<Expression>> &arguments) {
|
|
492
|
-
auto &decimal_type = arguments[0]->return_type;
|
|
493
|
-
if (arguments[1]->HasParameter()) {
|
|
494
|
-
throw ParameterNotResolvedException();
|
|
495
|
-
}
|
|
496
|
-
auto fname = StringUtil::Upper(bound_function.name);
|
|
497
|
-
if (!arguments[1]->IsFoldable()) {
|
|
498
|
-
throw NotImplementedException("%s(DECIMAL, INTEGER) with non-constant precision is not supported", fname);
|
|
499
|
-
}
|
|
500
|
-
Value val = ExpressionExecutor::EvaluateScalar(context, *arguments[1]).DefaultCastAs(LogicalType::INTEGER);
|
|
501
|
-
if (val.IsNull()) {
|
|
502
|
-
throw NotImplementedException("%s(DECIMAL, INTEGER) with non-constant precision is not supported", fname);
|
|
503
|
-
}
|
|
504
|
-
// our new precision becomes the round value
|
|
505
|
-
// e.g. ROUND(DECIMAL(18,3), 1) -> DECIMAL(18,1)
|
|
506
|
-
// but ONLY if the round value is positive
|
|
507
|
-
// if it is negative the scale becomes zero
|
|
508
|
-
// i.e. ROUND(DECIMAL(18,3), -1) -> DECIMAL(18,0)
|
|
509
|
-
int32_t round_value = IntegerValue::Get(val);
|
|
510
|
-
uint8_t target_scale;
|
|
511
|
-
auto width = DecimalType::GetWidth(decimal_type);
|
|
512
|
-
auto scale = DecimalType::GetScale(decimal_type);
|
|
513
|
-
if (round_value < 0) {
|
|
514
|
-
target_scale = 0;
|
|
515
|
-
switch (decimal_type.InternalType()) {
|
|
516
|
-
case PhysicalType::INT16:
|
|
517
|
-
bound_function.function = GenericRoundPrecisionDecimal<int16_t, NumericHelper, NEGOP>;
|
|
518
|
-
break;
|
|
519
|
-
case PhysicalType::INT32:
|
|
520
|
-
bound_function.function = GenericRoundPrecisionDecimal<int32_t, NumericHelper, NEGOP>;
|
|
521
|
-
break;
|
|
522
|
-
case PhysicalType::INT64:
|
|
523
|
-
bound_function.function = GenericRoundPrecisionDecimal<int64_t, NumericHelper, NEGOP>;
|
|
524
|
-
break;
|
|
525
|
-
default:
|
|
526
|
-
bound_function.function = GenericRoundPrecisionDecimal<hugeint_t, Hugeint, NEGOP>;
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
} else {
|
|
530
|
-
if (round_value >= (int32_t)scale) {
|
|
531
|
-
// if round_value is bigger than or equal to scale we do nothing
|
|
532
|
-
bound_function.function = ScalarFunction::NopFunction;
|
|
533
|
-
target_scale = scale;
|
|
534
|
-
} else {
|
|
535
|
-
target_scale = NumericCast<uint8_t>(round_value);
|
|
536
|
-
switch (decimal_type.InternalType()) {
|
|
537
|
-
case PhysicalType::INT16:
|
|
538
|
-
bound_function.function = GenericRoundPrecisionDecimal<int16_t, NumericHelper, POSOP>;
|
|
539
|
-
break;
|
|
540
|
-
case PhysicalType::INT32:
|
|
541
|
-
bound_function.function = GenericRoundPrecisionDecimal<int32_t, NumericHelper, POSOP>;
|
|
542
|
-
break;
|
|
543
|
-
case PhysicalType::INT64:
|
|
544
|
-
bound_function.function = GenericRoundPrecisionDecimal<int64_t, NumericHelper, POSOP>;
|
|
545
|
-
break;
|
|
546
|
-
default:
|
|
547
|
-
bound_function.function = GenericRoundPrecisionDecimal<hugeint_t, Hugeint, POSOP>;
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
bound_function.arguments[0] = decimal_type;
|
|
553
|
-
bound_function.return_type = LogicalType::DECIMAL(width, target_scale);
|
|
554
|
-
return make_uniq<RoundPrecisionFunctionData>(round_value);
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
struct TruncOperatorPrecision {
|
|
558
|
-
template <class TA, class TB, class TR>
|
|
559
|
-
static inline TR Operation(TA input, TB precision) {
|
|
560
|
-
double trunc_value;
|
|
561
|
-
if (precision < 0) {
|
|
562
|
-
double modifier = std::pow(10, -TA(precision));
|
|
563
|
-
trunc_value = (std::trunc(input / modifier)) * modifier;
|
|
564
|
-
if (std::isinf(trunc_value) || std::isnan(trunc_value)) {
|
|
565
|
-
return input;
|
|
566
|
-
}
|
|
567
|
-
} else {
|
|
568
|
-
double modifier = std::pow(10, TA(precision));
|
|
569
|
-
trunc_value = (std::trunc(input * modifier)) / modifier;
|
|
570
|
-
if (std::isinf(trunc_value) || std::isnan(trunc_value)) {
|
|
571
|
-
return input;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
return LossyNumericCast<TR>(trunc_value);
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
|
|
578
457
|
struct TruncOperator {
|
|
579
458
|
// Integer truncation is a NOP
|
|
580
459
|
template <class TA, class TR>
|
|
@@ -594,134 +473,38 @@ struct TruncDecimalOperator {
|
|
|
594
473
|
}
|
|
595
474
|
};
|
|
596
475
|
|
|
597
|
-
struct TruncDecimalNegativePrecisionOperator {
|
|
598
|
-
template <class T, class POWERS_OF_TEN_CLASS>
|
|
599
|
-
static void Operation(DataChunk &input, ExpressionState &state, Vector &result) {
|
|
600
|
-
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
|
601
|
-
auto &info = func_expr.bind_info->Cast<RoundPrecisionFunctionData>();
|
|
602
|
-
auto source_scale = DecimalType::GetScale(func_expr.children[0]->return_type);
|
|
603
|
-
auto width = DecimalType::GetWidth(func_expr.children[0]->return_type);
|
|
604
|
-
if (info.target_scale <= -int32_t(width - source_scale)) {
|
|
605
|
-
// scale too big for width
|
|
606
|
-
result.SetVectorType(VectorType::CONSTANT_VECTOR);
|
|
607
|
-
result.SetValue(0, Value::INTEGER(0));
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
T divide_power_of_ten =
|
|
611
|
-
UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[-info.target_scale + source_scale]);
|
|
612
|
-
T multiply_power_of_ten = UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[-info.target_scale]);
|
|
613
|
-
|
|
614
|
-
UnaryExecutor::Execute<T, T>(input.data[0], result, input.size(), [&](T input) {
|
|
615
|
-
return UnsafeNumericCast<T>(input / divide_power_of_ten * multiply_power_of_ten);
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
struct TruncDecimalPositivePrecisionOperator {
|
|
621
|
-
template <class T, class POWERS_OF_TEN_CLASS>
|
|
622
|
-
static void Operation(DataChunk &input, ExpressionState &state, Vector &result) {
|
|
623
|
-
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
|
624
|
-
auto &info = func_expr.bind_info->Cast<RoundPrecisionFunctionData>();
|
|
625
|
-
auto source_scale = DecimalType::GetScale(func_expr.children[0]->return_type);
|
|
626
|
-
T power_of_ten = UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[source_scale - info.target_scale]);
|
|
627
|
-
UnaryExecutor::Execute<T, T>(input.data[0], result, input.size(),
|
|
628
|
-
[&](T input) { return UnsafeNumericCast<T>(input / power_of_ten); });
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
struct TruncIntegerOperator {
|
|
633
|
-
template <class TA, class TB, class TR>
|
|
634
|
-
static inline TR Operation(TA input, TB precision) {
|
|
635
|
-
if (precision < 0) {
|
|
636
|
-
// Do all the arithmetic at higher precision
|
|
637
|
-
using POWERS_OF_TEN_CLASS = typename DecimalCastTraits<TA>::POWERS_OF_TEN_CLASS;
|
|
638
|
-
if (precision <= -POWERS_OF_TEN_CLASS::CACHED_POWERS_OF_TEN) {
|
|
639
|
-
return 0;
|
|
640
|
-
}
|
|
641
|
-
const auto power_of_ten = POWERS_OF_TEN_CLASS::POWERS_OF_TEN[-precision];
|
|
642
|
-
auto result = input;
|
|
643
|
-
result /= power_of_ten;
|
|
644
|
-
if (result) {
|
|
645
|
-
return UnsafeNumericCast<TR>(result * power_of_ten);
|
|
646
|
-
} else {
|
|
647
|
-
return 0;
|
|
648
|
-
}
|
|
649
|
-
} else {
|
|
650
|
-
// Truncating integers to higher precision is a NOP
|
|
651
|
-
return input;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
} // namespace
|
|
657
|
-
|
|
658
476
|
ScalarFunctionSet TruncFun::GetFunctions() {
|
|
659
477
|
ScalarFunctionSet trunc;
|
|
660
478
|
for (auto &type : LogicalType::Numeric()) {
|
|
661
|
-
scalar_function_t
|
|
662
|
-
scalar_function_t trunc_prec_func = nullptr;
|
|
479
|
+
scalar_function_t func = nullptr;
|
|
663
480
|
bind_scalar_function_t bind_func = nullptr;
|
|
664
|
-
bind_scalar_function_t bind_prec_func = nullptr;
|
|
665
481
|
// Truncation of integers gets generated by some tools (e.g., Tableau/JDBC:Postgres)
|
|
666
482
|
switch (type.id()) {
|
|
667
483
|
case LogicalTypeId::FLOAT:
|
|
668
|
-
|
|
669
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<float, int32_t, float, TruncOperatorPrecision>;
|
|
484
|
+
func = ScalarFunction::UnaryFunction<float, float, TruncOperator>;
|
|
670
485
|
break;
|
|
671
486
|
case LogicalTypeId::DOUBLE:
|
|
672
|
-
|
|
673
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<double, int32_t, double, TruncOperatorPrecision>;
|
|
487
|
+
func = ScalarFunction::UnaryFunction<double, double, TruncOperator>;
|
|
674
488
|
break;
|
|
675
489
|
case LogicalTypeId::DECIMAL:
|
|
676
490
|
bind_func = BindGenericRoundFunctionDecimal<TruncDecimalOperator>;
|
|
677
|
-
bind_prec_func =
|
|
678
|
-
BindDecimalRoundPrecision<TruncDecimalNegativePrecisionOperator, TruncDecimalPositivePrecisionOperator>;
|
|
679
491
|
break;
|
|
680
492
|
case LogicalTypeId::TINYINT:
|
|
681
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
682
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<int8_t, int32_t, int8_t, TruncIntegerOperator>;
|
|
683
|
-
break;
|
|
684
493
|
case LogicalTypeId::SMALLINT:
|
|
685
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
686
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<int16_t, int32_t, int16_t, TruncIntegerOperator>;
|
|
687
|
-
break;
|
|
688
494
|
case LogicalTypeId::INTEGER:
|
|
689
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
690
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<int32_t, int32_t, int32_t, TruncIntegerOperator>;
|
|
691
|
-
break;
|
|
692
495
|
case LogicalTypeId::BIGINT:
|
|
693
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
694
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<int64_t, int32_t, int64_t, TruncIntegerOperator>;
|
|
695
|
-
break;
|
|
696
496
|
case LogicalTypeId::HUGEINT:
|
|
697
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
698
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<hugeint_t, int32_t, hugeint_t, TruncIntegerOperator>;
|
|
699
|
-
break;
|
|
700
497
|
case LogicalTypeId::UTINYINT:
|
|
701
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
702
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<uint8_t, int32_t, uint8_t, TruncIntegerOperator>;
|
|
703
|
-
break;
|
|
704
498
|
case LogicalTypeId::USMALLINT:
|
|
705
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
706
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<uint16_t, int32_t, uint16_t, TruncIntegerOperator>;
|
|
707
|
-
break;
|
|
708
499
|
case LogicalTypeId::UINTEGER:
|
|
709
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
710
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<uint32_t, int32_t, uint32_t, TruncIntegerOperator>;
|
|
711
|
-
break;
|
|
712
500
|
case LogicalTypeId::UBIGINT:
|
|
713
|
-
trunc_func = ScalarFunction::NopFunction;
|
|
714
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<uint64_t, int32_t, uint64_t, TruncIntegerOperator>;
|
|
715
|
-
break;
|
|
716
501
|
case LogicalTypeId::UHUGEINT:
|
|
717
|
-
|
|
718
|
-
trunc_prec_func = ScalarFunction::BinaryFunction<uhugeint_t, int32_t, uhugeint_t, TruncIntegerOperator>;
|
|
502
|
+
func = ScalarFunction::NopFunction;
|
|
719
503
|
break;
|
|
720
504
|
default:
|
|
721
505
|
throw InternalException("Unimplemented numeric type for function \"trunc\"");
|
|
722
506
|
}
|
|
723
|
-
trunc.AddFunction(ScalarFunction({type}, type,
|
|
724
|
-
trunc.AddFunction(ScalarFunction({type, LogicalType::INTEGER}, type, trunc_prec_func, bind_prec_func));
|
|
507
|
+
trunc.AddFunction(ScalarFunction({type}, type, func, bind_func));
|
|
725
508
|
}
|
|
726
509
|
return trunc;
|
|
727
510
|
}
|
|
@@ -729,7 +512,6 @@ ScalarFunctionSet TruncFun::GetFunctions() {
|
|
|
729
512
|
//===--------------------------------------------------------------------===//
|
|
730
513
|
// round
|
|
731
514
|
//===--------------------------------------------------------------------===//
|
|
732
|
-
namespace {
|
|
733
515
|
struct RoundOperatorPrecision {
|
|
734
516
|
template <class TA, class TB, class TR>
|
|
735
517
|
static inline TR Operation(TA input, TB precision) {
|
|
@@ -813,55 +595,130 @@ struct RoundIntegerOperator {
|
|
|
813
595
|
}
|
|
814
596
|
};
|
|
815
597
|
|
|
816
|
-
|
|
598
|
+
struct RoundPrecisionFunctionData : public FunctionData {
|
|
599
|
+
explicit RoundPrecisionFunctionData(int32_t target_scale) : target_scale(target_scale) {
|
|
600
|
+
}
|
|
817
601
|
|
|
818
|
-
|
|
819
|
-
template <class T, class POWERS_OF_TEN_CLASS>
|
|
820
|
-
static void Operation(DataChunk &input, ExpressionState &state, Vector &result) {
|
|
821
|
-
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
|
822
|
-
auto &info = func_expr.bind_info->Cast<RoundPrecisionFunctionData>();
|
|
823
|
-
auto source_scale = DecimalType::GetScale(func_expr.children[0]->return_type);
|
|
824
|
-
auto width = DecimalType::GetWidth(func_expr.children[0]->return_type);
|
|
825
|
-
if (info.target_scale <= -int32_t(width - source_scale)) {
|
|
826
|
-
// scale too big for width
|
|
827
|
-
result.SetVectorType(VectorType::CONSTANT_VECTOR);
|
|
828
|
-
result.SetValue(0, Value::INTEGER(0));
|
|
829
|
-
return;
|
|
830
|
-
}
|
|
831
|
-
T divide_power_of_ten =
|
|
832
|
-
UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[-info.target_scale + source_scale]);
|
|
833
|
-
T multiply_power_of_ten = UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[-info.target_scale]);
|
|
834
|
-
T addition = divide_power_of_ten / 2;
|
|
602
|
+
int32_t target_scale;
|
|
835
603
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
});
|
|
604
|
+
unique_ptr<FunctionData> Copy() const override {
|
|
605
|
+
return make_uniq<RoundPrecisionFunctionData>(target_scale);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
bool Equals(const FunctionData &other_p) const override {
|
|
609
|
+
auto &other = other_p.Cast<RoundPrecisionFunctionData>();
|
|
610
|
+
return target_scale == other.target_scale;
|
|
844
611
|
}
|
|
845
612
|
};
|
|
846
613
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
614
|
+
template <class T, class POWERS_OF_TEN_CLASS>
|
|
615
|
+
static void DecimalRoundNegativePrecisionFunction(DataChunk &input, ExpressionState &state, Vector &result) {
|
|
616
|
+
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
|
617
|
+
auto &info = func_expr.bind_info->Cast<RoundPrecisionFunctionData>();
|
|
618
|
+
auto source_scale = DecimalType::GetScale(func_expr.children[0]->return_type);
|
|
619
|
+
auto width = DecimalType::GetWidth(func_expr.children[0]->return_type);
|
|
620
|
+
if (info.target_scale <= -int32_t(width - source_scale)) {
|
|
621
|
+
// scale too big for width
|
|
622
|
+
result.SetVectorType(VectorType::CONSTANT_VECTOR);
|
|
623
|
+
result.SetValue(0, Value::INTEGER(0));
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
T divide_power_of_ten = UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[-info.target_scale + source_scale]);
|
|
627
|
+
T multiply_power_of_ten = UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[-info.target_scale]);
|
|
628
|
+
T addition = divide_power_of_ten / 2;
|
|
629
|
+
|
|
630
|
+
UnaryExecutor::Execute<T, T>(input.data[0], result, input.size(), [&](T input) {
|
|
631
|
+
if (input < 0) {
|
|
632
|
+
input -= addition;
|
|
633
|
+
} else {
|
|
634
|
+
input += addition;
|
|
635
|
+
}
|
|
636
|
+
return UnsafeNumericCast<T>(input / divide_power_of_ten * multiply_power_of_ten);
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
template <class T, class POWERS_OF_TEN_CLASS>
|
|
641
|
+
static void DecimalRoundPositivePrecisionFunction(DataChunk &input, ExpressionState &state, Vector &result) {
|
|
642
|
+
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
|
|
643
|
+
auto &info = func_expr.bind_info->Cast<RoundPrecisionFunctionData>();
|
|
644
|
+
auto source_scale = DecimalType::GetScale(func_expr.children[0]->return_type);
|
|
645
|
+
T power_of_ten = UnsafeNumericCast<T>(POWERS_OF_TEN_CLASS::POWERS_OF_TEN[source_scale - info.target_scale]);
|
|
646
|
+
T addition = power_of_ten / 2;
|
|
647
|
+
UnaryExecutor::Execute<T, T>(input.data[0], result, input.size(), [&](T input) {
|
|
648
|
+
if (input < 0) {
|
|
649
|
+
input -= addition;
|
|
650
|
+
} else {
|
|
651
|
+
input += addition;
|
|
652
|
+
}
|
|
653
|
+
return UnsafeNumericCast<T>(input / power_of_ten);
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
unique_ptr<FunctionData> BindDecimalRoundPrecision(ClientContext &context, ScalarFunction &bound_function,
|
|
658
|
+
vector<unique_ptr<Expression>> &arguments) {
|
|
659
|
+
auto &decimal_type = arguments[0]->return_type;
|
|
660
|
+
if (arguments[1]->HasParameter()) {
|
|
661
|
+
throw ParameterNotResolvedException();
|
|
662
|
+
}
|
|
663
|
+
if (!arguments[1]->IsFoldable()) {
|
|
664
|
+
throw NotImplementedException("ROUND(DECIMAL, INTEGER) with non-constant precision is not supported");
|
|
665
|
+
}
|
|
666
|
+
Value val = ExpressionExecutor::EvaluateScalar(context, *arguments[1]).DefaultCastAs(LogicalType::INTEGER);
|
|
667
|
+
if (val.IsNull()) {
|
|
668
|
+
throw NotImplementedException("ROUND(DECIMAL, INTEGER) with non-constant precision is not supported");
|
|
669
|
+
}
|
|
670
|
+
// our new precision becomes the round value
|
|
671
|
+
// e.g. ROUND(DECIMAL(18,3), 1) -> DECIMAL(18,1)
|
|
672
|
+
// but ONLY if the round value is positive
|
|
673
|
+
// if it is negative the scale becomes zero
|
|
674
|
+
// i.e. ROUND(DECIMAL(18,3), -1) -> DECIMAL(18,0)
|
|
675
|
+
int32_t round_value = IntegerValue::Get(val);
|
|
676
|
+
uint8_t target_scale;
|
|
677
|
+
auto width = DecimalType::GetWidth(decimal_type);
|
|
678
|
+
auto scale = DecimalType::GetScale(decimal_type);
|
|
679
|
+
if (round_value < 0) {
|
|
680
|
+
target_scale = 0;
|
|
681
|
+
switch (decimal_type.InternalType()) {
|
|
682
|
+
case PhysicalType::INT16:
|
|
683
|
+
bound_function.function = DecimalRoundNegativePrecisionFunction<int16_t, NumericHelper>;
|
|
684
|
+
break;
|
|
685
|
+
case PhysicalType::INT32:
|
|
686
|
+
bound_function.function = DecimalRoundNegativePrecisionFunction<int32_t, NumericHelper>;
|
|
687
|
+
break;
|
|
688
|
+
case PhysicalType::INT64:
|
|
689
|
+
bound_function.function = DecimalRoundNegativePrecisionFunction<int64_t, NumericHelper>;
|
|
690
|
+
break;
|
|
691
|
+
default:
|
|
692
|
+
bound_function.function = DecimalRoundNegativePrecisionFunction<hugeint_t, Hugeint>;
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
} else {
|
|
696
|
+
if (round_value >= (int32_t)scale) {
|
|
697
|
+
// if round_value is bigger than or equal to scale we do nothing
|
|
698
|
+
bound_function.function = ScalarFunction::NopFunction;
|
|
699
|
+
target_scale = scale;
|
|
700
|
+
} else {
|
|
701
|
+
target_scale = NumericCast<uint8_t>(round_value);
|
|
702
|
+
switch (decimal_type.InternalType()) {
|
|
703
|
+
case PhysicalType::INT16:
|
|
704
|
+
bound_function.function = DecimalRoundPositivePrecisionFunction<int16_t, NumericHelper>;
|
|
705
|
+
break;
|
|
706
|
+
case PhysicalType::INT32:
|
|
707
|
+
bound_function.function = DecimalRoundPositivePrecisionFunction<int32_t, NumericHelper>;
|
|
708
|
+
break;
|
|
709
|
+
case PhysicalType::INT64:
|
|
710
|
+
bound_function.function = DecimalRoundPositivePrecisionFunction<int64_t, NumericHelper>;
|
|
711
|
+
break;
|
|
712
|
+
default:
|
|
713
|
+
bound_function.function = DecimalRoundPositivePrecisionFunction<hugeint_t, Hugeint>;
|
|
714
|
+
break;
|
|
860
715
|
}
|
|
861
|
-
|
|
862
|
-
});
|
|
716
|
+
}
|
|
863
717
|
}
|
|
864
|
-
|
|
718
|
+
bound_function.arguments[0] = decimal_type;
|
|
719
|
+
bound_function.return_type = LogicalType::DECIMAL(width, target_scale);
|
|
720
|
+
return make_uniq<RoundPrecisionFunctionData>(round_value);
|
|
721
|
+
}
|
|
865
722
|
|
|
866
723
|
ScalarFunctionSet RoundFun::GetFunctions() {
|
|
867
724
|
ScalarFunctionSet round;
|
|
@@ -881,8 +738,7 @@ ScalarFunctionSet RoundFun::GetFunctions() {
|
|
|
881
738
|
break;
|
|
882
739
|
case LogicalTypeId::DECIMAL:
|
|
883
740
|
bind_func = BindGenericRoundFunctionDecimal<RoundDecimalOperator>;
|
|
884
|
-
bind_prec_func =
|
|
885
|
-
BindDecimalRoundPrecision<DecimalRoundNegativePrecisionOperator, DecimalRoundPositivePrecisionOperator>;
|
|
741
|
+
bind_prec_func = BindDecimalRoundPrecision;
|
|
886
742
|
break;
|
|
887
743
|
case LogicalTypeId::TINYINT:
|
|
888
744
|
round_func = ScalarFunction::NopFunction;
|
|
@@ -909,7 +765,7 @@ ScalarFunctionSet RoundFun::GetFunctions() {
|
|
|
909
765
|
// no round for integral numbers
|
|
910
766
|
continue;
|
|
911
767
|
}
|
|
912
|
-
throw InternalException("Unimplemented numeric type for function \"
|
|
768
|
+
throw InternalException("Unimplemented numeric type for function \"floor\"");
|
|
913
769
|
}
|
|
914
770
|
round.AddFunction(ScalarFunction({type}, type, round_func, bind_func));
|
|
915
771
|
round.AddFunction(ScalarFunction({type, LogicalType::INTEGER}, type, round_prec_func, bind_prec_func));
|
|
@@ -920,8 +776,6 @@ ScalarFunctionSet RoundFun::GetFunctions() {
|
|
|
920
776
|
//===--------------------------------------------------------------------===//
|
|
921
777
|
// exp
|
|
922
778
|
//===--------------------------------------------------------------------===//
|
|
923
|
-
namespace {
|
|
924
|
-
|
|
925
779
|
struct ExpOperator {
|
|
926
780
|
template <class TA, class TR>
|
|
927
781
|
static inline TR Operation(TA left) {
|
|
@@ -929,8 +783,6 @@ struct ExpOperator {
|
|
|
929
783
|
}
|
|
930
784
|
};
|
|
931
785
|
|
|
932
|
-
} // namespace
|
|
933
|
-
|
|
934
786
|
ScalarFunction ExpFun::GetFunction() {
|
|
935
787
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
936
788
|
ScalarFunction::UnaryFunction<double, double, ExpOperator>);
|
|
@@ -939,8 +791,6 @@ ScalarFunction ExpFun::GetFunction() {
|
|
|
939
791
|
//===--------------------------------------------------------------------===//
|
|
940
792
|
// pow
|
|
941
793
|
//===--------------------------------------------------------------------===//
|
|
942
|
-
namespace {
|
|
943
|
-
|
|
944
794
|
struct PowOperator {
|
|
945
795
|
template <class TA, class TB, class TR>
|
|
946
796
|
static inline TR Operation(TA base, TB exponent) {
|
|
@@ -948,7 +798,6 @@ struct PowOperator {
|
|
|
948
798
|
}
|
|
949
799
|
};
|
|
950
800
|
|
|
951
|
-
} // namespace
|
|
952
801
|
ScalarFunction PowOperatorFun::GetFunction() {
|
|
953
802
|
return ScalarFunction({LogicalType::DOUBLE, LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
954
803
|
ScalarFunction::BinaryFunction<double, double, double, PowOperator>);
|
|
@@ -957,7 +806,6 @@ ScalarFunction PowOperatorFun::GetFunction() {
|
|
|
957
806
|
//===--------------------------------------------------------------------===//
|
|
958
807
|
// sqrt
|
|
959
808
|
//===--------------------------------------------------------------------===//
|
|
960
|
-
namespace {
|
|
961
809
|
struct SqrtOperator {
|
|
962
810
|
template <class TA, class TR>
|
|
963
811
|
static inline TR Operation(TA input) {
|
|
@@ -967,7 +815,6 @@ struct SqrtOperator {
|
|
|
967
815
|
return std::sqrt(input);
|
|
968
816
|
}
|
|
969
817
|
};
|
|
970
|
-
} // namespace
|
|
971
818
|
|
|
972
819
|
ScalarFunction SqrtFun::GetFunction() {
|
|
973
820
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -979,8 +826,6 @@ ScalarFunction SqrtFun::GetFunction() {
|
|
|
979
826
|
//===--------------------------------------------------------------------===//
|
|
980
827
|
// cbrt
|
|
981
828
|
//===--------------------------------------------------------------------===//
|
|
982
|
-
namespace {
|
|
983
|
-
|
|
984
829
|
struct CbRtOperator {
|
|
985
830
|
template <class TA, class TR>
|
|
986
831
|
static inline TR Operation(TA left) {
|
|
@@ -988,8 +833,6 @@ struct CbRtOperator {
|
|
|
988
833
|
}
|
|
989
834
|
};
|
|
990
835
|
|
|
991
|
-
} // namespace
|
|
992
|
-
|
|
993
836
|
ScalarFunction CbrtFun::GetFunction() {
|
|
994
837
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
995
838
|
ScalarFunction::UnaryFunction<double, double, CbRtOperator>);
|
|
@@ -998,7 +841,6 @@ ScalarFunction CbrtFun::GetFunction() {
|
|
|
998
841
|
//===--------------------------------------------------------------------===//
|
|
999
842
|
// ln
|
|
1000
843
|
//===--------------------------------------------------------------------===//
|
|
1001
|
-
namespace {
|
|
1002
844
|
|
|
1003
845
|
struct LnOperator {
|
|
1004
846
|
template <class TA, class TR>
|
|
@@ -1013,7 +855,6 @@ struct LnOperator {
|
|
|
1013
855
|
}
|
|
1014
856
|
};
|
|
1015
857
|
|
|
1016
|
-
} // namespace
|
|
1017
858
|
ScalarFunction LnFun::GetFunction() {
|
|
1018
859
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
1019
860
|
ScalarFunction::UnaryFunction<double, double, LnOperator>);
|
|
@@ -1024,8 +865,6 @@ ScalarFunction LnFun::GetFunction() {
|
|
|
1024
865
|
//===--------------------------------------------------------------------===//
|
|
1025
866
|
// log
|
|
1026
867
|
//===--------------------------------------------------------------------===//
|
|
1027
|
-
namespace {
|
|
1028
|
-
|
|
1029
868
|
struct Log10Operator {
|
|
1030
869
|
template <class TA, class TR>
|
|
1031
870
|
static inline TR Operation(TA input) {
|
|
@@ -1039,8 +878,6 @@ struct Log10Operator {
|
|
|
1039
878
|
}
|
|
1040
879
|
};
|
|
1041
880
|
|
|
1042
|
-
} // namespace
|
|
1043
|
-
|
|
1044
881
|
ScalarFunction Log10Fun::GetFunction() {
|
|
1045
882
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
1046
883
|
ScalarFunction::UnaryFunction<double, double, Log10Operator>);
|
|
@@ -1051,8 +888,6 @@ ScalarFunction Log10Fun::GetFunction() {
|
|
|
1051
888
|
//===--------------------------------------------------------------------===//
|
|
1052
889
|
// log with base
|
|
1053
890
|
//===--------------------------------------------------------------------===//
|
|
1054
|
-
namespace {
|
|
1055
|
-
|
|
1056
891
|
struct LogBaseOperator {
|
|
1057
892
|
template <class TA, class TB, class TR>
|
|
1058
893
|
static inline TR Operation(TA b, TB x) {
|
|
@@ -1064,8 +899,6 @@ struct LogBaseOperator {
|
|
|
1064
899
|
}
|
|
1065
900
|
};
|
|
1066
901
|
|
|
1067
|
-
} // namespace
|
|
1068
|
-
|
|
1069
902
|
ScalarFunctionSet LogFun::GetFunctions() {
|
|
1070
903
|
ScalarFunctionSet funcs;
|
|
1071
904
|
funcs.AddFunction(ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1081,7 +914,6 @@ ScalarFunctionSet LogFun::GetFunctions() {
|
|
|
1081
914
|
//===--------------------------------------------------------------------===//
|
|
1082
915
|
// log2
|
|
1083
916
|
//===--------------------------------------------------------------------===//
|
|
1084
|
-
namespace {
|
|
1085
917
|
struct Log2Operator {
|
|
1086
918
|
template <class TA, class TR>
|
|
1087
919
|
static inline TR Operation(TA input) {
|
|
@@ -1094,7 +926,6 @@ struct Log2Operator {
|
|
|
1094
926
|
return std::log2(input);
|
|
1095
927
|
}
|
|
1096
928
|
};
|
|
1097
|
-
} // namespace
|
|
1098
929
|
|
|
1099
930
|
ScalarFunction Log2Fun::GetFunction() {
|
|
1100
931
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1119,14 +950,12 @@ ScalarFunction PiFun::GetFunction() {
|
|
|
1119
950
|
//===--------------------------------------------------------------------===//
|
|
1120
951
|
// degrees
|
|
1121
952
|
//===--------------------------------------------------------------------===//
|
|
1122
|
-
namespace {
|
|
1123
953
|
struct DegreesOperator {
|
|
1124
954
|
template <class TA, class TR>
|
|
1125
955
|
static inline TR Operation(TA left) {
|
|
1126
956
|
return left * (180 / PI);
|
|
1127
957
|
}
|
|
1128
958
|
};
|
|
1129
|
-
} // namespace
|
|
1130
959
|
|
|
1131
960
|
ScalarFunction DegreesFun::GetFunction() {
|
|
1132
961
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1136,14 +965,12 @@ ScalarFunction DegreesFun::GetFunction() {
|
|
|
1136
965
|
//===--------------------------------------------------------------------===//
|
|
1137
966
|
// radians
|
|
1138
967
|
//===--------------------------------------------------------------------===//
|
|
1139
|
-
namespace {
|
|
1140
968
|
struct RadiansOperator {
|
|
1141
969
|
template <class TA, class TR>
|
|
1142
970
|
static inline TR Operation(TA left) {
|
|
1143
971
|
return left * (PI / 180);
|
|
1144
972
|
}
|
|
1145
973
|
};
|
|
1146
|
-
} // namespace
|
|
1147
974
|
|
|
1148
975
|
ScalarFunction RadiansFun::GetFunction() {
|
|
1149
976
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1153,14 +980,12 @@ ScalarFunction RadiansFun::GetFunction() {
|
|
|
1153
980
|
//===--------------------------------------------------------------------===//
|
|
1154
981
|
// isnan
|
|
1155
982
|
//===--------------------------------------------------------------------===//
|
|
1156
|
-
namespace {
|
|
1157
983
|
struct IsNanOperator {
|
|
1158
984
|
template <class TA, class TR>
|
|
1159
985
|
static inline TR Operation(TA input) {
|
|
1160
986
|
return Value::IsNan(input);
|
|
1161
987
|
}
|
|
1162
988
|
};
|
|
1163
|
-
} // namespace
|
|
1164
989
|
|
|
1165
990
|
ScalarFunctionSet IsNanFun::GetFunctions() {
|
|
1166
991
|
ScalarFunctionSet funcs;
|
|
@@ -1174,14 +999,12 @@ ScalarFunctionSet IsNanFun::GetFunctions() {
|
|
|
1174
999
|
//===--------------------------------------------------------------------===//
|
|
1175
1000
|
// signbit
|
|
1176
1001
|
//===--------------------------------------------------------------------===//
|
|
1177
|
-
namespace {
|
|
1178
1002
|
struct SignBitOperator {
|
|
1179
1003
|
template <class TA, class TR>
|
|
1180
1004
|
static inline TR Operation(TA input) {
|
|
1181
1005
|
return std::signbit(input);
|
|
1182
1006
|
}
|
|
1183
1007
|
};
|
|
1184
|
-
} // namespace
|
|
1185
1008
|
|
|
1186
1009
|
ScalarFunctionSet SignBitFun::GetFunctions() {
|
|
1187
1010
|
ScalarFunctionSet funcs;
|
|
@@ -1195,7 +1018,6 @@ ScalarFunctionSet SignBitFun::GetFunctions() {
|
|
|
1195
1018
|
//===--------------------------------------------------------------------===//
|
|
1196
1019
|
// isinf
|
|
1197
1020
|
//===--------------------------------------------------------------------===//
|
|
1198
|
-
namespace {
|
|
1199
1021
|
struct IsInfiniteOperator {
|
|
1200
1022
|
template <class TA, class TR>
|
|
1201
1023
|
static inline TR Operation(TA input) {
|
|
@@ -1213,8 +1035,6 @@ bool IsInfiniteOperator::Operation(timestamp_t input) {
|
|
|
1213
1035
|
return !Value::IsFinite(input);
|
|
1214
1036
|
}
|
|
1215
1037
|
|
|
1216
|
-
} // namespace
|
|
1217
|
-
|
|
1218
1038
|
ScalarFunctionSet IsInfiniteFun::GetFunctions() {
|
|
1219
1039
|
ScalarFunctionSet funcs("isinf");
|
|
1220
1040
|
funcs.AddFunction(ScalarFunction({LogicalType::FLOAT}, LogicalType::BOOLEAN,
|
|
@@ -1233,8 +1053,6 @@ ScalarFunctionSet IsInfiniteFun::GetFunctions() {
|
|
|
1233
1053
|
//===--------------------------------------------------------------------===//
|
|
1234
1054
|
// isfinite
|
|
1235
1055
|
//===--------------------------------------------------------------------===//
|
|
1236
|
-
namespace {
|
|
1237
|
-
|
|
1238
1056
|
struct IsFiniteOperator {
|
|
1239
1057
|
template <class TA, class TR>
|
|
1240
1058
|
static inline TR Operation(TA input) {
|
|
@@ -1242,8 +1060,6 @@ struct IsFiniteOperator {
|
|
|
1242
1060
|
}
|
|
1243
1061
|
};
|
|
1244
1062
|
|
|
1245
|
-
} // namespace
|
|
1246
|
-
|
|
1247
1063
|
ScalarFunctionSet IsFiniteFun::GetFunctions() {
|
|
1248
1064
|
ScalarFunctionSet funcs;
|
|
1249
1065
|
funcs.AddFunction(ScalarFunction({LogicalType::FLOAT}, LogicalType::BOOLEAN,
|
|
@@ -1262,7 +1078,6 @@ ScalarFunctionSet IsFiniteFun::GetFunctions() {
|
|
|
1262
1078
|
//===--------------------------------------------------------------------===//
|
|
1263
1079
|
// sin
|
|
1264
1080
|
//===--------------------------------------------------------------------===//
|
|
1265
|
-
namespace {
|
|
1266
1081
|
template <class OP>
|
|
1267
1082
|
struct NoInfiniteDoubleWrapper {
|
|
1268
1083
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
|
@@ -1284,8 +1099,6 @@ struct SinOperator {
|
|
|
1284
1099
|
}
|
|
1285
1100
|
};
|
|
1286
1101
|
|
|
1287
|
-
} // namespace
|
|
1288
|
-
|
|
1289
1102
|
ScalarFunction SinFun::GetFunction() {
|
|
1290
1103
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
1291
1104
|
ScalarFunction::UnaryFunction<double, double, NoInfiniteDoubleWrapper<SinOperator>>);
|
|
@@ -1296,14 +1109,12 @@ ScalarFunction SinFun::GetFunction() {
|
|
|
1296
1109
|
//===--------------------------------------------------------------------===//
|
|
1297
1110
|
// cos
|
|
1298
1111
|
//===--------------------------------------------------------------------===//
|
|
1299
|
-
namespace {
|
|
1300
1112
|
struct CosOperator {
|
|
1301
1113
|
template <class TA, class TR>
|
|
1302
1114
|
static inline TR Operation(TA input) {
|
|
1303
1115
|
return (double)std::cos(input);
|
|
1304
1116
|
}
|
|
1305
1117
|
};
|
|
1306
|
-
} // namespace
|
|
1307
1118
|
|
|
1308
1119
|
ScalarFunction CosFun::GetFunction() {
|
|
1309
1120
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1315,14 +1126,12 @@ ScalarFunction CosFun::GetFunction() {
|
|
|
1315
1126
|
//===--------------------------------------------------------------------===//
|
|
1316
1127
|
// tan
|
|
1317
1128
|
//===--------------------------------------------------------------------===//
|
|
1318
|
-
namespace {
|
|
1319
1129
|
struct TanOperator {
|
|
1320
1130
|
template <class TA, class TR>
|
|
1321
1131
|
static inline TR Operation(TA input) {
|
|
1322
1132
|
return (double)std::tan(input);
|
|
1323
1133
|
}
|
|
1324
1134
|
};
|
|
1325
|
-
} // namespace
|
|
1326
1135
|
|
|
1327
1136
|
ScalarFunction TanFun::GetFunction() {
|
|
1328
1137
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1334,7 +1143,6 @@ ScalarFunction TanFun::GetFunction() {
|
|
|
1334
1143
|
//===--------------------------------------------------------------------===//
|
|
1335
1144
|
// asin
|
|
1336
1145
|
//===--------------------------------------------------------------------===//
|
|
1337
|
-
namespace {
|
|
1338
1146
|
struct ASinOperator {
|
|
1339
1147
|
template <class TA, class TR>
|
|
1340
1148
|
static inline TR Operation(TA input) {
|
|
@@ -1344,7 +1152,6 @@ struct ASinOperator {
|
|
|
1344
1152
|
return (double)std::asin(input);
|
|
1345
1153
|
}
|
|
1346
1154
|
};
|
|
1347
|
-
} // namespace
|
|
1348
1155
|
|
|
1349
1156
|
ScalarFunction AsinFun::GetFunction() {
|
|
1350
1157
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1356,14 +1163,12 @@ ScalarFunction AsinFun::GetFunction() {
|
|
|
1356
1163
|
//===--------------------------------------------------------------------===//
|
|
1357
1164
|
// atan
|
|
1358
1165
|
//===--------------------------------------------------------------------===//
|
|
1359
|
-
namespace {
|
|
1360
1166
|
struct ATanOperator {
|
|
1361
1167
|
template <class TA, class TR>
|
|
1362
1168
|
static inline TR Operation(TA input) {
|
|
1363
1169
|
return (double)std::atan(input);
|
|
1364
1170
|
}
|
|
1365
1171
|
};
|
|
1366
|
-
} // namespace
|
|
1367
1172
|
|
|
1368
1173
|
ScalarFunction AtanFun::GetFunction() {
|
|
1369
1174
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1373,14 +1178,12 @@ ScalarFunction AtanFun::GetFunction() {
|
|
|
1373
1178
|
//===--------------------------------------------------------------------===//
|
|
1374
1179
|
// atan2
|
|
1375
1180
|
//===--------------------------------------------------------------------===//
|
|
1376
|
-
namespace {
|
|
1377
1181
|
struct ATan2 {
|
|
1378
1182
|
template <class TA, class TB, class TR>
|
|
1379
1183
|
static inline TR Operation(TA left, TB right) {
|
|
1380
1184
|
return (double)std::atan2(left, right);
|
|
1381
1185
|
}
|
|
1382
1186
|
};
|
|
1383
|
-
} // namespace
|
|
1384
1187
|
|
|
1385
1188
|
ScalarFunction Atan2Fun::GetFunction() {
|
|
1386
1189
|
return ScalarFunction({LogicalType::DOUBLE, LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1390,7 +1193,6 @@ ScalarFunction Atan2Fun::GetFunction() {
|
|
|
1390
1193
|
//===--------------------------------------------------------------------===//
|
|
1391
1194
|
// acos
|
|
1392
1195
|
//===--------------------------------------------------------------------===//
|
|
1393
|
-
namespace {
|
|
1394
1196
|
struct ACos {
|
|
1395
1197
|
template <class TA, class TR>
|
|
1396
1198
|
static inline TR Operation(TA input) {
|
|
@@ -1400,7 +1202,6 @@ struct ACos {
|
|
|
1400
1202
|
return (double)std::acos(input);
|
|
1401
1203
|
}
|
|
1402
1204
|
};
|
|
1403
|
-
} // namespace
|
|
1404
1205
|
|
|
1405
1206
|
ScalarFunction AcosFun::GetFunction() {
|
|
1406
1207
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1412,14 +1213,12 @@ ScalarFunction AcosFun::GetFunction() {
|
|
|
1412
1213
|
//===--------------------------------------------------------------------===//
|
|
1413
1214
|
// cosh
|
|
1414
1215
|
//===--------------------------------------------------------------------===//
|
|
1415
|
-
namespace {
|
|
1416
1216
|
struct CoshOperator {
|
|
1417
1217
|
template <class TA, class TR>
|
|
1418
1218
|
static inline TR Operation(TA input) {
|
|
1419
1219
|
return (double)std::cosh(input);
|
|
1420
1220
|
}
|
|
1421
1221
|
};
|
|
1422
|
-
} // namespace
|
|
1423
1222
|
|
|
1424
1223
|
ScalarFunction CoshFun::GetFunction() {
|
|
1425
1224
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1429,14 +1228,12 @@ ScalarFunction CoshFun::GetFunction() {
|
|
|
1429
1228
|
//===--------------------------------------------------------------------===//
|
|
1430
1229
|
// acosh
|
|
1431
1230
|
//===--------------------------------------------------------------------===//
|
|
1432
|
-
namespace {
|
|
1433
1231
|
struct AcoshOperator {
|
|
1434
1232
|
template <class TA, class TR>
|
|
1435
1233
|
static inline TR Operation(TA input) {
|
|
1436
1234
|
return (double)std::acosh(input);
|
|
1437
1235
|
}
|
|
1438
1236
|
};
|
|
1439
|
-
} // namespace
|
|
1440
1237
|
|
|
1441
1238
|
ScalarFunction AcoshFun::GetFunction() {
|
|
1442
1239
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1446,14 +1243,12 @@ ScalarFunction AcoshFun::GetFunction() {
|
|
|
1446
1243
|
//===--------------------------------------------------------------------===//
|
|
1447
1244
|
// sinh
|
|
1448
1245
|
//===--------------------------------------------------------------------===//
|
|
1449
|
-
namespace {
|
|
1450
1246
|
struct SinhOperator {
|
|
1451
1247
|
template <class TA, class TR>
|
|
1452
1248
|
static inline TR Operation(TA input) {
|
|
1453
1249
|
return (double)std::sinh(input);
|
|
1454
1250
|
}
|
|
1455
1251
|
};
|
|
1456
|
-
} // namespace
|
|
1457
1252
|
|
|
1458
1253
|
ScalarFunction SinhFun::GetFunction() {
|
|
1459
1254
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1463,14 +1258,12 @@ ScalarFunction SinhFun::GetFunction() {
|
|
|
1463
1258
|
//===--------------------------------------------------------------------===//
|
|
1464
1259
|
// asinh
|
|
1465
1260
|
//===--------------------------------------------------------------------===//
|
|
1466
|
-
namespace {
|
|
1467
1261
|
struct AsinhOperator {
|
|
1468
1262
|
template <class TA, class TR>
|
|
1469
1263
|
static inline TR Operation(TA input) {
|
|
1470
1264
|
return (double)std::asinh(input);
|
|
1471
1265
|
}
|
|
1472
1266
|
};
|
|
1473
|
-
} // namespace
|
|
1474
1267
|
|
|
1475
1268
|
ScalarFunction AsinhFun::GetFunction() {
|
|
1476
1269
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1480,14 +1273,12 @@ ScalarFunction AsinhFun::GetFunction() {
|
|
|
1480
1273
|
//===--------------------------------------------------------------------===//
|
|
1481
1274
|
// tanh
|
|
1482
1275
|
//===--------------------------------------------------------------------===//
|
|
1483
|
-
namespace {
|
|
1484
1276
|
struct TanhOperator {
|
|
1485
1277
|
template <class TA, class TR>
|
|
1486
1278
|
static inline TR Operation(TA input) {
|
|
1487
1279
|
return (double)std::tanh(input);
|
|
1488
1280
|
}
|
|
1489
1281
|
};
|
|
1490
|
-
} // namespace
|
|
1491
1282
|
|
|
1492
1283
|
ScalarFunction TanhFun::GetFunction() {
|
|
1493
1284
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1497,7 +1288,6 @@ ScalarFunction TanhFun::GetFunction() {
|
|
|
1497
1288
|
//===--------------------------------------------------------------------===//
|
|
1498
1289
|
// atanh
|
|
1499
1290
|
//===--------------------------------------------------------------------===//
|
|
1500
|
-
namespace {
|
|
1501
1291
|
struct AtanhOperator {
|
|
1502
1292
|
template <class TA, class TR>
|
|
1503
1293
|
static inline TR Operation(TA input) {
|
|
@@ -1510,7 +1300,6 @@ struct AtanhOperator {
|
|
|
1510
1300
|
return (double)std::atanh(input);
|
|
1511
1301
|
}
|
|
1512
1302
|
};
|
|
1513
|
-
} // namespace
|
|
1514
1303
|
|
|
1515
1304
|
ScalarFunction AtanhFun::GetFunction() {
|
|
1516
1305
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1522,7 +1311,6 @@ ScalarFunction AtanhFun::GetFunction() {
|
|
|
1522
1311
|
//===--------------------------------------------------------------------===//
|
|
1523
1312
|
// cot
|
|
1524
1313
|
//===--------------------------------------------------------------------===//
|
|
1525
|
-
namespace {
|
|
1526
1314
|
template <class OP>
|
|
1527
1315
|
struct NoInfiniteNoZeroDoubleWrapper {
|
|
1528
1316
|
template <class INPUT_TYPE, class RESULT_TYPE>
|
|
@@ -1546,7 +1334,7 @@ struct CotOperator {
|
|
|
1546
1334
|
return 1.0 / (double)std::tan(input);
|
|
1547
1335
|
}
|
|
1548
1336
|
};
|
|
1549
|
-
|
|
1337
|
+
|
|
1550
1338
|
ScalarFunction CotFun::GetFunction() {
|
|
1551
1339
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
1552
1340
|
ScalarFunction::UnaryFunction<double, double, NoInfiniteNoZeroDoubleWrapper<CotOperator>>);
|
|
@@ -1557,7 +1345,6 @@ ScalarFunction CotFun::GetFunction() {
|
|
|
1557
1345
|
//===--------------------------------------------------------------------===//
|
|
1558
1346
|
// gamma
|
|
1559
1347
|
//===--------------------------------------------------------------------===//
|
|
1560
|
-
namespace {
|
|
1561
1348
|
struct GammaOperator {
|
|
1562
1349
|
template <class TA, class TR>
|
|
1563
1350
|
static inline TR Operation(TA input) {
|
|
@@ -1567,7 +1354,6 @@ struct GammaOperator {
|
|
|
1567
1354
|
return std::tgamma(input);
|
|
1568
1355
|
}
|
|
1569
1356
|
};
|
|
1570
|
-
} // namespace
|
|
1571
1357
|
|
|
1572
1358
|
ScalarFunction GammaFun::GetFunction() {
|
|
1573
1359
|
auto func = ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1579,7 +1365,6 @@ ScalarFunction GammaFun::GetFunction() {
|
|
|
1579
1365
|
//===--------------------------------------------------------------------===//
|
|
1580
1366
|
// gamma
|
|
1581
1367
|
//===--------------------------------------------------------------------===//
|
|
1582
|
-
namespace {
|
|
1583
1368
|
struct LogGammaOperator {
|
|
1584
1369
|
template <class TA, class TR>
|
|
1585
1370
|
static inline TR Operation(TA input) {
|
|
@@ -1589,7 +1374,6 @@ struct LogGammaOperator {
|
|
|
1589
1374
|
return std::lgamma(input);
|
|
1590
1375
|
}
|
|
1591
1376
|
};
|
|
1592
|
-
} // namespace
|
|
1593
1377
|
|
|
1594
1378
|
ScalarFunction LogGammaFun::GetFunction() {
|
|
1595
1379
|
ScalarFunction function({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1601,7 +1385,6 @@ ScalarFunction LogGammaFun::GetFunction() {
|
|
|
1601
1385
|
//===--------------------------------------------------------------------===//
|
|
1602
1386
|
// factorial(), !
|
|
1603
1387
|
//===--------------------------------------------------------------------===//
|
|
1604
|
-
namespace {
|
|
1605
1388
|
struct FactorialOperator {
|
|
1606
1389
|
template <class TA, class TR>
|
|
1607
1390
|
static inline TR Operation(TA left) {
|
|
@@ -1614,7 +1397,6 @@ struct FactorialOperator {
|
|
|
1614
1397
|
return ret;
|
|
1615
1398
|
}
|
|
1616
1399
|
};
|
|
1617
|
-
} // namespace
|
|
1618
1400
|
|
|
1619
1401
|
ScalarFunction FactorialOperatorFun::GetFunction() {
|
|
1620
1402
|
ScalarFunction function({LogicalType::INTEGER}, LogicalType::HUGEINT,
|
|
@@ -1626,7 +1408,6 @@ ScalarFunction FactorialOperatorFun::GetFunction() {
|
|
|
1626
1408
|
//===--------------------------------------------------------------------===//
|
|
1627
1409
|
// even
|
|
1628
1410
|
//===--------------------------------------------------------------------===//
|
|
1629
|
-
namespace {
|
|
1630
1411
|
struct EvenOperator {
|
|
1631
1412
|
template <class TA, class TR>
|
|
1632
1413
|
static inline TR Operation(TA left) {
|
|
@@ -1646,7 +1427,6 @@ struct EvenOperator {
|
|
|
1646
1427
|
return value;
|
|
1647
1428
|
}
|
|
1648
1429
|
};
|
|
1649
|
-
} // namespace
|
|
1650
1430
|
|
|
1651
1431
|
ScalarFunction EvenFun::GetFunction() {
|
|
1652
1432
|
return ScalarFunction({LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
@@ -1658,7 +1438,6 @@ ScalarFunction EvenFun::GetFunction() {
|
|
|
1658
1438
|
//===--------------------------------------------------------------------===//
|
|
1659
1439
|
|
|
1660
1440
|
// should be replaced with std::gcd in a newer C++ standard
|
|
1661
|
-
namespace {
|
|
1662
1441
|
template <class TA>
|
|
1663
1442
|
TA GreatestCommonDivisor(TA left, TA right) {
|
|
1664
1443
|
TA a = left;
|
|
@@ -1691,8 +1470,6 @@ struct GreatestCommonDivisorOperator {
|
|
|
1691
1470
|
}
|
|
1692
1471
|
};
|
|
1693
1472
|
|
|
1694
|
-
} // namespace
|
|
1695
|
-
|
|
1696
1473
|
ScalarFunctionSet GreatestCommonDivisorFun::GetFunctions() {
|
|
1697
1474
|
ScalarFunctionSet funcs;
|
|
1698
1475
|
funcs.AddFunction(
|
|
@@ -1707,7 +1484,7 @@ ScalarFunctionSet GreatestCommonDivisorFun::GetFunctions() {
|
|
|
1707
1484
|
//===--------------------------------------------------------------------===//
|
|
1708
1485
|
// lcm
|
|
1709
1486
|
//===--------------------------------------------------------------------===//
|
|
1710
|
-
|
|
1487
|
+
|
|
1711
1488
|
// should be replaced with std::lcm in a newer C++ standard
|
|
1712
1489
|
struct LeastCommonMultipleOperator {
|
|
1713
1490
|
template <class TA, class TB, class TR>
|
|
@@ -1723,8 +1500,6 @@ struct LeastCommonMultipleOperator {
|
|
|
1723
1500
|
}
|
|
1724
1501
|
};
|
|
1725
1502
|
|
|
1726
|
-
} // namespace
|
|
1727
|
-
|
|
1728
1503
|
ScalarFunctionSet LeastCommonMultipleFun::GetFunctions() {
|
|
1729
1504
|
ScalarFunctionSet funcs;
|
|
1730
1505
|
|