GoogleCloudPlatform / bigquery-utils

Useful scripts, udfs, views, and other utilities for migration and data warehouse operations in BigQuery.
https://cloud.google.com/bigquery/
Apache License 2.0
1.07k stars 269 forks source link

Translation Engine UDF for array stable distinct helper. #352

Closed damian-compilerworks closed 1 year ago

damian-compilerworks commented 1 year ago

It's very generic, but for new we're only going to need it for emulation of array aggregate functions on distinct values with ordering.

danieldeleo commented 1 year ago

I just noticed the cw_ UDFs are not in alphabetical order in the README, could you please sort them as shown below? Thanks!

cw_array_compact
cw_array_distinct
cw_array_max
cw_array_median
cw_array_min
cw_array_overlap
cw_array_stable_distinct
cw_comparable_format_bigint
cw_comparable_format_bigint_t
cw_comparable_format_varchar
cw_comparable_format_varchar_t
cw_convert_base
cw_csvld
cw_editdistance
cw_error_number
cw_error_severity
cw_error_state
cw_find_in_list
cw_from_base
cw_getbit
cw_initcap
cw_instr4
cw_json_array_contains_bool
cw_json_array_contains_num
cw_json_array_contains_str
cw_json_array_get
cw_json_array_length
cw_json_enumerate_array
cw_lower_case_ascii_only
cw_map_create
cw_map_get
cw_map_parse
cw_months_between
cw_next_day
cw_nvp2json1
cw_nvp2json3
cw_nvp2json4
cw_otranslate
cw_period_intersection
cw_period_ldiff
cw_period_rdiff
cw_regex_mode
cw_regexp_extract
cw_regexp_extract_all
cw_regexp_extract_all_n
cw_regexp_extract_n
cw_regexp_instr_2
cw_regexp_instr_3
cw_regexp_instr_4
cw_regexp_instr_5
cw_regexp_instr_6
cw_regexp_instr_generic
cw_regexp_replace_4
cw_regexp_replace_5
cw_regexp_replace_6
cw_regexp_replace_generic
cw_regexp_split
cw_regexp_substr_4
cw_regexp_substr_5
cw_regexp_substr_6
cw_regexp_substr_generic
cw_round_half_even
cw_round_half_even_bignumeric
cw_runtime_parse_interval_seconds
cw_setbit
cw_stringify_interval
cw_strtok
cw_substrb
cw_substring_index
cw_td_nvp
cw_threegrams
cw_to_base
cw_ts_overlap_buckets
cw_ts_pattern_match
cw_twograms
cw_url_decode
cw_url_encode
cw_url_extract_authority
cw_url_extract_file
cw_url_extract_fragment
cw_url_extract_host
cw_url_extract_parameter
cw_url_extract_path
cw_url_extract_port
cw_url_extract_protocol
cw_url_extract_query
damian-compilerworks commented 1 year ago

Thank you Daniel! It's now sorted.