Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-23036

Fix parsing of NXQL ES hint with dash (-) in property name

    XMLWordPrintable

    Details

      Description

      Parsing this NXQL fails:

      SELECT * FROM Document WHERE /*+ES: INDEX(my-schema:article.author) */ my-schema:article/author = 'foo'

      org.nuxeo.ecm.core.query.QueryParseException: Lexical Error: Illegal character <-> at offset 44
      	at org.nuxeo.ecm.core.query.sql.parser.Scanner.scanError(Scanner.java:888)
      	at org.nuxeo.ecm.core.query.sql.parser.Scanner.next_token(Scanner.java:1329)
      	at java_cup.runtime.lr_parser.scan(lr_parser.java:335)
      	at java_cup.runtime.lr_parser.parse(lr_parser.java:563)
      	at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:43)
      	at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:52)
      

      The issue is with the hint parser itself, which fails to accept dashes in the syntax for properties in Elasticsearch hints.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h