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
{{ message }}
Repository navigation
[BUG] JSQLParser Version 4.7 : WithItems moved inside Select #1895
I'm not sure is it a bug or feature, but unfortunately it breaks our current behavior. After migration from 4.5 to 4.7 the query WITH events as (select * from table1) select t1 from events is parsed with select body including WithItems. In previous versions Select.getSelectBody() was returning select without WithItems.
So Select.getSelectBody (I know it is deprecated) will result different in 4.5 and 4.7:
4.5: select t1 from events
4.7 WITH events as (select * from table1) select t1 from events
I see that Select structure was changed:
In 4.5 there was separately selectBody and withItems
In 4.7 withItems are included into select
The question:
Can I get select without WithItems (like it was in 4.5)?
SQL Example:
Simplified Query Example, focusing on the failing feature
WITH events as (
select * from table1
)
select t1
from events
Software Information:
JSqlParser version 4.7
Tips:
The same query has different structure in different versions of parser
Thank you for your question. Although I have read it carefully three time and I am still not sure what your are asking for.
With JSQLParser-4.7 your AST will look like shown below. Your can try this by yourself online and interactively.
Are you trying to to eliminate the With clause from the PlainSelect? If so, then why not just ignore the PlainSelect's property withItemsList or set it to NULL (in case your are rewriting).
Activity
manticore-projects commentedon Nov 26, 2023
Greetings!
Thank you for your question. Although I have read it carefully three time and I am still not sure what your are asking for.
With JSQLParser-4.7 your AST will look like shown below. Your can try this by yourself online and interactively.
Are you trying to to eliminate the
Withclause from thePlainSelect? If so, then why not just ignore thePlainSelect's propertywithItemsListor set it toNULL(in case your are rewriting).manticore-projects commentedon Nov 26, 2023
Here is the Java API for
PlainSelectshowing how to modify thewithItemsListproperty:https://manticore-projects.com/JSQLParser/javadoc_stable.html#select