Skip to content

[feat] Support for JSON_TABLE#2328

Merged
manticore-projects merged 13 commits intoJSQLParser:masterfrom
ANeumann82:json_table_support
Apr 2, 2026
Merged

[feat] Support for JSON_TABLE#2328
manticore-projects merged 13 commits intoJSQLParser:masterfrom
ANeumann82:json_table_support

Conversation

@ANeumann82
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@manticore-projects manticore-projects left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work and I do appreciate your effort and dedication. Thank you much!
A few small concerns though, nothing severe just the normal German nit-picking.

Kudos and cheers!

@ANeumann82
Copy link
Copy Markdown
Contributor Author

Great work and I do appreciate your effort and dedication. Thank you much! A few small concerns though, nothing severe just the normal German nit-picking.

Kudos and cheers!

Keep the nit-picking coming :) There's still some features missing before I'll consider this PR ready for merge.

@bhupi26
Copy link
Copy Markdown

bhupi26 commented Oct 31, 2025

_ No description provided. _

@ANeumann82 Great Work!! Can you please let me know the ETA for this change

@manticore-projects
Copy link
Copy Markdown
Contributor

@ANeumann82: How can we move this forward together? What assistance can I provide please?

# Conflicts:
#	src/main/java/net/sf/jsqlparser/util/deparser/ExpressionDeParser.java
#	src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
@ANeumann82
Copy link
Copy Markdown
Contributor Author

@manticore-projects Sorry for the long silence. I've been into a rabbit hole of JavaCC and other parsers...

I've updated the PR from the master branch, but now I get "code too large" in the generated "CCJsqlParserTokenManager.java".

Do you have any idea to work around that problem?

I don't know if there's anything we can do about that with the current JavaCC version. I'm currently looking into alternative parsers to maybe replace JavaCC in JSQLParser at some point, but that's not easy.

@manticore-projects
Copy link
Copy Markdown
Contributor

@manticore-projects Sorry for the long silence. I've been into a rabbit hole of JavaCC and other parsers...

Have done that, have been there and you are welcome.
(I needed a proper SQL panel for our ETL Software, which made me dive into JSQLFormatter, which made me dive into JSQLParser, which made me dive into JavaCC -- and all I wanted was to move some data for our clients.)

I've updated the PR from the master branch, but now I get "code too large" in the generated "CCJsqlParserTokenManager.java".

I will lodge a case with the JavaCC team, maybe they can help.

Do you have any idea to work around that problem?

We have too many token apparently. I want to check first if the JavaCC team can help.
Otherwise we need to refactor the Grammar and avoid any useless token that is used not more than one time and in too specific productions only. I have had a deep discussion on that with the JavaCC team before on this topic.

I don't know if there's anything we can do about that with the current JavaCC version. I'm currently looking into alternative parsers to maybe replace JavaCC in JSQLParser at some point, but that's not easy.

I am most interested in this one too and dug deep already. Unfortunately there is not really any good alternative, but maybe CongoCC. Unfortunately there are some social issues around this project (or maybe with me). And also there still seems to be a (small?) performance penalty in the generated parser.

@manticore-projects
Copy link
Copy Markdown
Contributor

Do you have any idea to work around that problem?

I am reworking the Tokens and the Reserved Keywords as we speak to free up the token manager.

@manticore-projects
Copy link
Copy Markdown
Contributor

Greetings @ANeumann82, as promised I have completely reworked the token handling.
This should solve the "code too large" problem once and for all. We also have achieved much better performance.

So we should be able to proceed with your PR please.
@dengliming: in case you get bored and look for a challenge :-D

@dengliming
Copy link
Copy Markdown
Contributor

Haha, thanks for the ping! :) I only took a quick look through this PR, but my main concern is more about the overall direction than the style details. Current master already seems to model JSON_TABLE through TableFunction/JsonTableFunction together with newer token handling, while this branch introduces a separate JsonTable FromItem path and expands the older token setup again.

It may be worth considering whether the remaining JSON_TABLE support here could be folded into the existing master-side model instead of keeping two parallel representations. That looks like it could simplify the visitor/deparser/validator side and may also help avoid running back into the older TokenManager size issues.

@ANeumann82
Copy link
Copy Markdown
Contributor Author

Hey @manticore-projects, thanks for the update. I'll take a look at this in the coming week or so.

@dengliming Yeah, I'll have to take a look at that. Seems like there was some JSON_TABLE functionality added a couple weeks ago, while my PR is a bit older. I'll take a look if and how I can consolidate that.

@ANeumann82 ANeumann82 marked this pull request as ready for review April 1, 2026 19:49
@manticore-projects
Copy link
Copy Markdown
Contributor

manticore-projects commented Apr 1, 2026

Greetings!

We are running to /home/runner/work/JSqlParser/JSqlParser/build/generated/javacc/net/sf/jsqlparser/parser/CCJSqlParserTokenManager.java:55: error: code too large issue again?!
How/where have you tested it?

@ANeumann82
Copy link
Copy Markdown
Contributor Author

Yeah, i've only tested it before I merged the latest changes from master into my branch. I've just fixed that. It's not nice, but it seems to work.

@ANeumann82
Copy link
Copy Markdown
Contributor Author

I'll take a look at the static code analysis issues tomorrow, not sure about the ubuntu-latest compile error though.

Copy link
Copy Markdown
Contributor

@manticore-projects manticore-projects left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff and work overall.
I only have 1 question on the grammar and it is optional. If there is no quick improvement possible, we could just go ahead.

(Ignore the Maven failures please, I will rip out this old garbage very soon anyways.)

@manticore-projects
Copy link
Copy Markdown
Contributor

@ANeumann82: I would like to thank you very much for your work and effort, this is quite a chunk!

@manticore-projects
Copy link
Copy Markdown
Contributor

Big thank you again!

@manticore-projects manticore-projects merged commit c5e2fdc into JSQLParser:master Apr 2, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants