duckdb 0.7.2-dev2740.0 → 0.7.2-dev2867.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +21 -13
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-datepart.cpp +51 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
- package/src/duckdb/extension/json/include/json_functions.hpp +35 -37
- package/src/duckdb/extension/json/include/json_scan.hpp +1 -1
- package/src/duckdb/extension/json/include/json_transform.hpp +1 -1
- package/src/duckdb/extension/json/json-extension.cpp +10 -20
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_array_length.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_contains.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_create.cpp +20 -20
- package/src/duckdb/extension/json/json_functions/json_extract.cpp +4 -6
- package/src/duckdb/extension/json/json_functions/json_keys.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +8 -8
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +4 -4
- package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -3
- package/src/duckdb/extension/json/json_functions/json_valid.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/read_json.cpp +6 -6
- package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +4 -4
- package/src/duckdb/extension/json/json_functions.cpp +6 -6
- package/src/duckdb/extension/parquet/parquet-extension.cpp +16 -28
- package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +1 -2
- package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +1 -2
- package/src/duckdb/src/catalog/catalog_transaction.cpp +4 -0
- package/src/duckdb/src/catalog/duck_catalog.cpp +8 -1
- package/src/duckdb/src/common/enums/date_part_specifier.cpp +82 -0
- package/src/duckdb/src/common/local_file_system.cpp +1 -3
- package/src/duckdb/src/common/multi_file_reader.cpp +11 -8
- package/src/duckdb/src/common/types/vector.cpp +136 -3
- package/src/duckdb/src/{function → core_functions}/aggregate/algebraic/avg.cpp +9 -12
- package/src/duckdb/src/core_functions/aggregate/algebraic/corr.cpp +13 -0
- package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +21 -0
- package/src/duckdb/src/core_functions/aggregate/algebraic/stddev.cpp +34 -0
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/approx_count.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/arg_min_max.cpp +7 -23
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitagg.cpp +10 -10
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitstring_agg.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bool.cpp +1 -17
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/entropy.cpp +5 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/kurtosis.cpp +5 -6
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/minmax.cpp +5 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/product.cpp +2 -11
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/skew.cpp +5 -6
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/string_agg.cpp +4 -6
- package/src/duckdb/src/{function → core_functions}/aggregate/distributive/sum.cpp +38 -46
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/approximate_quantile.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/mode.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/quantile.cpp +31 -23
- package/src/duckdb/src/{function → core_functions}/aggregate/holistic/reservoir_quantile.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/aggregate/nested/histogram.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/nested/list.cpp +6 -10
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_avg.cpp +7 -11
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_count.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_intercept.cpp +5 -8
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_r2.cpp +5 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_slope.cpp +5 -7
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxx_syy.cpp +8 -12
- package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxy.cpp +6 -8
- package/src/duckdb/src/core_functions/core_functions.cpp +50 -0
- package/src/duckdb/src/core_functions/function_list.cpp +352 -0
- package/src/duckdb/src/{function → core_functions}/scalar/bit/bitstring.cpp +12 -15
- package/src/duckdb/src/{function → core_functions}/scalar/blob/base64.cpp +6 -6
- package/src/duckdb/src/{function → core_functions}/scalar/blob/encode.cpp +7 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/age.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/scalar/date/current.cpp +8 -8
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_diff.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_part.cpp +144 -148
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_sub.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/date_trunc.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/date/epoch.cpp +7 -8
- package/src/duckdb/src/{function → core_functions}/scalar/date/make_date.cpp +14 -14
- package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +251 -0
- package/src/duckdb/src/{function → core_functions}/scalar/date/time_bucket.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/date/to_interval.cpp +39 -19
- package/src/duckdb/src/{function/scalar/enum/enum_functions_implementation.cpp → core_functions/scalar/enum/enum_functions.cpp} +18 -22
- package/src/duckdb/src/{function → core_functions}/scalar/generic/alias.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/generic/current_setting.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/generic/error.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/generic/hash.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/generic/least.cpp +8 -9
- package/src/duckdb/src/{function → core_functions}/scalar/generic/stats.cpp +4 -4
- package/src/duckdb/src/{function/scalar/system → core_functions/scalar/generic}/system_functions.cpp +24 -13
- package/src/duckdb/src/{function → core_functions}/scalar/generic/typeof.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/list/array_slice.cpp +3 -13
- package/src/duckdb/src/{function → core_functions}/scalar/list/flatten.cpp +5 -5
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_aggregates.cpp +2 -13
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_lambdas.cpp +9 -24
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_sort.cpp +8 -22
- package/src/duckdb/src/{function → core_functions}/scalar/list/list_value.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/list/range.cpp +8 -6
- package/src/duckdb/src/{function → core_functions}/scalar/map/cardinality.cpp +5 -4
- package/src/duckdb/src/{function → core_functions}/scalar/map/map.cpp +6 -63
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_entries.cpp +5 -4
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_extract.cpp +22 -7
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_from_entries.cpp +6 -5
- package/src/duckdb/src/{function → core_functions}/scalar/map/map_keys_values.cpp +8 -7
- package/src/duckdb/src/{function → core_functions}/scalar/math/numeric.cpp +110 -138
- package/src/duckdb/src/{function → core_functions}/scalar/operators/bitwise.cpp +19 -20
- package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/random.cpp +5 -6
- package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/setseed.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/scalar/string/ascii.cpp +4 -5
- package/src/duckdb/src/{function → core_functions}/scalar/string/bar.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/string/chr.cpp +5 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/damerau_levenshtein.cpp +4 -6
- package/src/duckdb/src/{function/scalar/string/mismatches.cpp → core_functions/scalar/string/hamming.cpp} +3 -12
- package/src/duckdb/src/{function → core_functions}/scalar/string/hex.cpp +15 -25
- package/src/duckdb/src/{function → core_functions}/scalar/string/instr.cpp +6 -13
- package/src/duckdb/src/{function → core_functions}/scalar/string/jaccard.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/jaro_winkler.cpp +7 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/left_right.cpp +18 -11
- package/src/duckdb/src/{function → core_functions}/scalar/string/levenshtein.cpp +3 -12
- package/src/duckdb/src/{function → core_functions}/scalar/string/md5.cpp +15 -21
- package/src/duckdb/src/{function → core_functions}/scalar/string/pad.cpp +7 -13
- package/src/duckdb/src/{function → core_functions}/scalar/string/printf.cpp +10 -10
- package/src/duckdb/src/{function → core_functions}/scalar/string/repeat.cpp +3 -6
- package/src/duckdb/src/{function → core_functions}/scalar/string/replace.cpp +4 -7
- package/src/duckdb/src/{function → core_functions}/scalar/string/reverse.cpp +3 -3
- package/src/duckdb/src/{function → core_functions}/scalar/string/starts_with.cpp +4 -8
- package/src/duckdb/src/{function → core_functions}/scalar/string/string_split.cpp +11 -11
- package/src/duckdb/src/{function → core_functions}/scalar/string/translate.cpp +4 -7
- package/src/duckdb/src/{function → core_functions}/scalar/string/trim.cpp +19 -14
- package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +28 -0
- package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_insert.cpp +4 -4
- package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_pack.cpp +3 -4
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_extract.cpp +4 -8
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_tag.cpp +4 -8
- package/src/duckdb/src/{function → core_functions}/scalar/union/union_value.cpp +4 -59
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +11 -2
- package/src/duckdb/src/function/aggregate/distributive_functions.cpp +0 -17
- package/src/duckdb/src/function/cast/string_cast.cpp +1 -1
- package/src/duckdb/src/function/function.cpp +0 -8
- package/src/duckdb/src/function/function_set.cpp +25 -0
- package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -9
- package/src/duckdb/src/function/scalar/nested_functions.cpp +0 -22
- package/src/duckdb/src/function/scalar/operators.cpp +0 -6
- package/src/duckdb/src/function/scalar/{date/strftime.cpp → strftime_format.cpp} +1 -249
- package/src/duckdb/src/function/scalar/string/length.cpp +0 -19
- package/src/duckdb/src/function/scalar/string_functions.cpp +0 -40
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -0
- package/src/duckdb/src/function/table/arrow_conversion.cpp +1 -1
- package/src/duckdb/src/function/table/read_csv.cpp +7 -4
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +27 -40
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +33 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/algorithm.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -4
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +11 -1
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/corr.hpp +3 -4
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/covar.hpp +1 -1
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/stddev.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +124 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +229 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +85 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +41 -0
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_count.hpp +3 -4
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_slope.hpp +2 -2
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +97 -0
- package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/sum_helpers.hpp +1 -1
- package/src/duckdb/src/include/duckdb/{function/scalar/uuid_functions.hpp → core_functions/core_functions.hpp} +7 -5
- package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +33 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +52 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +58 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +544 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +61 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +142 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +220 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +85 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +394 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +70 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +49 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +439 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +40 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +43 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +0 -85
- package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -8
- package/src/duckdb/src/include/duckdb/function/function_set.hpp +7 -2
- package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -36
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +0 -120
- package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +0 -24
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -97
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/database.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +48 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +5 -1
- package/src/duckdb/src/main/attached_database.cpp +5 -3
- package/src/duckdb/src/main/database.cpp +34 -37
- package/src/duckdb/src/main/extension/extension_helper.cpp +1 -0
- package/src/duckdb/src/main/extension/extension_load.cpp +61 -38
- package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +1 -4
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +2 -4
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +43 -24
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -0
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +17 -28
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -7
- package/src/duckdb/third_party/fmt/format.cc +0 -5
- package/src/duckdb/third_party/fmt/include/fmt/core.h +10 -12
- package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +2 -33
- package/src/duckdb/third_party/fmt/include/fmt/format.h +61 -24
- package/src/duckdb/third_party/fmt/include/fmt/printf.h +15 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +10735 -10674
- package/src/duckdb/ub_src_common_enums.cpp +2 -0
- package/src/duckdb/ub_src_core_functions.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp +8 -0
- package/src/duckdb/ub_src_core_functions_aggregate_distributive.cpp +24 -0
- package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +8 -0
- package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_aggregate_regression.cpp +14 -0
- package/src/duckdb/ub_src_core_functions_scalar_bit.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_blob.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_date.cpp +22 -0
- package/src/duckdb/ub_src_core_functions_scalar_enum.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +16 -0
- package/src/duckdb/ub_src_core_functions_scalar_list.cpp +14 -0
- package/src/duckdb/ub_src_core_functions_scalar_map.cpp +12 -0
- package/src/duckdb/ub_src_core_functions_scalar_math.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_operators.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_random.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +44 -0
- package/src/duckdb/ub_src_core_functions_scalar_struct.cpp +4 -0
- package/src/duckdb/ub_src_core_functions_scalar_union.cpp +6 -0
- package/src/duckdb/ub_src_function_aggregate.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_distributive.cpp +0 -24
- package/src/duckdb/ub_src_function_scalar.cpp +2 -8
- package/src/duckdb/ub_src_function_scalar_generic.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_list.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_operators.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_string.cpp +0 -42
- package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -4
- package/src/duckdb/ub_src_function_scalar_system.cpp +0 -2
- package/src/duckdb/ub_src_main_extension.cpp +2 -0
- package/src/duckdb/src/function/aggregate/algebraic/corr.cpp +0 -14
- package/src/duckdb/src/function/aggregate/algebraic/covar.cpp +0 -25
- package/src/duckdb/src/function/aggregate/algebraic/stddev.cpp +0 -54
- package/src/duckdb/src/function/aggregate/algebraic_functions.cpp +0 -21
- package/src/duckdb/src/function/aggregate/holistic_functions.cpp +0 -12
- package/src/duckdb/src/function/aggregate/nested_functions.cpp +0 -10
- package/src/duckdb/src/function/aggregate/regression_functions.cpp +0 -21
- package/src/duckdb/src/function/scalar/date_functions.cpp +0 -22
- package/src/duckdb/src/function/scalar/enum_functions.cpp +0 -13
- package/src/duckdb/src/function/scalar/math_functions.cpp +0 -50
- package/src/duckdb/src/function/scalar/trigonometrics_functions.cpp +0 -18
- package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +0 -56
- package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +0 -33
- package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +0 -26
- package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +0 -53
- package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +0 -32
- package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +0 -24
- package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +0 -73
- package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +0 -37
- package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +0 -137
- package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +0 -49
- package/src/duckdb/ub_src_function_aggregate_algebraic.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_holistic.cpp +0 -8
- package/src/duckdb/ub_src_function_aggregate_nested.cpp +0 -4
- package/src/duckdb/ub_src_function_aggregate_regression.cpp +0 -14
- package/src/duckdb/ub_src_function_scalar_bit.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_blob.cpp +0 -4
- package/src/duckdb/ub_src_function_scalar_date.cpp +0 -22
- package/src/duckdb/ub_src_function_scalar_enum.cpp +0 -2
- package/src/duckdb/ub_src_function_scalar_map.cpp +0 -12
- package/src/duckdb/ub_src_function_scalar_math.cpp +0 -6
- package/src/duckdb/ub_src_function_scalar_union.cpp +0 -6
- /package/src/duckdb/src/include/duckdb/function/scalar/{strftime.hpp → strftime_format.hpp} +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "duckdb/
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
2
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
3
3
|
#include "duckdb/common/limits.hpp"
|
4
4
|
#include "fmt/format.h"
|
@@ -152,20 +152,20 @@ static void PrintfFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
152
152
|
}
|
153
153
|
}
|
154
154
|
|
155
|
-
|
155
|
+
ScalarFunction PrintfFun::GetFunction() {
|
156
156
|
// duckdb_fmt::printf_context, duckdb_fmt::vsprintf
|
157
|
-
ScalarFunction printf_fun
|
158
|
-
|
159
|
-
PrintfFunction<FMTPrintf, duckdb_fmt::printf_context>, BindPrintfFunction);
|
157
|
+
ScalarFunction printf_fun({LogicalType::VARCHAR}, LogicalType::VARCHAR,
|
158
|
+
PrintfFunction<FMTPrintf, duckdb_fmt::printf_context>, BindPrintfFunction);
|
160
159
|
printf_fun.varargs = LogicalType::ANY;
|
161
|
-
|
160
|
+
return printf_fun;
|
161
|
+
}
|
162
162
|
|
163
|
+
ScalarFunction FormatFun::GetFunction() {
|
163
164
|
// duckdb_fmt::format_context, duckdb_fmt::vformat
|
164
|
-
ScalarFunction format_fun
|
165
|
-
|
166
|
-
PrintfFunction<FMTFormat, duckdb_fmt::format_context>, BindPrintfFunction);
|
165
|
+
ScalarFunction format_fun({LogicalType::VARCHAR}, LogicalType::VARCHAR,
|
166
|
+
PrintfFunction<FMTFormat, duckdb_fmt::format_context>, BindPrintfFunction);
|
167
167
|
format_fun.varargs = LogicalType::ANY;
|
168
|
-
|
168
|
+
return format_fun;
|
169
169
|
}
|
170
170
|
|
171
171
|
} // namespace duckdb
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "duckdb/
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/exception.hpp"
|
4
4
|
#include "duckdb/common/vector_operations/binary_executor.hpp"
|
@@ -33,11 +33,8 @@ static void RepeatFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
33
33
|
});
|
34
34
|
}
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
{LogicalType::VARCHAR, LogicalType::BIGINT}, // argument list
|
39
|
-
LogicalType::VARCHAR, // return type
|
40
|
-
RepeatFunction)); // pointer to function implementation
|
36
|
+
ScalarFunction RepeatFun::GetFunction() {
|
37
|
+
return ScalarFunction({LogicalType::VARCHAR, LogicalType::BIGINT}, LogicalType::VARCHAR, RepeatFunction);
|
41
38
|
}
|
42
39
|
|
43
40
|
} // namespace duckdb
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "duckdb/
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/exception.hpp"
|
4
4
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
@@ -76,12 +76,9 @@ static void ReplaceFunction(DataChunk &args, ExpressionState &state, Vector &res
|
|
76
76
|
});
|
77
77
|
}
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
LogicalType::VARCHAR, LogicalType::VARCHAR},
|
83
|
-
LogicalType::VARCHAR, // return type
|
84
|
-
ReplaceFunction)); // pointer to function implementation
|
79
|
+
ScalarFunction ReplaceFun::GetFunction() {
|
80
|
+
return ScalarFunction({LogicalType::VARCHAR, LogicalType::VARCHAR, LogicalType::VARCHAR}, LogicalType::VARCHAR,
|
81
|
+
ReplaceFunction);
|
85
82
|
}
|
86
83
|
|
87
84
|
} // namespace duckdb
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "duckdb/
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/exception.hpp"
|
4
4
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
@@ -49,8 +49,8 @@ static void ReverseFunction(DataChunk &args, ExpressionState &state, Vector &res
|
|
49
49
|
UnaryExecutor::ExecuteString<string_t, string_t, ReverseOperator>(args.data[0], result, args.size());
|
50
50
|
}
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
ScalarFunction ReverseFun::GetFunction() {
|
53
|
+
return ScalarFunction("reverse", {LogicalType::VARCHAR}, LogicalType::VARCHAR, ReverseFunction);
|
54
54
|
}
|
55
55
|
|
56
56
|
} // namespace duckdb
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "duckdb/
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/exception.hpp"
|
4
4
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
@@ -35,13 +35,9 @@ struct StartsWithOperator {
|
|
35
35
|
}
|
36
36
|
};
|
37
37
|
|
38
|
-
|
39
|
-
ScalarFunction
|
40
|
-
|
41
|
-
ScalarFunction::BinaryFunction<string_t, string_t, bool, StartsWithOperator>);
|
42
|
-
set.AddFunction(starts_with);
|
43
|
-
starts_with.name = "^@";
|
44
|
-
set.AddFunction(starts_with);
|
38
|
+
ScalarFunction StartsWithOperatorFun::GetFunction() {
|
39
|
+
return ScalarFunction({LogicalType::VARCHAR, LogicalType::VARCHAR}, LogicalType::BOOLEAN,
|
40
|
+
ScalarFunction::BinaryFunction<string_t, string_t, bool, StartsWithOperator>);
|
45
41
|
}
|
46
42
|
|
47
43
|
} // namespace duckdb
|
@@ -3,8 +3,9 @@
|
|
3
3
|
#include "duckdb/common/types/vector.hpp"
|
4
4
|
#include "duckdb/common/vector_size.hpp"
|
5
5
|
#include "duckdb/function/scalar/regexp.hpp"
|
6
|
-
#include "duckdb/
|
6
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
7
7
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
8
|
+
#include "duckdb/function/scalar/string_functions.hpp"
|
8
9
|
|
9
10
|
namespace duckdb {
|
10
11
|
|
@@ -171,15 +172,17 @@ static void StringSplitRegexFunction(DataChunk &args, ExpressionState &state, Ve
|
|
171
172
|
}
|
172
173
|
}
|
173
174
|
|
174
|
-
|
175
|
+
ScalarFunction StringSplitFun::GetFunction() {
|
175
176
|
auto varchar_list_type = LogicalType::LIST(LogicalType::VARCHAR);
|
176
177
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
178
|
+
ScalarFunction string_split({LogicalType::VARCHAR, LogicalType::VARCHAR}, varchar_list_type, StringSplitFunction);
|
179
|
+
string_split.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
180
|
+
return string_split;
|
181
|
+
}
|
181
182
|
|
182
|
-
|
183
|
+
ScalarFunctionSet StringSplitRegexFun::GetFunctions() {
|
184
|
+
auto varchar_list_type = LogicalType::LIST(LogicalType::VARCHAR);
|
185
|
+
ScalarFunctionSet regexp_split;
|
183
186
|
ScalarFunction regex_fun({LogicalType::VARCHAR, LogicalType::VARCHAR}, varchar_list_type, StringSplitRegexFunction,
|
184
187
|
RegexpMatchesBind, nullptr, nullptr, RegexInitLocalState, LogicalType::INVALID,
|
185
188
|
FunctionSideEffects::NO_SIDE_EFFECTS, FunctionNullHandling::SPECIAL_HANDLING);
|
@@ -187,10 +190,7 @@ void StringSplitFun::RegisterFunction(BuiltinFunctions &set) {
|
|
187
190
|
// regexp options
|
188
191
|
regex_fun.arguments.emplace_back(LogicalType::VARCHAR);
|
189
192
|
regexp_split.AddFunction(regex_fun);
|
190
|
-
|
191
|
-
regexp_split.name = name;
|
192
|
-
set.AddFunction(regexp_split);
|
193
|
-
}
|
193
|
+
return regexp_split;
|
194
194
|
}
|
195
195
|
|
196
196
|
} // namespace duckdb
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "duckdb/
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/exception.hpp"
|
4
4
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
@@ -88,12 +88,9 @@ static void TranslateFunction(DataChunk &args, ExpressionState &state, Vector &r
|
|
88
88
|
});
|
89
89
|
}
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
LogicalType::VARCHAR, LogicalType::VARCHAR},
|
95
|
-
LogicalType::VARCHAR, // return type
|
96
|
-
TranslateFunction)); // pointer to function implementation
|
91
|
+
ScalarFunction TranslateFun::GetFunction() {
|
92
|
+
return ScalarFunction({LogicalType::VARCHAR, LogicalType::VARCHAR, LogicalType::VARCHAR}, LogicalType::VARCHAR,
|
93
|
+
TranslateFunction);
|
97
94
|
}
|
98
95
|
|
99
96
|
} // namespace duckdb
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "duckdb/
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/exception.hpp"
|
4
4
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
@@ -125,25 +125,30 @@ static void BinaryTrimFunction(DataChunk &input, ExpressionState &state, Vector
|
|
125
125
|
});
|
126
126
|
}
|
127
127
|
|
128
|
-
|
129
|
-
ScalarFunctionSet
|
130
|
-
ScalarFunctionSet rtrim("rtrim");
|
131
|
-
ScalarFunctionSet trim("trim");
|
132
|
-
|
133
|
-
ltrim.AddFunction(ScalarFunction({LogicalType::VARCHAR}, LogicalType::VARCHAR, UnaryTrimFunction<true, false>));
|
134
|
-
rtrim.AddFunction(ScalarFunction({LogicalType::VARCHAR}, LogicalType::VARCHAR, UnaryTrimFunction<false, true>));
|
128
|
+
ScalarFunctionSet TrimFun::GetFunctions() {
|
129
|
+
ScalarFunctionSet trim;
|
135
130
|
trim.AddFunction(ScalarFunction({LogicalType::VARCHAR}, LogicalType::VARCHAR, UnaryTrimFunction<true, true>));
|
136
131
|
|
132
|
+
trim.AddFunction(ScalarFunction({LogicalType::VARCHAR, LogicalType::VARCHAR}, LogicalType::VARCHAR,
|
133
|
+
BinaryTrimFunction<true, true>));
|
134
|
+
return trim;
|
135
|
+
}
|
136
|
+
|
137
|
+
ScalarFunctionSet LtrimFun::GetFunctions() {
|
138
|
+
ScalarFunctionSet ltrim;
|
139
|
+
ltrim.AddFunction(ScalarFunction({LogicalType::VARCHAR}, LogicalType::VARCHAR, UnaryTrimFunction<true, false>));
|
137
140
|
ltrim.AddFunction(ScalarFunction({LogicalType::VARCHAR, LogicalType::VARCHAR}, LogicalType::VARCHAR,
|
138
141
|
BinaryTrimFunction<true, false>));
|
142
|
+
return ltrim;
|
143
|
+
}
|
144
|
+
|
145
|
+
ScalarFunctionSet RtrimFun::GetFunctions() {
|
146
|
+
ScalarFunctionSet rtrim;
|
147
|
+
rtrim.AddFunction(ScalarFunction({LogicalType::VARCHAR}, LogicalType::VARCHAR, UnaryTrimFunction<false, true>));
|
148
|
+
|
139
149
|
rtrim.AddFunction(ScalarFunction({LogicalType::VARCHAR, LogicalType::VARCHAR}, LogicalType::VARCHAR,
|
140
150
|
BinaryTrimFunction<false, true>));
|
141
|
-
|
142
|
-
BinaryTrimFunction<true, true>));
|
143
|
-
|
144
|
-
set.AddFunction(ltrim);
|
145
|
-
set.AddFunction(rtrim);
|
146
|
-
set.AddFunction(trim);
|
151
|
+
return rtrim;
|
147
152
|
}
|
148
153
|
|
149
154
|
} // namespace duckdb
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#include "duckdb/core_functions/scalar/string_functions.hpp"
|
2
|
+
|
3
|
+
#include "duckdb/common/exception.hpp"
|
4
|
+
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
5
|
+
#include "duckdb/common/vector_operations/unary_executor.hpp"
|
6
|
+
#include "utf8proc.hpp"
|
7
|
+
|
8
|
+
#include <string.h>
|
9
|
+
|
10
|
+
namespace duckdb {
|
11
|
+
|
12
|
+
struct UnicodeOperator {
|
13
|
+
template <class TA, class TR>
|
14
|
+
static inline TR Operation(const TA &input) {
|
15
|
+
auto str = reinterpret_cast<const utf8proc_uint8_t *>(input.GetData());
|
16
|
+
auto len = input.GetSize();
|
17
|
+
utf8proc_int32_t codepoint;
|
18
|
+
(void)utf8proc_iterate(str, len, &codepoint);
|
19
|
+
return codepoint;
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
ScalarFunction UnicodeFun::GetFunction() {
|
24
|
+
return ScalarFunction({LogicalType::VARCHAR}, LogicalType::INTEGER,
|
25
|
+
ScalarFunction::UnaryFunction<string_t, int32_t, UnicodeOperator>);
|
26
|
+
}
|
27
|
+
|
28
|
+
} // namespace duckdb
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#include "duckdb/core_functions/scalar/struct_functions.hpp"
|
1
2
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
2
3
|
#include "duckdb/common/string_util.hpp"
|
3
4
|
#include "duckdb/parser/expression/bound_expression.hpp"
|
@@ -96,14 +97,13 @@ unique_ptr<BaseStatistics> StructInsertStats(ClientContext &context, FunctionSta
|
|
96
97
|
return new_struct_stats.ToUnique();
|
97
98
|
}
|
98
99
|
|
99
|
-
|
100
|
+
ScalarFunction StructInsertFun::GetFunction() {
|
100
101
|
// the arguments and return types are actually set in the binder function
|
101
|
-
ScalarFunction fun(
|
102
|
-
StructInsertStats);
|
102
|
+
ScalarFunction fun({}, LogicalTypeId::STRUCT, StructInsertFunction, StructInsertBind, nullptr, StructInsertStats);
|
103
103
|
fun.varargs = LogicalType::ANY;
|
104
104
|
fun.serialize = VariableReturnBindData::Serialize;
|
105
105
|
fun.deserialize = VariableReturnBindData::Deserialize;
|
106
|
-
|
106
|
+
return fun;
|
107
107
|
}
|
108
108
|
|
109
109
|
} // namespace duckdb
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#include "duckdb/core_functions/scalar/struct_functions.hpp"
|
1
2
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
2
3
|
#include "duckdb/common/string_util.hpp"
|
3
4
|
#include "duckdb/parser/expression/bound_expression.hpp"
|
@@ -68,7 +69,7 @@ unique_ptr<BaseStatistics> StructPackStats(ClientContext &context, FunctionStati
|
|
68
69
|
return struct_stats.ToUnique();
|
69
70
|
}
|
70
71
|
|
71
|
-
|
72
|
+
ScalarFunction StructPackFun::GetFunction() {
|
72
73
|
// the arguments and return types are actually set in the binder function
|
73
74
|
ScalarFunction fun("struct_pack", {}, LogicalTypeId::STRUCT, StructPackFunction, StructPackBind, nullptr,
|
74
75
|
StructPackStats);
|
@@ -76,9 +77,7 @@ void StructPackFun::RegisterFunction(BuiltinFunctions &set) {
|
|
76
77
|
fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
77
78
|
fun.serialize = VariableReturnBindData::Serialize;
|
78
79
|
fun.deserialize = VariableReturnBindData::Deserialize;
|
79
|
-
|
80
|
-
fun.name = "row";
|
81
|
-
set.AddFunction(fun);
|
80
|
+
return fun;
|
82
81
|
}
|
83
82
|
|
84
83
|
} // namespace duckdb
|
@@ -1,6 +1,6 @@
|
|
1
|
+
#include "duckdb/core_functions/scalar/union_functions.hpp"
|
1
2
|
#include "duckdb/common/string_util.hpp"
|
2
3
|
#include "duckdb/execution/expression_executor.hpp"
|
3
|
-
#include "duckdb/function/scalar/nested_functions.hpp"
|
4
4
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
5
5
|
#include "duckdb/planner/expression/bound_parameter_expression.hpp"
|
6
6
|
|
@@ -97,14 +97,10 @@ static unique_ptr<FunctionData> UnionExtractBind(ClientContext &context, ScalarF
|
|
97
97
|
return make_uniq<UnionExtractBindData>(key, key_index, return_type);
|
98
98
|
}
|
99
99
|
|
100
|
-
|
100
|
+
ScalarFunction UnionExtractFun::GetFunction() {
|
101
101
|
// the arguments and return types are actually set in the binder function
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
ScalarFunctionSet extract("union_extract");
|
106
|
-
extract.AddFunction(fun);
|
107
|
-
set.AddFunction(extract);
|
102
|
+
return ScalarFunction({LogicalTypeId::UNION, LogicalType::VARCHAR}, LogicalType::ANY, UnionExtractFunction,
|
103
|
+
UnionExtractBind, nullptr, nullptr);
|
108
104
|
}
|
109
105
|
|
110
106
|
} // namespace duckdb
|
@@ -1,6 +1,6 @@
|
|
1
|
+
#include "duckdb/core_functions/scalar/union_functions.hpp"
|
1
2
|
#include "duckdb/common/string_util.hpp"
|
2
3
|
#include "duckdb/execution/expression_executor.hpp"
|
3
|
-
#include "duckdb/function/scalar/nested_functions.hpp"
|
4
4
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
5
5
|
#include "duckdb/planner/expression/bound_parameter_expression.hpp"
|
6
6
|
|
@@ -50,13 +50,9 @@ static void UnionTagFunction(DataChunk &args, ExpressionState &state, Vector &re
|
|
50
50
|
result.Reinterpret(UnionVector::GetTags(args.data[0]));
|
51
51
|
}
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
ScalarFunctionSet union_tag("union_tag");
|
58
|
-
union_tag.AddFunction(fun);
|
59
|
-
set.AddFunction(union_tag);
|
53
|
+
ScalarFunction UnionTagFun::GetFunction() {
|
54
|
+
return ScalarFunction({LogicalTypeId::UNION}, LogicalTypeId::ANY, UnionTagFunction, UnionTagBind, nullptr,
|
55
|
+
nullptr); // TODO: Statistics?
|
60
56
|
}
|
61
57
|
|
62
58
|
} // namespace duckdb
|
@@ -1,3 +1,4 @@
|
|
1
|
+
#include "duckdb/core_functions/scalar/union_functions.hpp"
|
1
2
|
#include "duckdb/common/string_util.hpp"
|
2
3
|
#include "duckdb/execution/expression_executor.hpp"
|
3
4
|
#include "duckdb/function/scalar/nested_functions.hpp"
|
@@ -6,57 +7,6 @@
|
|
6
7
|
|
7
8
|
namespace duckdb {
|
8
9
|
|
9
|
-
UnionInvalidReason CheckUnionValidity(Vector &vector, idx_t count, const SelectionVector &sel) {
|
10
|
-
D_ASSERT(vector.GetType().id() == LogicalTypeId::UNION);
|
11
|
-
auto member_count = UnionType::GetMemberCount(vector.GetType());
|
12
|
-
if (member_count == 0) {
|
13
|
-
return UnionInvalidReason::NO_MEMBERS;
|
14
|
-
}
|
15
|
-
|
16
|
-
UnifiedVectorFormat union_vdata;
|
17
|
-
vector.ToUnifiedFormat(count, union_vdata);
|
18
|
-
|
19
|
-
UnifiedVectorFormat tags_vdata;
|
20
|
-
auto &tag_vector = UnionVector::GetTags(vector);
|
21
|
-
tag_vector.ToUnifiedFormat(count, tags_vdata);
|
22
|
-
|
23
|
-
// check that only one member is valid at a time
|
24
|
-
for (idx_t row_idx = 0; row_idx < count; row_idx++) {
|
25
|
-
auto union_mapped_row_idx = sel.get_index(row_idx);
|
26
|
-
if (!union_vdata.validity.RowIsValid(union_mapped_row_idx)) {
|
27
|
-
continue;
|
28
|
-
}
|
29
|
-
|
30
|
-
auto tag_mapped_row_idx = tags_vdata.sel->get_index(row_idx);
|
31
|
-
if (!tags_vdata.validity.RowIsValid(tag_mapped_row_idx)) {
|
32
|
-
continue;
|
33
|
-
}
|
34
|
-
|
35
|
-
auto tag = ((union_tag_t *)tags_vdata.data)[tag_mapped_row_idx];
|
36
|
-
if (tag >= member_count) {
|
37
|
-
return UnionInvalidReason::TAG_OUT_OF_RANGE;
|
38
|
-
}
|
39
|
-
|
40
|
-
bool found_valid = false;
|
41
|
-
for (idx_t member_idx = 0; member_idx < member_count; member_idx++) {
|
42
|
-
|
43
|
-
UnifiedVectorFormat member_vdata;
|
44
|
-
auto &member = UnionVector::GetMember(vector, member_idx);
|
45
|
-
member.ToUnifiedFormat(count, member_vdata);
|
46
|
-
|
47
|
-
auto mapped_row_idx = member_vdata.sel->get_index(row_idx);
|
48
|
-
if (member_vdata.validity.RowIsValid(mapped_row_idx)) {
|
49
|
-
if (found_valid) {
|
50
|
-
return UnionInvalidReason::VALIDITY_OVERLAP;
|
51
|
-
}
|
52
|
-
found_valid = true;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
return UnionInvalidReason::VALID;
|
58
|
-
}
|
59
|
-
|
60
10
|
struct UnionValueBindData : public FunctionData {
|
61
11
|
UnionValueBindData() {
|
62
12
|
}
|
@@ -106,18 +56,13 @@ static unique_ptr<FunctionData> UnionValueBind(ClientContext &context, ScalarFun
|
|
106
56
|
return make_uniq<VariableReturnBindData>(bound_function.return_type);
|
107
57
|
}
|
108
58
|
|
109
|
-
|
110
|
-
|
111
|
-
auto fun =
|
112
|
-
ScalarFunction("union_value", {}, LogicalTypeId::UNION, UnionValueFunction, UnionValueBind, nullptr, nullptr);
|
59
|
+
ScalarFunction UnionValueFun::GetFunction() {
|
60
|
+
ScalarFunction fun("union_value", {}, LogicalTypeId::UNION, UnionValueFunction, UnionValueBind, nullptr, nullptr);
|
113
61
|
fun.varargs = LogicalType::ANY;
|
114
62
|
fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
115
63
|
fun.serialize = VariableReturnBindData::Serialize;
|
116
64
|
fun.deserialize = VariableReturnBindData::Deserialize;
|
117
|
-
|
118
|
-
ScalarFunctionSet union_value("union_value");
|
119
|
-
union_value.AddFunction(fun);
|
120
|
-
set.AddFunction(union_value);
|
65
|
+
return fun;
|
121
66
|
}
|
122
67
|
|
123
68
|
} // namespace duckdb
|
@@ -9,7 +9,7 @@
|
|
9
9
|
#include "duckdb/common/operator/decimal_cast_operators.hpp"
|
10
10
|
#include "duckdb/common/vector_operations/unary_executor.hpp"
|
11
11
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
12
|
-
#include "duckdb/function/scalar/
|
12
|
+
#include "duckdb/function/scalar/strftime_format.hpp"
|
13
13
|
#include "duckdb/main/database.hpp"
|
14
14
|
#include "duckdb/parser/column_definition.hpp"
|
15
15
|
#include "duckdb/storage/data_table.hpp"
|
@@ -7,7 +7,7 @@
|
|
7
7
|
#include "duckdb/common/types/cast_helpers.hpp"
|
8
8
|
#include "duckdb/common/vector_operations/unary_executor.hpp"
|
9
9
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
10
|
-
#include "duckdb/function/scalar/
|
10
|
+
#include "duckdb/function/scalar/strftime_format.hpp"
|
11
11
|
#include "duckdb/main/database.hpp"
|
12
12
|
#include "duckdb/parser/column_definition.hpp"
|
13
13
|
#include "duckdb/storage/data_table.hpp"
|
@@ -7,7 +7,7 @@
|
|
7
7
|
#include "duckdb/common/types/cast_helpers.hpp"
|
8
8
|
#include "duckdb/common/vector_operations/unary_executor.hpp"
|
9
9
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
10
|
-
#include "duckdb/function/scalar/
|
10
|
+
#include "duckdb/function/scalar/strftime_format.hpp"
|
11
11
|
#include "duckdb/main/database.hpp"
|
12
12
|
#include "duckdb/parser/column_definition.hpp"
|
13
13
|
#include "duckdb/storage/data_table.hpp"
|
@@ -3,6 +3,7 @@
|
|
3
3
|
#include "duckdb/catalog/catalog.hpp"
|
4
4
|
#include "duckdb/common/types/column/column_data_collection.hpp"
|
5
5
|
#include "duckdb/catalog/catalog_entry/type_catalog_entry.hpp"
|
6
|
+
#include "duckdb/common/string_map_set.hpp"
|
6
7
|
|
7
8
|
namespace duckdb {
|
8
9
|
|
@@ -21,6 +22,7 @@ public:
|
|
21
22
|
Vector result;
|
22
23
|
idx_t size = 0;
|
23
24
|
idx_t capacity = STANDARD_VECTOR_SIZE;
|
25
|
+
string_set_t found_strings;
|
24
26
|
};
|
25
27
|
|
26
28
|
unique_ptr<GlobalSinkState> PhysicalCreateType::GetGlobalSinkState(ClientContext &context) const {
|
@@ -52,8 +54,15 @@ SinkResultType PhysicalCreateType::Sink(ExecutionContext &context, GlobalSinkSta
|
|
52
54
|
if (!sdata.validity.RowIsValid(idx)) {
|
53
55
|
throw InvalidInputException("Attempted to create ENUM type with NULL value!");
|
54
56
|
}
|
55
|
-
|
56
|
-
|
57
|
+
auto str = src_ptr[idx];
|
58
|
+
auto entry = gstate.found_strings.find(src_ptr[idx]);
|
59
|
+
if (entry != gstate.found_strings.end()) {
|
60
|
+
// entry was already found - skip
|
61
|
+
continue;
|
62
|
+
}
|
63
|
+
auto owned_string = StringVector::AddStringOrBlob(gstate.result, str.GetData(), str.GetSize());
|
64
|
+
gstate.found_strings.insert(owned_string);
|
65
|
+
result_ptr[gstate.size++] = owned_string;
|
57
66
|
}
|
58
67
|
return SinkResultType::NEED_MORE_INPUT;
|
59
68
|
}
|
@@ -7,26 +7,9 @@
|
|
7
7
|
namespace duckdb {
|
8
8
|
|
9
9
|
void BuiltinFunctions::RegisterDistributiveAggregates() {
|
10
|
-
Register<BitAndFun>();
|
11
|
-
Register<BitOrFun>();
|
12
|
-
Register<BitXorFun>();
|
13
|
-
Register<BitStringAggFun>();
|
14
10
|
Register<CountStarFun>();
|
15
11
|
Register<CountFun>();
|
16
12
|
Register<FirstFun>();
|
17
|
-
Register<MaxFun>();
|
18
|
-
Register<MinFun>();
|
19
|
-
Register<SumFun>();
|
20
|
-
Register<StringAggFun>();
|
21
|
-
Register<ApproxCountDistinctFun>();
|
22
|
-
Register<ProductFun>();
|
23
|
-
Register<BoolOrFun>();
|
24
|
-
Register<BoolAndFun>();
|
25
|
-
Register<ArgMinFun>();
|
26
|
-
Register<ArgMaxFun>();
|
27
|
-
Register<SkewFun>();
|
28
|
-
Register<KurtosisFun>();
|
29
|
-
Register<EntropyFun>();
|
30
13
|
}
|
31
14
|
|
32
15
|
} // namespace duckdb
|
@@ -92,21 +92,13 @@ void BuiltinFunctions::Initialize() {
|
|
92
92
|
RegisterTableFunctions();
|
93
93
|
RegisterArrowFunctions();
|
94
94
|
|
95
|
-
RegisterAlgebraicAggregates();
|
96
95
|
RegisterDistributiveAggregates();
|
97
|
-
RegisterNestedAggregates();
|
98
|
-
RegisterHolisticAggregates();
|
99
|
-
RegisterRegressiveAggregates();
|
100
96
|
|
101
|
-
RegisterDateFunctions();
|
102
|
-
RegisterEnumFunctions();
|
103
97
|
RegisterGenericFunctions();
|
104
|
-
RegisterMathFunctions();
|
105
98
|
RegisterOperators();
|
106
99
|
RegisterSequenceFunctions();
|
107
100
|
RegisterStringFunctions();
|
108
101
|
RegisterNestedFunctions();
|
109
|
-
RegisterTrigonometricsFunctions();
|
110
102
|
|
111
103
|
RegisterPragmaFunctions();
|
112
104
|
|
@@ -3,9 +3,16 @@
|
|
3
3
|
|
4
4
|
namespace duckdb {
|
5
5
|
|
6
|
+
ScalarFunctionSet::ScalarFunctionSet() : FunctionSet("") {
|
7
|
+
}
|
8
|
+
|
6
9
|
ScalarFunctionSet::ScalarFunctionSet(string name) : FunctionSet(std::move(name)) {
|
7
10
|
}
|
8
11
|
|
12
|
+
ScalarFunctionSet::ScalarFunctionSet(ScalarFunction fun) : FunctionSet(std::move(fun.name)) {
|
13
|
+
functions.push_back(std::move(fun));
|
14
|
+
}
|
15
|
+
|
9
16
|
ScalarFunction ScalarFunctionSet::GetFunctionByArguments(ClientContext &context, const vector<LogicalType> &arguments) {
|
10
17
|
string error;
|
11
18
|
FunctionBinder binder(context);
|
@@ -17,9 +24,16 @@ ScalarFunction ScalarFunctionSet::GetFunctionByArguments(ClientContext &context,
|
|
17
24
|
return GetFunctionByOffset(index);
|
18
25
|
}
|
19
26
|
|
27
|
+
AggregateFunctionSet::AggregateFunctionSet() : FunctionSet("") {
|
28
|
+
}
|
29
|
+
|
20
30
|
AggregateFunctionSet::AggregateFunctionSet(string name) : FunctionSet(std::move(name)) {
|
21
31
|
}
|
22
32
|
|
33
|
+
AggregateFunctionSet::AggregateFunctionSet(AggregateFunction fun) : FunctionSet(std::move(fun.name)) {
|
34
|
+
functions.push_back(std::move(fun));
|
35
|
+
}
|
36
|
+
|
23
37
|
AggregateFunction AggregateFunctionSet::GetFunctionByArguments(ClientContext &context,
|
24
38
|
const vector<LogicalType> &arguments) {
|
25
39
|
string error;
|
@@ -53,6 +67,10 @@ AggregateFunction AggregateFunctionSet::GetFunctionByArguments(ClientContext &co
|
|
53
67
|
TableFunctionSet::TableFunctionSet(string name) : FunctionSet(std::move(name)) {
|
54
68
|
}
|
55
69
|
|
70
|
+
TableFunctionSet::TableFunctionSet(TableFunction fun) : FunctionSet(std::move(fun.name)) {
|
71
|
+
functions.push_back(std::move(fun));
|
72
|
+
}
|
73
|
+
|
56
74
|
TableFunction TableFunctionSet::GetFunctionByArguments(ClientContext &context, const vector<LogicalType> &arguments) {
|
57
75
|
string error;
|
58
76
|
FunctionBinder binder(context);
|
@@ -64,4 +82,11 @@ TableFunction TableFunctionSet::GetFunctionByArguments(ClientContext &context, c
|
|
64
82
|
return GetFunctionByOffset(index);
|
65
83
|
}
|
66
84
|
|
85
|
+
PragmaFunctionSet::PragmaFunctionSet(string name) : FunctionSet(std::move(name)) {
|
86
|
+
}
|
87
|
+
|
88
|
+
PragmaFunctionSet::PragmaFunctionSet(PragmaFunction fun) : FunctionSet(std::move(fun.name)) {
|
89
|
+
functions.push_back(std::move(fun));
|
90
|
+
}
|
91
|
+
|
67
92
|
} // namespace duckdb
|