wren-engine icon indicating copy to clipboard operation
wren-engine copied to clipboard

test(ibis): add supporting functions test for BigQuery data source

Open goldmedal opened this issue 1 year ago • 1 comments

Description

We need to have a white list of functions for each data source. In this PR, we add function tests for BigQuery according to trino functions list to check what we can use.

In this PR, I commanded out the unsupported functions. They can't handled well by sqlglot.

We won't merge this PR because there're some issues about formatting trino SQL and the tests aren't qualified.

Test Result - Function White List

Date and Time Functions

  • current_date
  • current_timestamp
  • date
  • date_add
  • date_diff
  • date_format
  • date_parse
  • date_trunc
  • from_unixtime
  • now

Aggregate Functions

  • any_value
  • approx_distinct
  • arbitrary
  • array_agg
  • avg
  • bool_and
  • bool_or
  • count
  • count_if
  • max
  • max_by
  • min
  • min_by
  • sum

Math Functions

  • greatest
  • least
  • abs
  • acos
  • asin
  • atan
  • atan2
  • cbrt
  • ceil
  • cos
  • cosh
  • exp
  • floor
  • is_nan
  • ln
  • log
  • log10
  • mod
  • power
  • round
  • sign
  • sin
  • sinh
  • sqrt
  • tan
  • tanh

String Functions

  • chr
  • concat
  • format
  • length
  • lower
  • lpad
  • ltrim
  • replace
  • reverse
  • rpad
  • rtrim
  • soundex
  • split
  • substr
  • substring
  • translate
  • trim
  • upper

Operators

  • Arithmetic Operators: +, -, *, /, %
  • Array Access Operator: []
  • Concatenation Operator: ||
  • Comparison Operators: <, >, <=, >=, =, <>, !=

goldmedal avatar Aug 08 '24 04:08 goldmedal

Thanks @goldmedal. Would you mind adding comments or descriptions for codes that are commented out to explain what happened to them?

grieve54706 avatar Aug 09 '24 02:08 grieve54706