Skip to content
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

Adds syntactical support for CREATE FUNCTION #1180

Closed
wants to merge 1 commit into from

Conversation

johnedquinn
Copy link
Member

DRAFT NOTES

  • Marking as draft as there are a couple things needed:
    1. CHARACTER without an argument assumes the length to be 1. However, in order to parse CHARACTER(<CML>), where <CML> is the implementation-defined max-length, we don't have a way to say unlimited length.
    2. Similar scenarios for FLOAT, DECIMAL, NUMERIC, etc. Instead of parsing the arguments -- I removed the arguments as we don't have implementation-defined maximums.
    3. We need data classes for AST so we can assert equivalence to expected ASTs
    4. Also leaving it open-ended for testing failures. Should we assert error locations?
    5. Left the SQL:1999 relevant grants in a README in resources.

Relevant Issues

  • None

Description

  • Adds syntactical support for CREATE FUNCTION to the new parser.
  • Adds the CREATE FUNCTION statement to Sprout AST definition
  • Adds SQL:1999's Built-In Functions to resources. Converted several statements to comply with PartiQL (PartiQL doesn't have implementation-defined maximums for string length, precision, etc. Also, PartiQL doesn't support types such as INTERVAL, BIT, and BIT VARYING -- left those out).
    • I did not add support for relevant GRANT statements for the built-in functions.

Other Information

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

Conformance comparison report

Base (eb0b72e) e1bc9b9 +/-
% Passing 92.33% 92.33% 0.00%
✅ Passing 5372 5372 0
❌ Failing 446 446 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5372

Number failing in both: 446

Number passing in Base (eb0b72e) but now fail: 0

Number failing in Base (eb0b72e) but now pass: 0

@codecov-commenter
Copy link

codecov-commenter commented Aug 16, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (eb0b72e) 71.55% compared to head (8b30752) 71.55%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1180   +/-   ##
=========================================
  Coverage     71.55%   71.55%           
  Complexity     2323     2323           
=========================================
  Files           224      224           
  Lines         17097    17097           
  Branches       3189     3189           
=========================================
  Hits          12233    12233           
  Misses         3881     3881           
  Partials        983      983           
Flag Coverage Δ
CLI 13.53% <ø> (ø)
EXAMPLES 80.28% <ø> (ø)
LANG 79.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RCHowell
Copy link
Member

Do you know of, or have an example of vararg and type parameters?

@johnedquinn
Copy link
Member Author

Do you know of, or have an example of vararg and type parameters?

No -- this PR includes what is specified in SQL:1999 for <function specification>, which doesn't support variadic parameters or type parameters. Even in SQL:2023, I don't see support for variadic or type parameters, but I'd need to double-check.

@RCHowell
Copy link
Member

@johnedquinn
Copy link
Member Author

As this is not a priority, I'm closing this and saving the state in fork: https://github.com/johnedquinn/partiql-lang-jvm/releases/tag/v0.12.1-create-function. I'll pick this back up when necessary.

@johnedquinn johnedquinn deleted the create-function branch March 29, 2024 19:27
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.

3 participants