duckdb 0.7.2-dev2706.0 → 0.7.2-dev2820.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-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 +11 -24
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +46 -20
- 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/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/persistent/physical_insert.cpp +19 -12
- 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/range.cpp +1 -0
- package/src/duckdb/src/function/table/repeat_row.cpp +60 -0
- 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/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/persistent/physical_insert.hpp +4 -3
- 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/range.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -1
- 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/main/extension/extension_helper.cpp +1 -0
- package/src/duckdb/src/main/extension/extension_load.cpp +48 -4
- package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -7
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +5 -4
- 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_function_table.cpp +2 -0
- 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
package/binding.gyp
CHANGED
@@ -36,6 +36,25 @@
|
|
36
36
|
"src/duckdb/src/common/vector_operations/vector_copy.cpp",
|
37
37
|
"src/duckdb/src/common/vector_operations/vector_hash.cpp",
|
38
38
|
"src/duckdb/src/common/vector_operations/vector_storage.cpp",
|
39
|
+
"src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp",
|
40
|
+
"src/duckdb/ub_src_core_functions_aggregate_distributive.cpp",
|
41
|
+
"src/duckdb/ub_src_core_functions_aggregate_holistic.cpp",
|
42
|
+
"src/duckdb/ub_src_core_functions_aggregate_nested.cpp",
|
43
|
+
"src/duckdb/ub_src_core_functions_aggregate_regression.cpp",
|
44
|
+
"src/duckdb/ub_src_core_functions.cpp",
|
45
|
+
"src/duckdb/ub_src_core_functions_scalar_bit.cpp",
|
46
|
+
"src/duckdb/ub_src_core_functions_scalar_blob.cpp",
|
47
|
+
"src/duckdb/ub_src_core_functions_scalar_date.cpp",
|
48
|
+
"src/duckdb/ub_src_core_functions_scalar_enum.cpp",
|
49
|
+
"src/duckdb/ub_src_core_functions_scalar_generic.cpp",
|
50
|
+
"src/duckdb/ub_src_core_functions_scalar_list.cpp",
|
51
|
+
"src/duckdb/ub_src_core_functions_scalar_map.cpp",
|
52
|
+
"src/duckdb/ub_src_core_functions_scalar_math.cpp",
|
53
|
+
"src/duckdb/ub_src_core_functions_scalar_operators.cpp",
|
54
|
+
"src/duckdb/ub_src_core_functions_scalar_random.cpp",
|
55
|
+
"src/duckdb/ub_src_core_functions_scalar_string.cpp",
|
56
|
+
"src/duckdb/ub_src_core_functions_scalar_struct.cpp",
|
57
|
+
"src/duckdb/ub_src_core_functions_scalar_union.cpp",
|
39
58
|
"src/duckdb/ub_src_execution.cpp",
|
40
59
|
"src/duckdb/ub_src_execution_expression_executor.cpp",
|
41
60
|
"src/duckdb/ub_src_execution_index_art.cpp",
|
@@ -51,31 +70,20 @@
|
|
51
70
|
"src/duckdb/ub_src_execution_operator_schema.cpp",
|
52
71
|
"src/duckdb/ub_src_execution_operator_set.cpp",
|
53
72
|
"src/duckdb/ub_src_execution_physical_plan.cpp",
|
54
|
-
"src/duckdb/ub_src_function_aggregate_algebraic.cpp",
|
55
|
-
"src/duckdb/ub_src_function_aggregate.cpp",
|
56
73
|
"src/duckdb/ub_src_function_aggregate_distributive.cpp",
|
57
|
-
"src/duckdb/
|
58
|
-
"src/duckdb/ub_src_function_aggregate_nested.cpp",
|
59
|
-
"src/duckdb/ub_src_function_aggregate_regression.cpp",
|
74
|
+
"src/duckdb/ub_src_function_aggregate.cpp",
|
60
75
|
"src/duckdb/ub_src_function.cpp",
|
61
76
|
"src/duckdb/ub_src_function_cast.cpp",
|
62
77
|
"src/duckdb/ub_src_function_pragma.cpp",
|
63
|
-
"src/duckdb/ub_src_function_scalar_bit.cpp",
|
64
|
-
"src/duckdb/ub_src_function_scalar_blob.cpp",
|
65
|
-
"src/duckdb/ub_src_function_scalar_date.cpp",
|
66
|
-
"src/duckdb/ub_src_function_scalar.cpp",
|
67
|
-
"src/duckdb/ub_src_function_scalar_enum.cpp",
|
68
78
|
"src/duckdb/ub_src_function_scalar_generic.cpp",
|
79
|
+
"src/duckdb/ub_src_function_scalar.cpp",
|
69
80
|
"src/duckdb/ub_src_function_scalar_list.cpp",
|
70
|
-
"src/duckdb/ub_src_function_scalar_map.cpp",
|
71
|
-
"src/duckdb/ub_src_function_scalar_math.cpp",
|
72
81
|
"src/duckdb/ub_src_function_scalar_operators.cpp",
|
73
82
|
"src/duckdb/ub_src_function_scalar_sequence.cpp",
|
74
83
|
"src/duckdb/ub_src_function_scalar_string.cpp",
|
75
84
|
"src/duckdb/ub_src_function_scalar_string_regexp.cpp",
|
76
85
|
"src/duckdb/ub_src_function_scalar_struct.cpp",
|
77
86
|
"src/duckdb/ub_src_function_scalar_system.cpp",
|
78
|
-
"src/duckdb/ub_src_function_scalar_union.cpp",
|
79
87
|
"src/duckdb/ub_src_function_table.cpp",
|
80
88
|
"src/duckdb/ub_src_function_table_system.cpp",
|
81
89
|
"src/duckdb/ub_src_function_table_version.cpp",
|
package/package.json
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
#include "duckdb/common/types/timestamp.hpp"
|
10
10
|
#include "duckdb/common/vector_operations/binary_executor.hpp"
|
11
11
|
#include "duckdb/execution/expression_executor.hpp"
|
12
|
-
#include "duckdb/function/scalar/
|
12
|
+
#include "duckdb/function/scalar/strftime_format.hpp"
|
13
13
|
#include "duckdb/main/client_context.hpp"
|
14
14
|
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
|
15
15
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
@@ -8,9 +8,7 @@
|
|
8
8
|
|
9
9
|
#pragma once
|
10
10
|
|
11
|
-
#include "duckdb/
|
12
|
-
#include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
|
13
|
-
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"
|
11
|
+
#include "duckdb/main/extension_util.hpp"
|
14
12
|
#include "json_common.hpp"
|
15
13
|
|
16
14
|
namespace duckdb {
|
@@ -66,40 +64,40 @@ public:
|
|
66
64
|
|
67
65
|
class JSONFunctions {
|
68
66
|
public:
|
69
|
-
static vector<
|
70
|
-
static vector<
|
71
|
-
static vector<
|
67
|
+
static vector<ScalarFunctionSet> GetScalarFunctions();
|
68
|
+
static vector<PragmaFunctionSet> GetPragmaFunctions();
|
69
|
+
static vector<TableFunctionSet> GetTableFunctions();
|
72
70
|
static unique_ptr<TableRef> ReadJSONReplacement(ClientContext &context, const string &table_name,
|
73
71
|
ReplacementScanData *data);
|
74
72
|
static TableFunction GetReadJSONTableFunction(shared_ptr<JSONScanInfo> function_info);
|
75
|
-
static
|
73
|
+
static CopyFunction GetJSONCopyFunction();
|
76
74
|
static void RegisterCastFunctions(CastFunctionSet &casts);
|
77
75
|
|
78
76
|
private:
|
79
77
|
// Scalar functions
|
80
|
-
static
|
81
|
-
static
|
82
|
-
|
83
|
-
static
|
84
|
-
static
|
85
|
-
static
|
86
|
-
static
|
87
|
-
static
|
88
|
-
static
|
89
|
-
|
90
|
-
static
|
91
|
-
static
|
92
|
-
static
|
93
|
-
|
94
|
-
static
|
95
|
-
static
|
96
|
-
static
|
97
|
-
static
|
98
|
-
static
|
99
|
-
static
|
100
|
-
static
|
101
|
-
|
102
|
-
static
|
78
|
+
static ScalarFunctionSet GetExtractFunction();
|
79
|
+
static ScalarFunctionSet GetExtractStringFunction();
|
80
|
+
|
81
|
+
static ScalarFunctionSet GetArrayFunction();
|
82
|
+
static ScalarFunctionSet GetObjectFunction();
|
83
|
+
static ScalarFunctionSet GetToJSONFunction();
|
84
|
+
static ScalarFunctionSet GetArrayToJSONFunction();
|
85
|
+
static ScalarFunctionSet GetRowToJSONFunction();
|
86
|
+
static ScalarFunctionSet GetMergePatchFunction();
|
87
|
+
|
88
|
+
static ScalarFunctionSet GetStructureFunction();
|
89
|
+
static ScalarFunctionSet GetTransformFunction();
|
90
|
+
static ScalarFunctionSet GetTransformStrictFunction();
|
91
|
+
|
92
|
+
static ScalarFunctionSet GetArrayLengthFunction();
|
93
|
+
static ScalarFunctionSet GetContainsFunction();
|
94
|
+
static ScalarFunctionSet GetKeysFunction();
|
95
|
+
static ScalarFunctionSet GetTypeFunction();
|
96
|
+
static ScalarFunctionSet GetValidFunction();
|
97
|
+
static ScalarFunctionSet GetSerializeSqlFunction();
|
98
|
+
static ScalarFunctionSet GetDeserializeSqlFunction();
|
99
|
+
|
100
|
+
static PragmaFunctionSet GetExecuteJsonSerializedSqlPragmaFunction();
|
103
101
|
|
104
102
|
template <class FUNCTION_INFO>
|
105
103
|
static void AddAliases(const vector<string> &names, FUNCTION_INFO fun, vector<FUNCTION_INFO> &functions) {
|
@@ -111,13 +109,13 @@ private:
|
|
111
109
|
|
112
110
|
private:
|
113
111
|
// Table functions
|
114
|
-
static
|
115
|
-
static
|
116
|
-
static
|
117
|
-
static
|
118
|
-
static
|
119
|
-
static
|
120
|
-
static
|
112
|
+
static TableFunctionSet GetReadJSONObjectsFunction();
|
113
|
+
static TableFunctionSet GetReadNDJSONObjectsFunction();
|
114
|
+
static TableFunctionSet GetReadJSONFunction();
|
115
|
+
static TableFunctionSet GetReadNDJSONFunction();
|
116
|
+
static TableFunctionSet GetReadJSONAutoFunction();
|
117
|
+
static TableFunctionSet GetReadNDJSONAutoFunction();
|
118
|
+
static TableFunctionSet GetExecuteJsonSerializedSqlFunction();
|
121
119
|
};
|
122
120
|
|
123
121
|
} // namespace duckdb
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
#include "buffered_json_reader.hpp"
|
12
12
|
#include "duckdb/common/mutex.hpp"
|
13
|
-
#include "duckdb/function/scalar/
|
13
|
+
#include "duckdb/function/scalar/strftime_format.hpp"
|
14
14
|
#include "duckdb/function/table_function.hpp"
|
15
15
|
#include "json_transform.hpp"
|
16
16
|
|
@@ -3,13 +3,12 @@
|
|
3
3
|
|
4
4
|
#include "duckdb/catalog/catalog_entry/macro_catalog_entry.hpp"
|
5
5
|
#include "duckdb/catalog/default/default_functions.hpp"
|
6
|
+
#include "duckdb/main/extension_util.hpp"
|
6
7
|
#include "duckdb/common/string_util.hpp"
|
7
|
-
#include "duckdb/function/cast/cast_function_set.hpp"
|
8
8
|
#include "duckdb/parser/expression/constant_expression.hpp"
|
9
9
|
#include "duckdb/parser/expression/function_expression.hpp"
|
10
|
-
#include "duckdb/parser/parsed_data/create_type_info.hpp"
|
11
|
-
#include "duckdb/parser/parsed_data/create_pragma_function_info.hpp"
|
12
10
|
#include "duckdb/parser/tableref/table_function_ref.hpp"
|
11
|
+
#include "duckdb/function/copy_function.hpp"
|
13
12
|
#include "json_common.hpp"
|
14
13
|
#include "json_functions.hpp"
|
15
14
|
|
@@ -23,34 +22,27 @@ static DefaultMacro json_macros[] = {
|
|
23
22
|
{nullptr, nullptr, {nullptr}, nullptr}};
|
24
23
|
|
25
24
|
void JSONExtension::Load(DuckDB &db) {
|
26
|
-
|
27
|
-
con.BeginTransaction();
|
28
|
-
auto &context = *con.context;
|
29
|
-
auto &catalog = Catalog::GetSystemCatalog(context);
|
30
|
-
|
25
|
+
auto &db_instance = *db.instance;
|
31
26
|
// JSON type
|
32
27
|
auto json_type = JSONCommon::JSONType();
|
33
|
-
|
34
|
-
type_info.temporary = true;
|
35
|
-
type_info.internal = true;
|
36
|
-
catalog.CreateType(context, type_info);
|
28
|
+
ExtensionUtil::RegisterType(db_instance, JSONCommon::JSON_TYPE_NAME, std::move(json_type));
|
37
29
|
|
38
30
|
// JSON casts
|
39
|
-
JSONFunctions::RegisterCastFunctions(DBConfig::GetConfig(
|
31
|
+
JSONFunctions::RegisterCastFunctions(DBConfig::GetConfig(db_instance).GetCastFunctions());
|
40
32
|
|
41
33
|
// JSON scalar functions
|
42
34
|
for (auto &fun : JSONFunctions::GetScalarFunctions()) {
|
43
|
-
|
35
|
+
ExtensionUtil::RegisterFunction(db_instance, fun);
|
44
36
|
}
|
45
37
|
|
46
38
|
// JSON table functions
|
47
39
|
for (auto &fun : JSONFunctions::GetTableFunctions()) {
|
48
|
-
|
40
|
+
ExtensionUtil::RegisterFunction(db_instance, fun);
|
49
41
|
}
|
50
42
|
|
51
43
|
// JSON pragma functions
|
52
44
|
for (auto &fun : JSONFunctions::GetPragmaFunctions()) {
|
53
|
-
|
45
|
+
ExtensionUtil::RegisterFunction(db_instance, fun);
|
54
46
|
}
|
55
47
|
|
56
48
|
// JSON replacement scan
|
@@ -59,15 +51,13 @@ void JSONExtension::Load(DuckDB &db) {
|
|
59
51
|
|
60
52
|
// JSON copy function
|
61
53
|
auto copy_fun = JSONFunctions::GetJSONCopyFunction();
|
62
|
-
|
54
|
+
ExtensionUtil::RegisterFunction(db_instance, std::move(copy_fun));
|
63
55
|
|
64
56
|
// JSON macro's
|
65
57
|
for (idx_t index = 0; json_macros[index].name != nullptr; index++) {
|
66
58
|
auto info = DefaultFunctionGenerator::CreateInternalMacroInfo(json_macros[index]);
|
67
|
-
|
59
|
+
ExtensionUtil::RegisterFunction(db_instance, *info);
|
68
60
|
}
|
69
|
-
|
70
|
-
con.Commit();
|
71
61
|
}
|
72
62
|
|
73
63
|
std::string JSONExtension::Name() {
|
@@ -106,7 +106,7 @@ static duckdb::unique_ptr<FunctionData> CopyFromJSONBind(ClientContext &context,
|
|
106
106
|
return std::move(bind_data);
|
107
107
|
}
|
108
108
|
|
109
|
-
|
109
|
+
CopyFunction JSONFunctions::GetJSONCopyFunction() {
|
110
110
|
CopyFunction function("json");
|
111
111
|
function.extension = "json";
|
112
112
|
|
@@ -116,7 +116,7 @@ CreateCopyFunctionInfo JSONFunctions::GetJSONCopyFunction() {
|
|
116
116
|
function.copy_from_function = JSONFunctions::GetReadJSONTableFunction(
|
117
117
|
make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, JSONRecordType::RECORDS, false));
|
118
118
|
|
119
|
-
return
|
119
|
+
return function;
|
120
120
|
}
|
121
121
|
|
122
122
|
} // namespace duckdb
|
@@ -28,12 +28,11 @@ static void GetArrayLengthFunctionsInternal(ScalarFunctionSet &set, const Logica
|
|
28
28
|
JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
29
29
|
}
|
30
30
|
|
31
|
-
|
31
|
+
ScalarFunctionSet JSONFunctions::GetArrayLengthFunction() {
|
32
32
|
ScalarFunctionSet set("json_array_length");
|
33
33
|
GetArrayLengthFunctionsInternal(set, LogicalType::VARCHAR);
|
34
34
|
GetArrayLengthFunctionsInternal(set, JSONCommon::JSONType());
|
35
|
-
|
36
|
-
return CreateScalarFunctionInfo(std::move(set));
|
35
|
+
return set;
|
37
36
|
}
|
38
37
|
|
39
38
|
} // namespace duckdb
|
@@ -139,7 +139,7 @@ static void GetContainsFunctionInternal(ScalarFunctionSet &set, const LogicalTyp
|
|
139
139
|
JSONFunctionLocalState::Init));
|
140
140
|
}
|
141
141
|
|
142
|
-
|
142
|
+
ScalarFunctionSet JSONFunctions::GetContainsFunction() {
|
143
143
|
ScalarFunctionSet set("json_contains");
|
144
144
|
GetContainsFunctionInternal(set, LogicalType::VARCHAR, LogicalType::VARCHAR);
|
145
145
|
GetContainsFunctionInternal(set, LogicalType::VARCHAR, JSONCommon::JSONType());
|
@@ -147,7 +147,7 @@ CreateScalarFunctionInfo JSONFunctions::GetContainsFunction() {
|
|
147
147
|
GetContainsFunctionInternal(set, JSONCommon::JSONType(), JSONCommon::JSONType());
|
148
148
|
// TODO: implement json_contains that accepts path argument as well
|
149
149
|
|
150
|
-
return
|
150
|
+
return set;
|
151
151
|
}
|
152
152
|
|
153
153
|
} // namespace duckdb
|
@@ -515,41 +515,41 @@ static void ToJSONFunction(DataChunk &args, ExpressionState &state, Vector &resu
|
|
515
515
|
}
|
516
516
|
}
|
517
517
|
|
518
|
-
|
519
|
-
|
520
|
-
|
518
|
+
ScalarFunctionSet JSONFunctions::GetObjectFunction() {
|
519
|
+
ScalarFunction fun("json_object", {}, JSONCommon::JSONType(), ObjectFunction, JSONObjectBind, nullptr, nullptr,
|
520
|
+
JSONFunctionLocalState::Init);
|
521
521
|
fun.varargs = LogicalType::ANY;
|
522
522
|
fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
523
|
-
return
|
523
|
+
return ScalarFunctionSet(fun);
|
524
524
|
}
|
525
525
|
|
526
|
-
|
527
|
-
|
528
|
-
|
526
|
+
ScalarFunctionSet JSONFunctions::GetArrayFunction() {
|
527
|
+
ScalarFunction fun("json_array", {}, JSONCommon::JSONType(), ArrayFunction, JSONArrayBind, nullptr, nullptr,
|
528
|
+
JSONFunctionLocalState::Init);
|
529
529
|
fun.varargs = LogicalType::ANY;
|
530
530
|
fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
531
|
-
return
|
531
|
+
return ScalarFunctionSet(fun);
|
532
532
|
}
|
533
533
|
|
534
|
-
|
535
|
-
|
536
|
-
|
534
|
+
ScalarFunctionSet JSONFunctions::GetToJSONFunction() {
|
535
|
+
ScalarFunction fun("to_json", {}, JSONCommon::JSONType(), ToJSONFunction, ToJSONBind, nullptr, nullptr,
|
536
|
+
JSONFunctionLocalState::Init);
|
537
537
|
fun.varargs = LogicalType::ANY;
|
538
|
-
return
|
538
|
+
return ScalarFunctionSet(fun);
|
539
539
|
}
|
540
540
|
|
541
|
-
|
542
|
-
|
543
|
-
|
541
|
+
ScalarFunctionSet JSONFunctions::GetArrayToJSONFunction() {
|
542
|
+
ScalarFunction fun("array_to_json", {}, JSONCommon::JSONType(), ToJSONFunction, ArrayToJSONBind, nullptr, nullptr,
|
543
|
+
JSONFunctionLocalState::Init);
|
544
544
|
fun.varargs = LogicalType::ANY;
|
545
|
-
return
|
545
|
+
return ScalarFunctionSet(fun);
|
546
546
|
}
|
547
547
|
|
548
|
-
|
549
|
-
|
550
|
-
|
548
|
+
ScalarFunctionSet JSONFunctions::GetRowToJSONFunction() {
|
549
|
+
ScalarFunction fun("row_to_json", {}, JSONCommon::JSONType(), ToJSONFunction, RowToJSONBind, nullptr, nullptr,
|
550
|
+
JSONFunctionLocalState::Init);
|
551
551
|
fun.varargs = LogicalType::ANY;
|
552
|
-
return
|
552
|
+
return ScalarFunctionSet(fun);
|
553
553
|
}
|
554
554
|
|
555
555
|
} // namespace duckdb
|
@@ -35,13 +35,12 @@ static void GetExtractFunctionsInternal(ScalarFunctionSet &set, const LogicalTyp
|
|
35
35
|
JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
36
36
|
}
|
37
37
|
|
38
|
-
|
38
|
+
ScalarFunctionSet JSONFunctions::GetExtractFunction() {
|
39
39
|
// Generic extract function
|
40
40
|
ScalarFunctionSet set("json_extract");
|
41
41
|
GetExtractFunctionsInternal(set, LogicalType::VARCHAR);
|
42
42
|
GetExtractFunctionsInternal(set, JSONCommon::JSONType());
|
43
|
-
|
44
|
-
return CreateScalarFunctionInfo(set);
|
43
|
+
return set;
|
45
44
|
}
|
46
45
|
|
47
46
|
static void GetExtractStringFunctionsInternal(ScalarFunctionSet &set, const LogicalType &input_type) {
|
@@ -52,13 +51,12 @@ static void GetExtractStringFunctionsInternal(ScalarFunctionSet &set, const Logi
|
|
52
51
|
JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
53
52
|
}
|
54
53
|
|
55
|
-
|
54
|
+
ScalarFunctionSet JSONFunctions::GetExtractStringFunction() {
|
56
55
|
// String extract function
|
57
56
|
ScalarFunctionSet set("json_extract_string");
|
58
57
|
GetExtractStringFunctionsInternal(set, LogicalType::VARCHAR);
|
59
58
|
GetExtractStringFunctionsInternal(set, JSONCommon::JSONType());
|
60
|
-
|
61
|
-
return CreateScalarFunctionInfo(set);
|
59
|
+
return set;
|
62
60
|
}
|
63
61
|
|
64
62
|
} // namespace duckdb
|
@@ -49,12 +49,11 @@ static void GetJSONKeysFunctionsInternal(ScalarFunctionSet &set, const LogicalTy
|
|
49
49
|
JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
50
50
|
}
|
51
51
|
|
52
|
-
|
52
|
+
ScalarFunctionSet JSONFunctions::GetKeysFunction() {
|
53
53
|
ScalarFunctionSet set("json_keys");
|
54
54
|
GetJSONKeysFunctionsInternal(set, LogicalType::VARCHAR);
|
55
55
|
GetJSONKeysFunctionsInternal(set, JSONCommon::JSONType());
|
56
|
-
|
57
|
-
return CreateScalarFunctionInfo(std::move(set));
|
56
|
+
return set;
|
58
57
|
}
|
59
58
|
|
60
59
|
} // namespace duckdb
|
@@ -96,13 +96,13 @@ static void MergePatchFunction(DataChunk &args, ExpressionState &state, Vector &
|
|
96
96
|
}
|
97
97
|
}
|
98
98
|
|
99
|
-
|
99
|
+
ScalarFunctionSet JSONFunctions::GetMergePatchFunction() {
|
100
100
|
ScalarFunction fun("json_merge_patch", {}, JSONCommon::JSONType(), MergePatchFunction, JSONMergePatchBind, nullptr,
|
101
101
|
nullptr, JSONFunctionLocalState::Init);
|
102
102
|
fun.varargs = LogicalType::ANY;
|
103
103
|
fun.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
104
104
|
|
105
|
-
return
|
105
|
+
return ScalarFunctionSet(fun);
|
106
106
|
}
|
107
107
|
|
108
108
|
} // namespace duckdb
|
@@ -132,7 +132,7 @@ static void JsonSerializeFunction(DataChunk &args, ExpressionState &state, Vecto
|
|
132
132
|
});
|
133
133
|
}
|
134
134
|
|
135
|
-
|
135
|
+
ScalarFunctionSet JSONFunctions::GetSerializeSqlFunction() {
|
136
136
|
ScalarFunctionSet set("json_serialize_sql");
|
137
137
|
set.AddFunction(ScalarFunction({LogicalType::VARCHAR}, JSONCommon::JSONType(), JsonSerializeFunction,
|
138
138
|
JsonSerializeBind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
@@ -150,7 +150,7 @@ CreateScalarFunctionInfo JSONFunctions::GetSerializeSqlFunction() {
|
|
150
150
|
JSONCommon::JSONType(), JsonSerializeFunction, JsonSerializeBind, nullptr, nullptr,
|
151
151
|
JSONFunctionLocalState::Init));
|
152
152
|
|
153
|
-
return
|
153
|
+
return set;
|
154
154
|
}
|
155
155
|
|
156
156
|
//----------------------------------------------------------------------
|
@@ -204,11 +204,11 @@ static void JsonDeserializeFunction(DataChunk &args, ExpressionState &state, Vec
|
|
204
204
|
});
|
205
205
|
}
|
206
206
|
|
207
|
-
|
207
|
+
ScalarFunctionSet JSONFunctions::GetDeserializeSqlFunction() {
|
208
208
|
ScalarFunctionSet set("json_deserialize_sql");
|
209
209
|
set.AddFunction(ScalarFunction({JSONCommon::JSONType()}, LogicalType::VARCHAR, JsonDeserializeFunction, nullptr,
|
210
210
|
nullptr, nullptr, JSONFunctionLocalState::Init));
|
211
|
-
return
|
211
|
+
return set;
|
212
212
|
}
|
213
213
|
|
214
214
|
//----------------------------------------------------------------------
|
@@ -223,8 +223,8 @@ static string ExecuteJsonSerializedSqlPragmaFunction(ClientContext &context, con
|
|
223
223
|
return stmt->ToString();
|
224
224
|
}
|
225
225
|
|
226
|
-
|
227
|
-
return
|
226
|
+
PragmaFunctionSet JSONFunctions::GetExecuteJsonSerializedSqlPragmaFunction() {
|
227
|
+
return PragmaFunctionSet(PragmaFunction::PragmaCall(
|
228
228
|
"json_execute_serialized_sql", ExecuteJsonSerializedSqlPragmaFunction, {LogicalType::VARCHAR}));
|
229
229
|
}
|
230
230
|
|
@@ -270,10 +270,10 @@ struct ExecuteSqlTableFunction {
|
|
270
270
|
}
|
271
271
|
};
|
272
272
|
|
273
|
-
|
273
|
+
TableFunctionSet JSONFunctions::GetExecuteJsonSerializedSqlFunction() {
|
274
274
|
TableFunction func("json_execute_serialized_sql", {LogicalType::VARCHAR}, ExecuteSqlTableFunction::Function,
|
275
275
|
ExecuteSqlTableFunction::Bind);
|
276
|
-
return
|
276
|
+
return TableFunctionSet(func);
|
277
277
|
}
|
278
278
|
|
279
279
|
} // namespace duckdb
|
@@ -476,11 +476,11 @@ static void GetStructureFunctionInternal(ScalarFunctionSet &set, const LogicalTy
|
|
476
476
|
JSONFunctionLocalState::Init));
|
477
477
|
}
|
478
478
|
|
479
|
-
|
479
|
+
ScalarFunctionSet JSONFunctions::GetStructureFunction() {
|
480
480
|
ScalarFunctionSet set("json_structure");
|
481
481
|
GetStructureFunctionInternal(set, LogicalType::VARCHAR);
|
482
482
|
GetStructureFunctionInternal(set, JSONCommon::JSONType());
|
483
|
-
return
|
483
|
+
return set;
|
484
484
|
}
|
485
485
|
|
486
486
|
static LogicalType StructureToTypeArray(ClientContext &context, const JSONStructureNode &node, const idx_t max_depth,
|
@@ -685,11 +685,11 @@ static void GetTransformFunctionInternal(ScalarFunctionSet &set, const LogicalTy
|
|
685
685
|
JSONTransformBind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
686
686
|
}
|
687
687
|
|
688
|
-
|
688
|
+
ScalarFunctionSet JSONFunctions::GetTransformFunction() {
|
689
689
|
ScalarFunctionSet set("json_transform");
|
690
690
|
GetTransformFunctionInternal(set, LogicalType::VARCHAR);
|
691
691
|
GetTransformFunctionInternal(set, JSONCommon::JSONType());
|
692
|
-
return
|
692
|
+
return set;
|
693
693
|
}
|
694
694
|
|
695
695
|
static void GetTransformStrictFunctionInternal(ScalarFunctionSet &set, const LogicalType &input_type) {
|
@@ -697,11 +697,11 @@ static void GetTransformStrictFunctionInternal(ScalarFunctionSet &set, const Log
|
|
697
697
|
JSONTransformBind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
698
698
|
}
|
699
699
|
|
700
|
-
|
700
|
+
ScalarFunctionSet JSONFunctions::GetTransformStrictFunction() {
|
701
701
|
ScalarFunctionSet set("json_transform_strict");
|
702
702
|
GetTransformStrictFunctionInternal(set, LogicalType::VARCHAR);
|
703
703
|
GetTransformStrictFunctionInternal(set, JSONCommon::JSONType());
|
704
|
-
return
|
704
|
+
return set;
|
705
705
|
}
|
706
706
|
|
707
707
|
} // namespace duckdb
|
@@ -28,12 +28,11 @@ static void GetTypeFunctionsInternal(ScalarFunctionSet &set, const LogicalType &
|
|
28
28
|
JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
|
29
29
|
}
|
30
30
|
|
31
|
-
|
31
|
+
ScalarFunctionSet JSONFunctions::GetTypeFunction() {
|
32
32
|
ScalarFunctionSet set("json_type");
|
33
33
|
GetTypeFunctionsInternal(set, LogicalType::VARCHAR);
|
34
34
|
GetTypeFunctionsInternal(set, JSONCommon::JSONType());
|
35
|
-
|
36
|
-
return CreateScalarFunctionInfo(std::move(set));
|
35
|
+
return set;
|
37
36
|
}
|
38
37
|
|
39
38
|
} // namespace duckdb
|
@@ -16,12 +16,12 @@ static void GetValidFunctionInternal(ScalarFunctionSet &set, const LogicalType &
|
|
16
16
|
nullptr, JSONFunctionLocalState::Init));
|
17
17
|
}
|
18
18
|
|
19
|
-
|
19
|
+
ScalarFunctionSet JSONFunctions::GetValidFunction() {
|
20
20
|
ScalarFunctionSet set("json_valid");
|
21
21
|
GetValidFunctionInternal(set, LogicalType::VARCHAR);
|
22
22
|
GetValidFunctionInternal(set, JSONCommon::JSONType());
|
23
23
|
|
24
|
-
return
|
24
|
+
return set;
|
25
25
|
}
|
26
26
|
|
27
27
|
} // namespace duckdb
|
@@ -293,33 +293,33 @@ TableFunction JSONFunctions::GetReadJSONTableFunction(shared_ptr<JSONScanInfo> f
|
|
293
293
|
return table_function;
|
294
294
|
}
|
295
295
|
|
296
|
-
|
296
|
+
TableFunctionSet CreateJSONFunctionInfo(string name, shared_ptr<JSONScanInfo> info, bool auto_function = false) {
|
297
297
|
auto table_function = JSONFunctions::GetReadJSONTableFunction(std::move(info));
|
298
298
|
table_function.name = std::move(name);
|
299
299
|
if (auto_function) {
|
300
300
|
table_function.named_parameters["maximum_depth"] = LogicalType::BIGINT;
|
301
301
|
}
|
302
|
-
return
|
302
|
+
return MultiFileReader::CreateFunctionSet(table_function);
|
303
303
|
}
|
304
304
|
|
305
|
-
|
305
|
+
TableFunctionSet JSONFunctions::GetReadJSONFunction() {
|
306
306
|
auto info =
|
307
307
|
make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::UNSTRUCTURED, JSONRecordType::RECORDS, false);
|
308
308
|
return CreateJSONFunctionInfo("read_json", std::move(info));
|
309
309
|
}
|
310
310
|
|
311
|
-
|
311
|
+
TableFunctionSet JSONFunctions::GetReadNDJSONFunction() {
|
312
312
|
auto info = make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED,
|
313
313
|
JSONRecordType::RECORDS, false);
|
314
314
|
return CreateJSONFunctionInfo("read_ndjson", std::move(info));
|
315
315
|
}
|
316
316
|
|
317
|
-
|
317
|
+
TableFunctionSet JSONFunctions::GetReadJSONAutoFunction() {
|
318
318
|
auto info = make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, JSONRecordType::AUTO, true);
|
319
319
|
return CreateJSONFunctionInfo("read_json_auto", std::move(info), true);
|
320
320
|
}
|
321
321
|
|
322
|
-
|
322
|
+
TableFunctionSet JSONFunctions::GetReadNDJSONAutoFunction() {
|
323
323
|
auto info =
|
324
324
|
make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, JSONRecordType::AUTO, true);
|
325
325
|
return CreateJSONFunctionInfo("read_ndjson_auto", std::move(info), true);
|