Skip to content

[BUG] JSQLParser 5.1 : Oracle : special table function JSON_TABLE #2185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
baliure opened this issue Mar 14, 2025 · 1 comment
Open

[BUG] JSQLParser 5.1 : Oracle : special table function JSON_TABLE #2185

baliure opened this issue Mar 14, 2025 · 1 comment

Comments

@baliure
Copy link

baliure commented Mar 14, 2025

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram

Failing SQL Feature:

  • CASE WHEN EXISTS can't be parsed

SQL Example:

SELECT id,
RECORD_ID,
MODULE_ID,
PAGE_ID,
TO_CHAR(MODIFY_DATE, 'yyyy-MM-dd') MODIFY_DATE_STR,
CASE WHEN EXISTS (SELECT 0 FROM JSON_TABLE(READ_USER, '$[*]' COLUMNS(value NUMBER(20) PATH '$'))
WHERE value = '-110') THEN
'已读'
ELSE
'未读'
END READ_STATUS

from BMSSETT.VERSION_RECORD_DETAIL

Software Information:

  • JSqlParser version 4.6-5.1
  • Database (Oracle 19c)

Tips:

net.sf.jsqlparser.JSQLParserException: Time out occurred.
SELECT id, RECORD_ID, MODULE_ID, PAGE_ID, TO_CHAR(MODIFY_DATE, 'yyyy-MM-dd') MODIFY_DATE_STR, CASE WHEN EXISTS (SELECT 0 FROM JSON_TABLE(READ_USER, '$[*]' COLUMNS(value NUMBER(20) PATH '$')) WHERE value = '-110') THEN '已读' ELSE '未读' END READ_STATUS from BMSSETT.VERSION_RECORD_DETAIL
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:261)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:81)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:47)
at cn.dazd.utils.jsqlparser.SqlOptimize.onlyQueryColumn(SqlOptimize.java:240)
at cn.dazd.utils.jsqlparser.SqlOptimize.onlyQueryColumn(SqlOptimize.java:254)
at cn.dazd.utils.jsqlparser.SqlOptimizeTestMain.main(SqlOptimizeTestMain.java:59)
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:205)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:258)
... 5 more

@manticore-projects
Copy link
Contributor

Greetings.

Its not about the Exists but about the special table function JSON_TABLE which is not supported.

@manticore-projects manticore-projects changed the title [BUG] JSQLParser Version : RDBMS : failing feature description [BUG] JSQLParser 5.1 : Oracle : special table function JSON_TABLE Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants