Skip to content

Fix[2312] - Fixes issue with array<double> in function declaration#2313

Merged
manticore-projects merged 2 commits intoJSQLParser:masterfrom
davyboyhayes:fix/2312
Sep 17, 2025
Merged

Fix[2312] - Fixes issue with array<double> in function declaration#2313
manticore-projects merged 2 commits intoJSQLParser:masterfrom
davyboyhayes:fix/2312

Conversation

@davyboyhayes
Copy link
Contributor

@davyboyhayes davyboyhayes commented Sep 16, 2025

WITH
  FUNCTION takesArray(x array<double>)
    RETURNS double
    RETURN x[1] + x[2] + x[3]
SELECT takesArray(array[1.0, 2.0, 3.0]);

Is unable to be parsed as we're not able to capture the array correctly. This PR fixes that, as well as some missing visitor changes from my previous PR.

Fixes #2312

```sql
WITH
  FUNCTION takesArray(x array<double>)
    RETURNS double
    RETURN x[1] + x[2] + x[3]
SELECT takesArray(array[1.0, 2.0, 3.0]);
```
Is unable to be parsed as we're not able to capture the array<double> correctly. This PR fixes that, as well as some missing visitor changes from my previous PR.
@davyboyhayes
Copy link
Contributor Author

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

After:

  36.006 ±(99.9%) 1.974 ms/op [Average]
  (min, avg, max) = (32.355, 36.006, 40.129), stdev = 2.635
  CI (99.9%): [34.032, 37.980] (assumes normal distribution)

Before:

  36.616 ±(99.9%) 3.500 ms/op [Average]
  (min, avg, max) = (32.615, 36.616, 46.241), stdev = 4.673
  CI (99.9%): [33.115, 40.116] (assumes normal distribution)

@manticore-projects manticore-projects merged commit 528dd72 into JSQLParser:master Sep 17, 2025
2 of 3 checks passed
@manticore-projects
Copy link
Contributor

Thank yo9u for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] JSQLParser 5.4 SNAPSHOT : WITH FUNCTION doesn't parse ARRAY<TYPE>

2 participants