GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JSQLParser 5.0 by manticore-projects · Pull Request #1778 · JSQLParser/JSqlParser

Conversation

@manticore-projects

@manticore-projects manticore-projects commented Apr 29, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  1. Lateral View
    Implement LATERAL VIEW EXPLODE(...) according to https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-lateral-view.html#syntax
    Add proper tests

    • Fixes [FEATURE] lateral view #1777
    • Fixes While SQL Statement Contains lateral view explode JSQLParser throw an exception #239
    • Fixes Can you support "lateral view explode" #1723
    • Fixes lateral view explode support? #704
    • Fixes no support lateral view grammar #470
  2. Multipart Variables and NamedParameters

    • Fixes [FEATURE] support set with dotted name #1771
    • Fixes [BUG] JSQLParser Version : 4.6 : If there is a '.' in JdbcNamedParameter, parsing will fail! #1768
  3. Clickhouse SELECT ... FROM ... FINAL modifier

    • Fixes [BUG] JSQLParser Version : 4.6,RDBMS : Clickhouse, Parsing a query with table alias and final keyword fails #1770
    • Fixes [BUG] "WITH" item using "GROUP BY" clause cannot be parsed #1774
  4. Test if a JOIN is an INNER JOIN according to the SQL:2016

    • provides new isInnerJoin() method for detecting qualified INNER JOIN (with either INNER keyword or without LEFT or RIGHT, CROSS, NATURAL keywords)
    • Fixes [BUG] "(INNER) JOIN" is not recognized by isInner() method #1775
  5. Implement SQL:2016 Convert() and Trim()

    • Fixes postgresql TRIM not fully supported? #868
    • Fixes [BUG] JSQLParser Version : 4.6 : please add convert() support #1767
    • Fixes CONVERT() - data type is wrongfully parsed as a column #644
    • Fixes Special Oracle Test function03.sql
    • Fixes [mysql] can't parse convert function in order by clause #688
    • Fixes JSqlParser doesn't support convert function used as converting a value to a specified character set #1257
  6. ClickHouse LIMIT ... BY ... clause

    • LimitDeparser accepts ExpressionVisitor
    • SELECT can have optional LIMIT ... BY ... clause
    • Fixes Clickhouse LIMIT BY is not supported  #1436
  7. Refactor SelectExpressionItem into SelectItem and remove SelectExpressionItem after

    • breaks API
    • but saves a lot of unnecessary complexity and code
    • update the Use examples
    • fixes use interface in ColumnDefinition #1367
  8. Consolidate the ExpressionList, removing many redundant List alike Classes and Productions

    • ExpressionList extends a List<Expression> directly and implements Expression
    • ExpressionList has no Brackets
    • introduce ParenthesedExpressionList which extends ExpressionList and has Brackets
    • refactor MultiExpressionList to extend List<ExpressionList>
    • replace any occurrence of List<Expression> with ExpressionList and remove lots of redundant Productions
    • RowConstructor extends ExpressionList
    • remove redundant ValueExpressionList (it was just an ExpressionList
    • get rid of any useBrackets flags
    • consolidate the Cast Functions
    • use ExpressionListDeparser as much as possible
    • Special Oracle Test 'function06.sql' succeeds
    • Enums are assigned case-insensitve, remove duplicate Enum TimeUnit in KSQLJoinWindow, fixes [BUG] JSQLParser 4.7-SNAPSHOT(+4.6) PostgreSQL(+others) Enum error on ReferentialAction.Type.valueOf() when delete/update keyword is lowercase #1779
    • Refactor UpdateSets for Update and InsertConflictTarget, remove redundancy

BREAKING-CHANGE: All List<Expression> and List<Column> related methods have changed. No useBrackets flags, instead use ParenthesedExpressionList when brackets are needed.

  1. Remove ItemsList, MultiExpressionList, Replace
    Since we have proper ExpressionList implementing Expression we can narrow down the API:

    • remove ItemsList, ItemsListVisitor, ItemsListValidator in favor of ExpressionList
    • remove MultiExpressionList in favor of ExpressionList
    • refactor NamedExpressionList so it extends ExpressionList and uses ExpressionListDeparser
    • simplify InExpression and AnyComparisionExpression

BREAKING-CHANGE: many Classes and Methods removed.

  1. Refactor all occurrences of List<Expression> Statement and (re-)use ExpressionList and UpdateSet, enforce policy via Acceptance Test

    • Insert
    • Upsert
    • Merge
    • Set Statement
    • Pivot, Unpivot, `Limit

BREAKING-CHANGE: many Classes and Methods removed.
BREAKING-CHANGE: removed the Getters/Setters for only Column or only Expression (since Column and Expression belong together)

Please consider any use of List<Expression> an Anti-Pattern tainting the Grammar. The scanner found 20 occurrences and they were all bloated and inefficient.

  1. generic SelectItem and remove FunctionItem and ExpressionListItem

    • generify SelectItem<T extends Expression>
    • replace FunctionItem with SelectItem<Function>
    • replace ExpressionListItem with SelectItem<ExpressionList>
    • appease PMD/Codacy

** Breaking Changes ** Getters/Setters of Pivot, UnPivot, PivotXML have changed

  1. more fixed issues

    • JdbcNamedParameter allows & (instead of :), fixes [BUG] statement with input user parameter cannot be parsed #1785

    • access Elements of Array Columns like update utilisateur set listes[0] = 1

      • fixes SQL "update" statement does not recognize queries as array indexes #1083
      • fixes [BUG] JSQLParser 4.6 : Cassandra : No table to parse map data type select query #1757
    • add MEMBER OF condition, fixes Encountered unexpected token: "member" #1631

    • allow START keyword as table CreateParameter, fixes [FEATURE] missing feature description START WITH NN in ORACLE throws a JSQLParserException #1791

    • allow CREATE TABLE ... column parameter with Postgres' nextval('public.actor_actor_id_seq'::regclass)

      • fixes [BUG] JSQLParser Version 4.6 - PostgreSQL: "::" notation not supported in nextval #1789
      • fixes PostgreSQL nextval() #1098
      • fixes CREATE TABLE - default-values on columns #1022
      • fixes PostgreSQL [create table DDL ] parse geometry field fail #1121
      • fixes sqlParser.Statements() falied #513
    • refactor SHOW, CREATE and ALTER statements, returning any RDBMS specific implementation as UnsupportedStatement

      • fixes Exception parsing show statement #1702
      • fixes [FEATURE] missing feature description show create table my_table #1790
      • fixes ALTER INDEX sql cannot be parsed #1515
      • fixes CREATE TRIGGER sql queries do NOT get parsed nor validated. #1453
      • fixes Exception with 'Create Domain' statements #1090, parse CREATE TRIGGER as UnsupportedStatement
    • refactor: RETURNING clause, supports Oracle's RETURN ... INTO ...

      • fixes Support "RETURNING INTO" part of Insert/Update/Delete statement #1780
      • fixes Oracle RETURNING INTO Clause problem #686
      • Special Oracle tests insert11.sql and insert12.sql
    • feat: chaining and parenthesed JSON Expressions

      • supports chains like '{"obj":{"field": "value"}}'::JSON -> 'obj'::TEXT ->> 'field'::TEXT
      • fixes [BUG] JSQLParser 4.6 : PostgreSQL : CPU burn when parsing certain queries #1792, including the very complex sample query
    • fix: parsing multiple statements incl. CREATE FUNCTION ... or CREATE PROCEDURE ...

      • parse tokens to the END; or $$...; (but not to the EOF)
      • fixes Several create function statements are stuck in a single statement #1477
    • feat: Quoted Identifiers can contain double-quotes (PostgreSQL)

      • SELECT "test""column""name"
      • fixes Postgres identifiers with double quotes not supported #1335
  2. Integrate Java API Doc into the website, Preview

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zaza and others added 30 commits December 11, 2022 21:03
@zaza
Fixes JSQLParser#1684: Support CREATE MATERIALIZED VIEW with AUTO REF…
747152a
…RESH

Support parsing create view statements in Redshift with AUTO REFRESH
option.
@zaza
Merge branch 'master' into 1684-create-mv-auto-refresh
9e09005
@zaza
Reduce cyclomatic complexity in CreateView.toString
ea4477b
Extract adding the force option into a dedicated method resulting in the
cyclomatic complexity reduction of the CreateView.toString method.
@manticore-projects
Enhanced Keywords
b5321d6
Add Keywords and document, which keywords are allowed for what purpose
@manticore-projects
Fix incorrect tests
5fae2f5
@manticore-projects
Define Reserved Keywords explicitly
f49e828
Derive All Keywords from Grammar directly
Generate production for Object Names (semi-) automatically
Add parametrized Keyword Tests
@manticore-projects
Fix test resources
86f337d
@manticore-projects
Adjust Gradle to JUnit 5
2d51a82
Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10
@manticore-projects
Do not mark SpeedTest for concurrent execution
232aff6
@manticore-projects
Remove unused imports
3ba5410
@manticore-projects
Adjust Gradle to JUnit 5
e960a35
Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10
@manticore-projects
Do not mark SpeedTest for concurrent execution
67f7951
@manticore-projects
Remove unused imports
a016be0
@manticore-projects
Sphinx Documentation
2ef6637
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
@manticore-projects
doc: request for Conventional Commit messages
57193b8
@manticore-projects
feat: make important Classes Serializable
b94b2cc
Implement Serializable for persisting via ObjectOutputStream
@manticore-projects
chore: Make Serializable
02202c5
@manticore-projects
doc: Better integration of the RR diagrams
a3ca325
- apply neutral Sphinx theme
- insert the RR diagrams into the sphinx sources
- better documentation on Gradle dependencies
- link GitHub repository
@manticore-projects
Merge
fcb5ab1
@manticore-projects
feat: Oracle Alternative Quoting
c57c427
- 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)
@manticore-projects
style: Appease PMD/Codacy
2aec1f6
@manticore-projects
feat: CREATE VIEW ... REFRESH AUTO...
1c8d8da
- Merge PR JSQLParser#1691, fixes JSQLParser#1684
    all credits go to @zaza
@manticore-projects
doc: fix the issue template
b707b23
- fix the issue template
- fix the -SNAPSHOT version number
@manticore-projects
Update issue templates
46314c4
@manticore-projects
Update issue templates
4aeafbc
@manticore-projects
feat: Support more Statement Separators
b081484
- `GO`
- Slash `/`
- Two empty lines
@manticore-projects
Merge remote-tracking branch 'origin/master'
5885e1c
@manticore-projects
Merge branch 'master' of https://github.com/JSQLParser/JSqlParser
581d97a
@manticore-projects
feat: FETCH uses EXPRESSION
0979b2e
- `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()
@manticore-projects
style: apply Spotless
ed17f87
manticore-projects added 2 commits May 16, 2023 16:43
@manticore-projects
refactor: simplify production CreateParameter()
01a5fb7
@manticore-projects
refactor: SHOW statement, supporting any RDBMS specific implementation
daa56ed
- returns any RDBMS specific implementation as `UnsupportedStatement`
- fixes JSQLParser#1702
@manticore-projects manticore-projects mentioned this pull request May 16, 2023
Exception parsing show statement #1702
Closed
@manticore-projects
refactor: RETURNING clause
4fb1cfb
- supports Oracle's `RETURN ... INTO ...`
- fixes JSQLParser#1780
- fixes JSQLParser#686
- Special Oracle tests `insert11.sql` and `insert12.sql`
This was referenced May 16, 2023
Support "RETURNING INTO" part of Insert/Update/Delete statement #1780
Closed
PostgreSQL [create table DDL ] parse geometry field fail #1121
Closed
@manticore-projects
refactor: CREATE and ALTER productions
da32442
- avoid LOOKAHEADs
- simplify the SimpleStatement() production
- use UnsupportedStatements() for any RDBMS specific syntax
- fixes JSQLParser#1515
- fixes JSQLParser#1453
@manticore-projects manticore-projects mentioned this pull request May 16, 2023
[BUG] JSQLParser 4.6 : PostgreSQL : CPU burn when parsing certain queries #1792
Closed
manticore-projects added 7 commits May 17, 2023 16:06
@manticore-projects
fix: Complex Parsing Approach
4f0488c
- optionally provide a global Executor, instead spawning one for each parse
- run into Complex Parsing only, when Complex Parsing was allowed
- provide a Logger
- fixes JSQLParser#1792
@manticore-projects
style: Quieten the logger
3ff9774
@manticore-projects
style: Cosmetic improvements
a7dfb94
@manticore-projects
feat: chaining JSON Expressions
6ef5e0b
- supports chains like '{"obj":{"field": "value"}}'::JSON -> 'obj'::TEXT ->> 'field'::TEXT
- fixes JSQLParser#1792
@manticore-projects
style: remove unused imports
4f91746
@manticore-projects
refact: Statements extends List<Statement>
9dafae8
@manticore-projects
build: try to work around the Maven/JDK8 issue on GitHub
4bdabed
@manticore-projects
manticore-projects requested a review from wumpz May 17, 2023 12:49
@manticore-projects manticore-projects mentioned this pull request May 17, 2023
sqlParser.Statements() falied #513
Closed
manticore-projects added 5 commits May 17, 2023 20:36
@manticore-projects
feat: parse CREATE TRIGGER as UnsupportedStatement
64b0331
- fixes JSQLParser#1090
@manticore-projects
feat: functions blocks, parenthesed JSON Expressions
e19dc0e
- fixes JSQLParser#1792, the very complex example
- fixes JSQLParser#1477
@manticore-projects
feat: functions blocks, parenthesed JSON Expressions
5263b91
- fixes JSQLParser#1792, the very complex example
- fixes JSQLParser#1477
- cosmetics
@manticore-projects
feat: Quoted Identifiers can contain double-quotes (PostgreSQL)
73c55fd
- `SELECT "test""column""name"`
- fixes JSQLParser#1335
@manticore-projects
build: improve Upload task
a558871
@manticore-projects manticore-projects mentioned this pull request May 22, 2023
use interface in ColumnDefinition #1367
Closed
@manticore-projects
doc: Website improvements
5e7732c
- Show Release vs. SNAPSHOT
- FURO theme
- fix inline tab appearance
This was referenced May 28, 2023
Refactoring #1797
Closed
[BUG] JSQLParser Version 4.5: RDBMS : "Encountered unexpected token: "SELECT" <K_SELECT> at line 11, column 1." #1798
Closed
@manticore-projects
manticore-projects merged commit 41b6fce into JSQLParser:master Jun 1, 2023
@manticore-projects
manticore-projects deleted the Lateral_View branch June 1, 2023 02:36
manticore-projects added a commit that referenced this pull request Jun 15, 2023
@manticore-projects @zaza
Assorted Fixes #8 (#1807)
a815f5f
* Fixes #1684: Support CREATE MATERIALIZED VIEW with AUTO REFRESH

Support parsing create view statements in Redshift with AUTO REFRESH
option.

* Reduce cyclomatic complexity in CreateView.toString

Extract adding the force option into a dedicated method resulting in the
cyclomatic complexity reduction of the CreateView.toString method.

* Enhanced Keywords

Add Keywords and document, which keywords are allowed for what purpose

* Fix incorrect tests

* Define Reserved Keywords explicitly
Derive All Keywords from Grammar directly
Generate production for Object Names (semi-) automatically
Add parametrized Keyword Tests

* Fix test resources

* Adjust Gradle to JUnit 5

Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10

* Do not mark SpeedTest for concurrent execution

* Remove unused imports

* Adjust Gradle to JUnit 5

Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10

* Do not mark SpeedTest for concurrent execution

* Remove unused imports

* Sphinx Documentation

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

* doc: request for `Conventional Commit` messages

* feat: make important Classes Serializable

Implement Serializable for persisting via ObjectOutputStream

* chore: Make Serializable

* doc: Better integration of the RR diagrams

- apply neutral Sphinx theme
- insert the RR diagrams into the sphinx sources
- better documentation on Gradle dependencies
- link GitHub repository

* Merge

* feat: Oracle Alternative Quoting

- add support for Oracle Alternative Quoting e.g. `q'(...)'`
- fixes #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)

* style: Appease PMD/Codacy

* doc: fix the issue template

- fix the issue template
- fix the -SNAPSHOT version number

* Update issue templates

* Update issue templates

* feat: Support more Statement Separators

- `GO`
- Slash `/`
- Two empty lines

* feat: FETCH uses EXPRESSION

- `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()

* style: apply Spotless

* test: commit missing test

* feat: Lateral View

Implement Lateral View according to https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-lateral-view.html#syntax
Add proper tests

Fixes #1777
Fixes #239
Fixes #1723

* feat: Oracle `HAVING` before `GROUP BY`

Basic support for Oracle's `HAVING` before `GROUP BY` option.
It will be parsed without any special consideration for the order.
Special Oracle Test groupby07.sql gets parsed, but fails when the deparser reorders the clauses.

Fixes #1774

* feat: Multi-Part Names for Variables and Parameters

Fixes #1771
Fixes #1768

* feat: ClickHouse `Select...` ``FINAL` modifier

Fixes #1774

BREAKING-CHANGE: introduces reserved keyword `FINAL`

* feat: Test if a JOIN is an INNER JOIN according to the SQL:2016

An `INNER JOIN` is a qualified `JOIN` with the `INNER` qualifier or without any `LEFT` or `RIGHT` qualifier.

Fixes #1775

* feat: Switch off contradicting `JOIN` qualifiers, when setting a qualifier

* feat: implement SQL:2016 Convert() and Trim()

- Fixes #868
- Fixes #1767
- Fixes Special Oracle Test `function03.sql`

* feat: ClickHouse `LIMIT ... BY ...` clause

- LimitDeparser accepts ExpressionVisitor
- `SELECT` can have optional `LIMIT ... BY ...` clause
- Fixes #1436

* test: add specific tests for closed issues

* test: add specific tests for closed issues

* refactor: remove `SelectExpressionItem` in favor of `SelectItem`

BREAKING-CHANGE: `SelectExpressionItem` removed

* doc: Update examples

* build: Add missing import

* doc: Update the README.md

* fix: assign Enum case insensitive

Fixes #1779

* fix: assign Enum case insensitive

Remove redundant `DateTime` enum
Fixes #1779

* Revert "fix: assign Enum case insensitive"

This reverts commit 86d0ace.

* feat: Consolidate the `ExpressionList`, removing many redundant List alike Classes and Productions

- `ExpressionList` extends a `List<Expression>` directly and implements `Expression`
- `ExpressionList` has no Brackets
- introduce `ParenthesedExpressionList` which extends `ExpressionList` and has Brackets
- refactor `MultiExpressionList` to extend `List<ExpressionList>`
- replace any occurrence of `List<Expression>` with `ExpressionList` and remove lots of redundant Productions
- `RowConstructor` extends `ExpressionList`
- remove redundant `ValueExpressionList` (it was just an `ExpressionList`
- get rid of any `useBrackets` flags
- consolidate the `Cast` Functions
- use `ExpressionListDeparser` as much as possible

BREAKING-CHANGE: All `List<Expression>` and `List<Column>` related methods have changed. No `useBrackets` flags, instead use `ParenthesedExpressionList` when brackets are needed.

* fix: Remove tests for `()`, since `ParenthesedExpressionList` will catch those too

* refactor: UpdateSets for `Update` and `InsertConflictTarget`

- remove redundant code
- add license headers
- register `function06.sql` success

* build: Increase TimeOut for the GitHub CI

* style: Appease Codacy

* style: Checkstyle

* refactor: Remove `ItemsList`, `MultiExpressionList`, `Replace`

Since we have proper `ExpressionList` implementing `Expression` we can narrow down the API:

- remove `ItemsList`, `ItemsListVisitor`, `ItemsListValidator` in favor of `ExpressionList`
- remove `MultiExpressionList` in favor of `ExpressionList`
- refactor `NamedExpressionList` so it extends `ExpressionList` and uses `ExpressionListDeparser`
- simplify `InExpression` and `AnyComparisionExpression`

BREAKING-CHANGE: many Classes and Methods removed

* style: Appease Codacy

* style: Rework all the ENUMs

- assign Value only when really needed
- implement `from()` method for getting the case-insensitive Enum

* doc: Better Sphinx Tabs

Addresses issue #1784 item 2

* doc: RR chart colors cater for Dark Mode

Addresses issue #1784 item 3

* refactor: remove SimpleFunction

Remove the production `SimpleFunction`
Clean-up `InternalFunction`

* build: improve Gradle Build

- fix Version/Snapshot
- add XML Doclet (for generating API Website via XSLT later)
- fix the publishing task and add GitHub package

* refactor: `Insert` uses `ExpressionList` and `UpdateSet`

* test: Disable API Sanitation for the moment

* style: Appease Checkstyle

* style: Appease PMD

* fix: find the correct position when field belongs to an internal class

* style: replace all List<Expression> with ExpressionList<> and enforce policy via Acceptance Test

- refactor `Merge`, use `ExpressionList`, `UpdateSet` and Visitor Pattern
- refactor `Upsert`, use `ExpressionList`, `UpdateSet` and Visitor Pattern
- refactor `Set` Statement
- refactor `Limit`, `Pivot`, `Unpivot`

** Breaking Changes ** Getters/Setters of `Merge`, `Upsert`, `Set` have changed

* refactor: generify `SelectItem` and remove `FunctionItem` and `ExpressionListItem`

- generify `SelectItem<T extends Expression>`
- replace `FunctionItem` with `SelectItem<Function>`
- replace `ExpressionListItem` with `SelectItem<ExpressionList>`
- appease PMD/Codacy

** Breaking Changes ** Getters/Setters of `Pivot`, `UnPivot`, `PivotXML` have changed

* fix: Java Version 8

* feat: JdbcNamedParameter allows "&" (instead of ":")

- fixes #1785

* feat: access Elements of Array Columns
- Example `update utilisateur set listes[0] = 1`
- fixes #1083

* feat: `MEMBER OF` condition as shown at https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#operator_member-of

- fixes #1631

* style: appease PMD/Codacy

* style: appease PMD/Codacy

* test: add unit test for issue #1778

* feat: Write API documentation to the WebSite via XMLDoclet

* Update sphinx.yml

* build: Sphinx build fixes

* build: Sphinx build fixes

* build: Sphinx build fixes

* build: improve the GIT Snapshot detection

* fix: issue #1791

- Allow `START` keyword as table `CreateParameter`

* fix: issue #1789

- allow `CREATE TABLE ...` column parameter with Postgres`nextval('public.actor_actor_id_seq'::regclass)`

* fix: issue #1789

- allow `CREATE TABLE ...` column parameter with Postgres`nextval('public.actor_actor_id_seq'::regclass)`

* refactor: simplify production `CreateParameter()`

* refactor: SHOW statement, supporting any RDBMS specific implementation

- returns any RDBMS specific implementation as `UnsupportedStatement`
- fixes #1702

* refactor: RETURNING clause

- supports Oracle's `RETURN ... INTO ...`
- fixes #1780
- fixes #686
- Special Oracle tests `insert11.sql` and `insert12.sql`

* refactor: CREATE and ALTER productions

- avoid LOOKAHEADs
- simplify the SimpleStatement() production
- use UnsupportedStatements() for any RDBMS specific syntax
- fixes #1515
- fixes #1453

* fix: Complex Parsing Approach

- optionally provide a global Executor, instead spawning one for each parse
- run into Complex Parsing only, when Complex Parsing was allowed
- provide a Logger
- fixes #1792

* style: Quieten the logger

* style: Cosmetic improvements

* feat: chaining JSON Expressions

- supports chains like '{"obj":{"field": "value"}}'::JSON -> 'obj'::TEXT ->> 'field'::TEXT
- fixes #1792

* style: remove unused imports

* refact: Statements extends List<Statement>

* build: try to work around the Maven/JDK8 issue on GitHub

* feat: parse CREATE TRIGGER as UnsupportedStatement

- fixes #1090

* feat: functions blocks, parenthesed JSON Expressions

- fixes #1792, the very complex example
- fixes #1477

* feat: functions blocks, parenthesed JSON Expressions

- fixes #1792, the very complex example
- fixes #1477
- cosmetics

* Create gradle.yml

* feat: Quoted Identifiers can contain double-quotes (PostgreSQL)

- `SELECT "test""column""name"`
- fixes #1335

* build: improve Upload task

* doc: Website improvements

- Show Release vs. SNAPSHOT
- FURO theme
- fix inline tab appearance

* doc: Website, fix tabs

* fix: throw the specific exception

* doc: write migration guide

* fix: expose IntervalExpression attributes and use DeParser

* doc: migration guide

* feat: T-SQL `FOR ...` clause

- fixes #1800

* fix: SPHINX modules and themes

* docs: write migration guide

- migration guide
- Getters for List Elements
- Rename Join `rightItem` to `fromItem`

* feat: `QUALIFY` clause

- fixes #1805

* feat: Postgres `NOTNULL` support

- incorporates PR #1725, all credits to @tomershay

Signed-off-by: Andreas Reichel <[email protected]>

* feat: MySQL `NOT RLIKE`, `NOT REGEXP` expressions

- fixes #1553
- remove RegExpMySQLOperator, replaced by flavoured `LIKE` expression

Signed-off-by: Andreas Reichel <[email protected]>

* fix: `INSERT` must use simple Column Names only

- salvages PR #589, credits to @wheredevel

Signed-off-by: Andreas Reichel <[email protected]>

---------

Signed-off-by: Andreas Reichel <[email protected]>
Co-authored-by: zaza <[email protected]>
manticore-projects added a commit that referenced this pull request Jun 27, 2023
@manticore-projects @zaza
Backslash Quotation of Single-Quote '\\'' (#1813)
c79dfff
* Fixes #1684: Support CREATE MATERIALIZED VIEW with AUTO REFRESH

Support parsing create view statements in Redshift with AUTO REFRESH
option.

* Reduce cyclomatic complexity in CreateView.toString

Extract adding the force option into a dedicated method resulting in the
cyclomatic complexity reduction of the CreateView.toString method.

* Enhanced Keywords

Add Keywords and document, which keywords are allowed for what purpose

* Fix incorrect tests

* Define Reserved Keywords explicitly
Derive All Keywords from Grammar directly
Generate production for Object Names (semi-) automatically
Add parametrized Keyword Tests

* Fix test resources

* Adjust Gradle to JUnit 5

Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10

* Do not mark SpeedTest for concurrent execution

* Remove unused imports

* Adjust Gradle to JUnit 5

Parallel Test execution
Gradle Caching
Explicitly request for latest JavaCC 7.0.10

* Do not mark SpeedTest for concurrent execution

* Remove unused imports

* Sphinx Documentation

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

* doc: request for `Conventional Commit` messages

* feat: make important Classes Serializable

Implement Serializable for persisting via ObjectOutputStream

* chore: Make Serializable

* doc: Better integration of the RR diagrams

- apply neutral Sphinx theme
- insert the RR diagrams into the sphinx sources
- better documentation on Gradle dependencies
- link GitHub repository

* Merge

* feat: Oracle Alternative Quoting

- add support for Oracle Alternative Quoting e.g. `q'(...)'`
- fixes #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)

* style: Appease PMD/Codacy

* doc: fix the issue template

- fix the issue template
- fix the -SNAPSHOT version number

* Update issue templates

* Update issue templates

* feat: Support more Statement Separators

- `GO`
- Slash `/`
- Two empty lines

* feat: FETCH uses EXPRESSION

- `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()

* style: apply Spotless

* test: commit missing test

* feat: Lateral View

Implement Lateral View according to https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-lateral-view.html#syntax
Add proper tests

Fixes #1777
Fixes #239
Fixes #1723

* feat: Oracle `HAVING` before `GROUP BY`

Basic support for Oracle's `HAVING` before `GROUP BY` option.
It will be parsed without any special consideration for the order.
Special Oracle Test groupby07.sql gets parsed, but fails when the deparser reorders the clauses.

Fixes #1774

* feat: Multi-Part Names for Variables and Parameters

Fixes #1771
Fixes #1768

* feat: ClickHouse `Select...` ``FINAL` modifier

Fixes #1774

BREAKING-CHANGE: introduces reserved keyword `FINAL`

* feat: Test if a JOIN is an INNER JOIN according to the SQL:2016

An `INNER JOIN` is a qualified `JOIN` with the `INNER` qualifier or without any `LEFT` or `RIGHT` qualifier.

Fixes #1775

* feat: Switch off contradicting `JOIN` qualifiers, when setting a qualifier

* feat: implement SQL:2016 Convert() and Trim()

- Fixes #868
- Fixes #1767
- Fixes Special Oracle Test `function03.sql`

* feat: ClickHouse `LIMIT ... BY ...` clause

- LimitDeparser accepts ExpressionVisitor
- `SELECT` can have optional `LIMIT ... BY ...` clause
- Fixes #1436

* test: add specific tests for closed issues

* test: add specific tests for closed issues

* refactor: remove `SelectExpressionItem` in favor of `SelectItem`

BREAKING-CHANGE: `SelectExpressionItem` removed

* doc: Update examples

* build: Add missing import

* doc: Update the README.md

* fix: assign Enum case insensitive

Fixes #1779

* fix: assign Enum case insensitive

Remove redundant `DateTime` enum
Fixes #1779

* Revert "fix: assign Enum case insensitive"

This reverts commit 86d0ace.

* feat: Consolidate the `ExpressionList`, removing many redundant List alike Classes and Productions

- `ExpressionList` extends a `List<Expression>` directly and implements `Expression`
- `ExpressionList` has no Brackets
- introduce `ParenthesedExpressionList` which extends `ExpressionList` and has Brackets
- refactor `MultiExpressionList` to extend `List<ExpressionList>`
- replace any occurrence of `List<Expression>` with `ExpressionList` and remove lots of redundant Productions
- `RowConstructor` extends `ExpressionList`
- remove redundant `ValueExpressionList` (it was just an `ExpressionList`
- get rid of any `useBrackets` flags
- consolidate the `Cast` Functions
- use `ExpressionListDeparser` as much as possible

BREAKING-CHANGE: All `List<Expression>` and `List<Column>` related methods have changed. No `useBrackets` flags, instead use `ParenthesedExpressionList` when brackets are needed.

* fix: Remove tests for `()`, since `ParenthesedExpressionList` will catch those too

* refactor: UpdateSets for `Update` and `InsertConflictTarget`

- remove redundant code
- add license headers
- register `function06.sql` success

* build: Increase TimeOut for the GitHub CI

* style: Appease Codacy

* style: Checkstyle

* refactor: Remove `ItemsList`, `MultiExpressionList`, `Replace`

Since we have proper `ExpressionList` implementing `Expression` we can narrow down the API:

- remove `ItemsList`, `ItemsListVisitor`, `ItemsListValidator` in favor of `ExpressionList`
- remove `MultiExpressionList` in favor of `ExpressionList`
- refactor `NamedExpressionList` so it extends `ExpressionList` and uses `ExpressionListDeparser`
- simplify `InExpression` and `AnyComparisionExpression`

BREAKING-CHANGE: many Classes and Methods removed

* style: Appease Codacy

* style: Rework all the ENUMs

- assign Value only when really needed
- implement `from()` method for getting the case-insensitive Enum

* doc: Better Sphinx Tabs

Addresses issue #1784 item 2

* doc: RR chart colors cater for Dark Mode

Addresses issue #1784 item 3

* refactor: remove SimpleFunction

Remove the production `SimpleFunction`
Clean-up `InternalFunction`

* build: improve Gradle Build

- fix Version/Snapshot
- add XML Doclet (for generating API Website via XSLT later)
- fix the publishing task and add GitHub package

* refactor: `Insert` uses `ExpressionList` and `UpdateSet`

* test: Disable API Sanitation for the moment

* style: Appease Checkstyle

* style: Appease PMD

* fix: find the correct position when field belongs to an internal class

* style: replace all List<Expression> with ExpressionList<> and enforce policy via Acceptance Test

- refactor `Merge`, use `ExpressionList`, `UpdateSet` and Visitor Pattern
- refactor `Upsert`, use `ExpressionList`, `UpdateSet` and Visitor Pattern
- refactor `Set` Statement
- refactor `Limit`, `Pivot`, `Unpivot`

** Breaking Changes ** Getters/Setters of `Merge`, `Upsert`, `Set` have changed

* refactor: generify `SelectItem` and remove `FunctionItem` and `ExpressionListItem`

- generify `SelectItem<T extends Expression>`
- replace `FunctionItem` with `SelectItem<Function>`
- replace `ExpressionListItem` with `SelectItem<ExpressionList>`
- appease PMD/Codacy

** Breaking Changes ** Getters/Setters of `Pivot`, `UnPivot`, `PivotXML` have changed

* fix: Java Version 8

* feat: JdbcNamedParameter allows "&" (instead of ":")

- fixes #1785

* feat: access Elements of Array Columns
- Example `update utilisateur set listes[0] = 1`
- fixes #1083

* feat: `MEMBER OF` condition as shown at https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#operator_member-of

- fixes #1631

* style: appease PMD/Codacy

* style: appease PMD/Codacy

* test: add unit test for issue #1778

* feat: Write API documentation to the WebSite via XMLDoclet

* Update sphinx.yml

* build: Sphinx build fixes

* build: Sphinx build fixes

* build: Sphinx build fixes

* build: improve the GIT Snapshot detection

* fix: issue #1791

- Allow `START` keyword as table `CreateParameter`

* fix: issue #1789

- allow `CREATE TABLE ...` column parameter with Postgres`nextval('public.actor_actor_id_seq'::regclass)`

* fix: issue #1789

- allow `CREATE TABLE ...` column parameter with Postgres`nextval('public.actor_actor_id_seq'::regclass)`

* refactor: simplify production `CreateParameter()`

* refactor: SHOW statement, supporting any RDBMS specific implementation

- returns any RDBMS specific implementation as `UnsupportedStatement`
- fixes #1702

* refactor: RETURNING clause

- supports Oracle's `RETURN ... INTO ...`
- fixes #1780
- fixes #686
- Special Oracle tests `insert11.sql` and `insert12.sql`

* refactor: CREATE and ALTER productions

- avoid LOOKAHEADs
- simplify the SimpleStatement() production
- use UnsupportedStatements() for any RDBMS specific syntax
- fixes #1515
- fixes #1453

* fix: Complex Parsing Approach

- optionally provide a global Executor, instead spawning one for each parse
- run into Complex Parsing only, when Complex Parsing was allowed
- provide a Logger
- fixes #1792

* style: Quieten the logger

* style: Cosmetic improvements

* feat: chaining JSON Expressions

- supports chains like '{"obj":{"field": "value"}}'::JSON -> 'obj'::TEXT ->> 'field'::TEXT
- fixes #1792

* style: remove unused imports

* refact: Statements extends List<Statement>

* build: try to work around the Maven/JDK8 issue on GitHub

* feat: parse CREATE TRIGGER as UnsupportedStatement

- fixes #1090

* feat: functions blocks, parenthesed JSON Expressions

- fixes #1792, the very complex example
- fixes #1477

* feat: functions blocks, parenthesed JSON Expressions

- fixes #1792, the very complex example
- fixes #1477
- cosmetics

* Create gradle.yml

* feat: Quoted Identifiers can contain double-quotes (PostgreSQL)

- `SELECT "test""column""name"`
- fixes #1335

* build: improve Upload task

* doc: Website improvements

- Show Release vs. SNAPSHOT
- FURO theme
- fix inline tab appearance

* doc: Website, fix tabs

* fix: throw the specific exception

* doc: write migration guide

* fix: expose IntervalExpression attributes and use DeParser

* doc: migration guide

* feat: T-SQL `FOR ...` clause

- fixes #1800

* fix: SPHINX modules and themes

* docs: write migration guide

- migration guide
- Getters for List Elements
- Rename Join `rightItem` to `fromItem`

* feat: `QUALIFY` clause

- fixes #1805

* feat: Postgres `NOTNULL` support

- incorporates PR #1725, all credits to @tomershay

Signed-off-by: Andreas Reichel <[email protected]>

* feat: MySQL `NOT RLIKE`, `NOT REGEXP` expressions

- fixes #1553
- remove RegExpMySQLOperator, replaced by flavoured `LIKE` expression

Signed-off-by: Andreas Reichel <[email protected]>

* fix: `INSERT` must use simple Column Names only

- salvages PR #589, credits to @wheredevel

Signed-off-by: Andreas Reichel <[email protected]>

* fix: Backslash escaped single quote `'\''`

fixes #1812

Signed-off-by: Andreas Reichel <[email protected]>

* style: Licenses from Maven plugin

Signed-off-by: Andreas Reichel <[email protected]>

---------

Signed-off-by: Andreas Reichel <[email protected]>
Co-authored-by: zaza <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@wumpz wumpz Awaiting requested review from wumpz

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Oracle RETURNING INTO Clause problem CONVERT() - data type is wrongfully parsed as a column sqlParser.Statements() falied no support lateral view grammar While SQL Statement Contains lateral view explode JSQLParser throw an exception
[mysql] can't parse convert function in order by clause lateral view explode support? postgresql TRIM not fully supported? CREATE TABLE - default-values on columns SQL "update" statement does not recognize queries as array indexes

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@manticore-projects @wumpz @zaza
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.