starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

Better Trino compatibility request

Open didip opened this issue 1 year ago • 4 comments

Enhancements

First of all, Trino compatibility docs should tell users that to have the same result as Trino, this has to be set: SET global sql_mode='SORT_NULLS_LAST';

The following functionalities are not currently implemented in Trino dialect:

  • [ ] from_iso8601_timestamp()
  • [x] TO_DATE()
  • [ ] histogram()
  • [ ] array_agg()
  • [ ] regexp_split()
  • [x] replace()
  • [ ] prepare_dedup()
  • [ ] EXECUTE IMMEDIATE
  • [ ] UUID data type is also missing. e.g. cast(our_table_5.column.value as UUID) = UUID'abc123'
  • [ ] HyperLogLog data type is missing. e.g. cast(iceberg.our_table_4.total_unique as HyperLogLog)
  • [ ] Can SR run queries like this? EXECUTE statement1 USING 'abc123-uuid-pointer'

Also a few SQL issues:

  • This syntax is broken: SELECT (approx_percentile(cnt, 0.49) + approx_percentile(cnt, 0.51)) / DOUBLE '2.0'. We can easily just say 2.0, but our customers will expect this to work.
  • WHERE date between '2023-10-01' and '2023-10-01' breaks the query planner. Preferably the planner should translate that to WHERE date = '2023-10-01'.
  • WHERE 1=1 breaks the query planner. Preferably the planner should consider this as no-op.

didip avatar Dec 14 '23 18:12 didip

On the WHERE 1=1, the customer uses it to simply comment / uncomment where clauses before like this WHERE 1=1 AND date=X AND ...

winterfreshx avatar Dec 15 '23 23:12 winterfreshx

The Trino community is trying to support StarRocks connector: https://github.com/trinodb/trino/issues/17329
Thanks to @chenjian2664

hackeryang avatar Dec 27 '23 02:12 hackeryang

For what it's worth, i've implemented compatible HLL functions via Java UDF here

hhhonzik avatar Mar 26 '24 08:03 hhhonzik

I will try to work on this issue!

yangzho12138 avatar May 21 '24 03:05 yangzho12138