You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to parse custom SQL using the parse function. Since users can write the SQL freely, we have no influence on the keywords used. Currently, the parsing of the query fails when the keyword selectivity is used.
Possible solution you'd like to see:
Here is a minimal test setup with DB2 standard tables:
org.jooq.impl.ParserException: Unexpected clause: [1:80] ...m sysibm.syscolumns WHERE TBCREATOR like 'SYS%' [*]selectivity 1
at org.jooq.impl.DefaultParseContext.exception(ParserImpl.java:14129)
at org.jooq.impl.DefaultParseContext.done(ParserImpl.java:14315)
at org.jooq.impl.DefaultParseContext.lambda$parseQuery0$2(ParserImpl.java:936)
at org.jooq.impl.DefaultParseContext.wrap(ParserImpl.java:14322)
at org.jooq.impl.DefaultParseContext.parseQuery0(ParserImpl.java:936)
at org.jooq.impl.ParserImpl.parseQuery(ParserImpl.java:753)
at org.jooq.impl.ParserImpl.parseQuery(ParserImpl.java:748)
Possible workarounds:
I have tried to implement a workaround via ParseListener, but I have not been able to do it.
Versions:
jOOQ: 3.17.1
Java: 1.8
Database (include vendor): DB2 v.11.5.7.0
OS:
JDBC Driver (include name if unofficial driver):
The text was updated successfully, but these errors were encountered:
Thanks a lot for your feature request. Parsing custom operators is indeed a bit tricky right now using the ParseListener. There's a pending feature request for this: #12339. We'll have to sort out operator precedence for that, so there are still a few open questions.
The simplest workaround for you right now is to implement ParseListener::parseStart and just regex-replace any (?i:SELECTIVITY \d\.\d) regular expression.
Starting from jOOQ 3.18, we'll parse this and just ignore the operator. As such, operator precedence might not be too important. It's not quite clear from the documentation what the precedence is...
Use case:
We want to parse custom SQL using the
parse
function. Since users can write the SQL freely, we have no influence on the keywords used. Currently, the parsing of the query fails when the keywordselectivity
is used.Possible solution you'd like to see:
Here is a minimal test setup with DB2 standard tables:
The following error is currently thrown
Possible workarounds:
I have tried to implement a workaround via
ParseListener
, but I have not been able to do it.Versions:
The text was updated successfully, but these errors were encountered: