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

Allow DATE, TIME, TIMESTAMP, INTERVAL literals in BigQuery dialect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.31.0
    • None

    Description

      Parser configured with BigQuery dialect cannot parse timestamp literal.

      It looks like CALCITE-4247 creates a special string literal token for BigQuery. But that means that (AFAICT) Parser.jj then does not find the expected token type after a TIMESTAMP to make a timestamp literal, so something as simple as

      SqlParser.create("SELECT TIMESTAMP '2018-02-17 13:22:04'", BigQuerySqlDialect.DEFAULT.configureParser(SqlParser.config())).parseQuery() 

      fails.

      Probably most other places in Parser.jj that use the "<QUOTED_STRING>" token suffer from the same issue.

      Attachments

        Issue Links

          Activity

            People

              wenruimeng Wenrui Meng
              swtalbot Steven Talbot
              Votes:
              2 Vote for this issue
              Watchers:
              7 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 40m
                  1h 40m