calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rui Wang (Jira)" <j...@apache.org>
Subject [jira] [Created] (CALCITE-3985) Simplify grouped window function in parser
Date Sat, 09 May 2020 18:44:00 GMT
Rui Wang created CALCITE-3985:
---------------------------------

             Summary: Simplify grouped window function in parser
                 Key: CALCITE-3985
                 URL: https://issues.apache.org/jira/browse/CALCITE-3985
             Project: Calcite
          Issue Type: Sub-task
            Reporter: Rui Wang


Currently in parser, there is [1]:


{code:java}
SqlCall GroupByWindowingCall():
{
    final Span s;
    final List<SqlNode> args;
    final SqlOperator op;
}
{
    (
        <TUMBLE>
        {
            s = span();
            op = SqlStdOperatorTable.TUMBLE_OLD;
        }
    |
        <HOP>
        {
            s = span();
            op = SqlStdOperatorTable.HOP_OLD;
        }
    |
        <SESSION>
        {
            s = span();
            op = SqlStdOperatorTable.SESSION_OLD;
        }
    )
    args = UnquantifiedFunctionParameterList(ExprContext.ACCEPT_SUB_QUERY) {
        return op.createCall(s.end(this), args);
    }
}
{code}

The s=span() are duplicates and there could be a way to keep only one s=span().

[1]: https://github.com/apache/calcite/blob/master/core/src/main/codegen/templates/Parser.jj#L6049




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message