kz930 opened a new issue, #8074:
URL: https://github.com/apache/texera/issues/8074

   ### What happened?
   
   The operator hands the typed value straight to Lucene's query parser:
   
   ```scala
   @transient lazy val query: Query = new QueryParser(desc.attribute, 
analyzer).parse(desc.keyword)
   ```
   
   The parser's lexer reads a double quote as opening a phrase, so a value 
carrying one on its own never terminates it and `parse` throws before a single 
row is read. The run ends with the error below. The form accepted the value 
without objection: the field declares only `minLength: 1`.
   
   I checked this against Lucene 8.7's QueryParser, the version the executor 
uses. `he"llo` throws and `"a b"` parses as a phrase, so it is the pairing 
rather than the character that decides.
   
   I expected the field to say what it takes. The keyword is a Lucene query, 
and the pairing rule is one the schema can state: a pattern that allows any 
number of quoted spans and rejects a lone quote. Other Texera fields already 
declare what they accept this way, for instance the chart colour settings.
   
   It is not the only value the parser refuses. `wine(` and `foo)` throw as 
well. Those are not statable the same way: which uses of a parenthesis parse 
depends on what follows, and a pattern strict enough to catch them would reject 
the grouped queries that work today.
   
   ### How to reproduce?
   
   1. Any table with a text column.
   2. Connect Keyword Search, point it at that column, and type `he"llo` as the 
keyword.
   3. Run.
   
   ### Version/Branch
   
   1.3.0-incubating-SNAPSHOT (main)
   
   ### Relevant log output
   
   ```shell
   org.apache.lucene.queryparser.classic.ParseException: Cannot parse 'he"llo': 
Lexical error at line 1, column 7.  Encountered: <EOF> after : "\"llo"
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to