peng wu created CALCITE-6558:
--------------------------------

             Summary: zero literal is appended as a paramer for FIRST/LAST but 
it is not desired
                 Key: CALCITE-6558
                 URL: https://issues.apache.org/jira/browse/CALCITE-6558
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.32.0
            Reporter: peng wu


give the sql parser s simple input:
{code:java}
first(`my_column`){code}
After the SQL string is parsed as SqlNode, then an extra parameter is added to 
the first function, and the sql becomes:
{code:java}
first(`my_column`, 0) {code}
Error would be thrown when the above sql is executed.

>From the source code, we can see that the FIRST/LAST functions are classified 
>as Match Recognize Navigation function but I cannot understand why this zero 
>literal is appended.
{code:java}
public class SqlParserImpl {
   final public SqlCall MatchRecognizeNavigationLogical() throws ParseException 
{
  ...
  default:     
    jj_la1[357] = jj_gen;
    args.add(LITERAL_ZERO);
 }
}{code}
 

 



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

Reply via email to