[ 
https://issues.apache.org/jira/browse/CALCITE-6820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17936525#comment-17936525
 ] 

Caican Cai edited comment on CALCITE-6820 at 3/18/25 2:49 PM:
--------------------------------------------------------------

[~asolimando][~julianhyde] Maybe I need some advice, because there are 
currently two similar jira cases, one is the adaptation of the trino dialect, 
and the other is the adaptation of the doris dialect. They both reuse the tests 
of presto and starrocks respectively. I am not sure whether this approach is 
appropriate.

Doris's Jira Case https://issues.apache.org/jira/browse/CALCITE-6888


was (Author: JIRAUSER302115):
[~asolimando][~julianhyde] Maybe I need some advice, because there are 
currently two similar jira cases, one is the adaptation of the trino dialect, 
and the other is the adaptation of the doris dialect. They both reuse the tests 
of presto and starrocks respectively. I am not sure whether this approach is 
appropriate.

> Trino dialect implementation
> ----------------------------
>
>                 Key: CALCITE-6820
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6820
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.38.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.40.0
>
>
> Currently calcite not support dialect sql for trino, need to support it.
>  
> Main differences such as:
> *select syntax*
> Trino support *fetch offset* but Presto not support the syntax
> Trino [https://trino.io/docs/current/sql/select.html:]
> [ WITH SESSION [ name = expression [, ...] ]
> [ WITH [ FUNCTION udf ] [, ...] ]
> [ WITH [ RECURSIVE ] with_query [, ...] ]
> SELECT [ ALL | DISTINCT ] select_expression [, ...]
> [ FROM from_item [, ...] ]
> [ WHERE condition ]
> [ GROUP BY [ ALL | DISTINCT ] grouping_element [, ...] ]
> [ HAVING condition]
> [ WINDOW window_definition_list]
> [ \{ UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select ]
> [ ORDER BY expression [ ASC | DESC ] [, ...] ]
> [ OFFSET count [ ROW | ROWS ] ]
> [ LIMIT \{ count | ALL } ]
> *[ FETCH \{ FIRST | NEXT } [ count ] \{ ROW | ROWS } \{ ONLY | WITH TIES } ]*
>  
> Presto([https://prestodb.io/docs/current/sql/select.html):]
> [ WITH with_query [, ...] ] SELECT [ ALL | DISTINCT ] select_expr [, ...] [ 
> FROM from_item [, ...] ] [ WHERE condition ] [ GROUP BY [ ALL | DISTINCT ] 
> grouping_element [, ...] ] [ HAVING condition] [ \{ UNION | INTERSECT | 
> EXCEPT } [ ALL | DISTINCT ] select ] [ ORDER BY expression [ ASC | DESC ] [, 
> ...] ] [ OFFSET count [ \{ ROW | ROWS } ] ] [ \{ LIMIT [ count | ALL ] } ]
>  
> *functions:*
> Trino support substring and substr function, but Presto only support substr 
> function
> Trino:    [https://trino.io/docs/current/functions/string.html]
> Presto:  [https://prestodb.io/docs/current/functions/string.html]
>  
> This is just what I know, there are more. I plan submit more PRs to support 
> gradually in future.This pr of issue aim to support Trino Dialect firstly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to