Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2993

ParseException may be thrown for legal SQL queries due to incorrect "LOOKAHEAD(1)" hints

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.20.0
    • None

    Description

      In some cases, ParseException is thrown incorrectly:

      Case 1

      select lead(x) ignore from t -- "ignore" aliases "lead(x)"
      

      Case 2

      select *
        from t match_recognize
        (
           after match skip to last -- "last" is a identifier. This is the implicit form of "skip to last last"
          pattern (strt down+ up+)
          define
            down as down.price < PREV(down.price),
            up as up.price > prev(up.price)
        ) mr
      

      Case 3

      select json_object(key: value) from t -- "key"/"value" are both column names.
      

      And the failure on Case 1 is introduced by the fix of CALCITE-2847, Case 2/3 are not.

      Attachments

        Issue Links

          Activity

            People

              zhztheplayer Hongze Zhang
              zhztheplayer Hongze Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m