-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor Parenthesed SelectBody and FromItem #1754
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
Merged
wumpz
merged 59 commits into
JSQLParser:master
from
manticore-projects:ParenthesedSelectBody
Apr 27, 2023
Merged
Refactor Parenthesed SelectBody and FromItem #1754
wumpz
merged 59 commits into
JSQLParser:master
from
manticore-projects:ParenthesedSelectBody
Apr 27, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…RESH Support parsing create view statements in Redshift with AUTO REFRESH option.
Extract adding the force option into a dedicated method resulting in the cyclomatic complexity reduction of the CreateView.toString method.
Add Keywords and document, which keywords are allowed for what purpose
Derive All Keywords from Grammar directly Generate production for Object Names (semi-) automatically Add parametrized Keyword Tests
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
Update the MANTICORE Sphinx Theme, but ignore it in GIT Add the content to the Sphinx sites Add a Gradle function to derive Stable and Snapshot version from GIT Tags Add a Gradle GIT change task Add a Gradle sphinx task Add a special Test case for illustrating the use of JSQLParser
Implement Serializable for persisting via ObjectOutputStream
- apply neutral Sphinx theme - insert the RR diagrams into the sphinx sources - better documentation on Gradle dependencies - link GitHub repository
- add support for Oracle Alternative Quoting e.g. `q'(...)'` - fixes JSQLParser#1718 - add a Logo and FavIcon to the Website - document recent changes on Quoting/Escaping - add an example on building SQL from Java - rework the README.md, promote the Website - add Spotless Formatter, using Google Java Style (with Tab=4 Spaces)
- Merge PR JSQLParser#1691, fixes JSQLParser#1684 all credits go to @zaza
- fix the issue template - fix the -SNAPSHOT version number
- `GO` - Slash `/` - Two empty lines
- `FETCH` uses `EXPRESSION` instead of SimpleJDBCParameter only - Visit/Accept `FETCH` `EXPRESSION` instead of `append` to String - Visit/Accept `OFFSET` `EXPRESSION` instead of `append` to String - Gradle: remove obsolete/incompatible `jvmArgs` from Test()
- First properly working version - Work in progress, 13 tests failing
- delete unneeded ParenthesedJoin - rename ParenthesisFromItem into ParenthesedFromItem
- fix `NULLS FIRST` and `NULLS LAST`
- fix Oracle Hints
- parse `SetOperation` only after a (first plain) SelectBody has found, this fixes the performance issue - one more special Oracle Test succeeds - 5 remaining test failures
- extract `OrderByElements` into `SelectBody` - one more special Oracle Test succeeds - all tests succeed
- `SelectBody` implements `FromItem` - get rid of `SubSelect` and `SpecialSubSelect` - `Merge` can use `FromItem` instead of `SubSelect` or `Table` - `LateralSubSelect` extends `ParenthesedSelectBody` directly - Simplify the `Select` statement, although it is still redundant since `SelectBody` also could implement `Statement` directly - `WithItem` can use `SelectBody` directly, which allows for nested `WithItems` BREAKING-CHANGE: Lots of redundant methods and intermediate removed
- `SelectBody` implements `Statement` and so makes `Select` redundant - get rid of `ValuesList` - refactor `ValuesStatement` into `Values` which just implements `SelectBody` (and becomes a `Statement` and a `FromItem`), move to `select` package BREAKING-CHANGE: Lots of redundant methods and intermediate removed
- remove 3 unused/obsolete productions - appease PMD/Codacy
- former `SelectBody` implements `Statement` and so becomes `Select` - this reduces the AST by 1 hierarchy level
Can we move this forward please since it is quite a big chunk? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a heavy API breaking refactoring on the bracket-handling related to
SelectBody
,FromItem
andOperationSet
,SubSelect
,WithItem
:SubSelect
,SpecialSubSelect
,SubJoin
,SubJoinList
,SetOperationListWithoutIntialSelect
,ValuesList
)It should warrant a major Version JSQLParser-5.0 and also people should properly test it before.
Goal:
moveJoinList
fromPlainSelect
toFromItem
(since there can't be aJoin
without aFrom
)SelectBody
replacesSubSelect
and implementsFromItem
directlyThis has the big advantaged, that any occurrence of
( table=Table() | subSelect=SubSelect() )
can be parsed asfromItem=FromItem()
withoutLOOKAHEAD
(for exampleMerge
parses a simpleFromItem
now)SelectBody
implementsStatement
directly and so becomes theSelect
Statement (removing 1 hierarchy level from the AST):LateralSubSelect
extendsParenthesedSelectBody
(axingSubSelect
andSpecialSubSelect
)values.ValuesStatement
becomesselect.Values
implementingSelectBody
(withStatement
andFromItem
). So we got rid ofValuesList
move
ORDER BY
,LIMIT
,OFFSET
,FETCH
,WITH isolation
intoSelectBody
since all its implementations support itNested WithItems
Merge
implements the Visitor Patternall the Tests succeed
verify/validate performance. It is a little bit slower but much more correct.
Fixes #1737
Fixes #1764
Succeeds on another Special Oracle Test
Condition15
Succeeds on another Special Oracle Test
Cast_MultiSet07
@wumpz Please start reviewing and provide feedback as early as possible.