GeezerVison is showing github.com — Fix[2288] - Support parenthesed expressions within Between by davyboyhayes · Pull Request #2289 · JSQLParser/JSqlParser
Conversation
davyboyhayes
commented
Aug 5, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
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);
```
|
Can you please check with gradle jmh the performance impact?
|
davyboyhayes reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|