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 — Fix[2288] - Support parenthesed expressions within Between by davyboyhayes · Pull Request #2289 · JSQLParser/JSqlParser

Conversation

@davyboyhayes

@davyboyhayes davyboyhayes commented Aug 5, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Fixes: #2288
Supports SQL of the form:

SELECT * FROM tbl WHERE
day BETWEEN
  CAST(CAST((NOW() + INTERVAL '-30 day') AS date) AS timestamptz)
AND
  CAST(CAST((NOW() + INTERVAL '-1 day') AS date) AS timestamptz);

Sorry, something went wrong.

Uh oh!

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

All reactions
David Hayes
Fix[2288] - Support parenthesed expressions within Between
53297f8
Supports the SQL of the form:
```sql
SELECT * FROM tbl WHERE
day BETWEEN
  CAST(CAST((NOW() + INTERVAL '-30 day') AS date) AS timestamptz)
AND
  CAST(CAST((NOW() + INTERVAL '-1 day') AS date) AS timestamptz);
```
@davyboyhayes davyboyhayes mentioned this pull request Aug 5, 2025
[BUG] JSQLParser Version : Postgres : BETWEEN with Cast #2288
Closed
@manticore-projects

manticore-projects commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

Can you please check with gradle jmh the performance impact?

davyboyhayes reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@davyboyhayes

davyboyhayes commented Aug 5, 2025

Copy link
Copy Markdown
Contributor Author

before each test:
gradle clean build

# JMH version: 1.37
# VM version: JDK 17.0.12, Java HotSpot(TM) 64-Bit Server VM, 17.0.12+8-LTS-286
# VM invoker: /Users/dhayes/.sdkman/candidates/java/17.0.12-oracle/bin/java

Before (JSQLParser:master):

Result "net.sf.jsqlparser.benchmark.JSQLParserBenchmark.parseSQLStatements":
  34.876 ±(99.9%) 3.130 ms/op [Average]
  (min, avg, max) = (31.860, 34.876, 39.507), stdev = 2.928
  CI (99.9%): [31.746, 38.006] (assumes normal distribution)

# Run complete. Total time: 00:03:49

After(davyboyhayes:fix/2288):

Result "net.sf.jsqlparser.benchmark.JSQLParserBenchmark.parseSQLStatements":
  36.546 ±(99.9%) 0.644 ms/op [Average]
  (min, avg, max) = (35.944, 36.546, 37.968), stdev = 0.602
  CI (99.9%): [35.902, 37.191] (assumes normal distribution)


# Run complete. Total time: 00:03:48

However, I suspect a longer run would produce more reliable performance results.

All reactions

Sorry, something went wrong.

Uh oh!

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

@davyboyhayes

davyboyhayes commented Aug 5, 2025

Copy link
Copy Markdown
Contributor Author

With

jmh {
    includes = ['.*JSQLParserBenchmark.*']
    warmupIterations = 2
    fork = 5
    iterations = 5
    timeOnIteration = '5s'
}

(I have an M4 Max Macbook Pro)

Before:

Result "net.sf.jsqlparser.benchmark.JSQLParserBenchmark.parseSQLStatements":
  35.590 ±(99.9%) 1.599 ms/op [Average]
  (min, avg, max) = (31.337, 35.590, 37.378), stdev = 2.135
  CI (99.9%): [33.991, 37.189] (assumes normal distribution)


# Run complete. Total time: 00:11:20

After:

Result "net.sf.jsqlparser.benchmark.JSQLParserBenchmark.parseSQLStatements":
  35.344 ±(99.9%) 1.480 ms/op [Average]
  (min, avg, max) = (31.361, 35.344, 36.934), stdev = 1.975
  CI (99.9%): [33.864, 36.823] (assumes normal distribution)


# Run complete. Total time: 00:11:19
manticore-projects reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@manticore-projects
manticore-projects merged commit f10b52e into JSQLParser:master Aug 5, 2025
@manticore-projects

manticore-projects commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

Thank you much!

All reactions

Sorry, something went wrong.

Uh oh!

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

@davyboyhayes
davyboyhayes deleted the fix/2288 branch August 5, 2025 15:09
@davyboyhayes davyboyhayes mentioned this pull request Aug 5, 2025
[BUG] JSQLParser 5.3: RDBMS Oracle: failing to parse oracle BETWEEEN #2287
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

[BUG] JSQLParser Version : Postgres : BETWEEN with Cast

Uh oh!

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

2 participants

@davyboyhayes @manticore-projects
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.