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

Reify function semantics with respect to mistyping, errors, and missing values #86

Open
johnedquinn opened this issue Jul 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@johnedquinn
Copy link
Member

johnedquinn commented Jul 24, 2024

As discussed with the PartiQL Maintainers, the PartiQL Specification should provide clarity (for both typing modes) on the semantics of functions whose arguments are mistyped, result in errors, result in null values, and result in missing values.

The discussion ended with some decisions regarding mistyping cases and inputs of missing values, as seen below:

Comment pasted below:

The @partiql/partiql maintainers and @almann discussed this PR. As a summary:

  • In strict mode, null and missing values should behave the same. All functions that specify RETURNS NULL ON NULL INPUT return null when one of the arguments is null. The same applies for missing. When one of the arguments is missing, the function should return missing.
  • Certain operations (aka tuple path navigation) result in an error. In permissive mode, the error is lowered to a missing value. In strict mode, the error propagates.
  • In example 29 of Section 7.1 exists the statement below. In permissive mode, all three cases return missing. In strict mode, the latter two fail.

Each one of these expressions returns MISSING:
5 + MISSING
5 > 'a'
NOT {a:1}

If I have missed anything, please feel free to add more comments.

Originally posted by @johnedquinn in partiql/partiql-tests#118 (comment)

@johnedquinn johnedquinn added the enhancement New feature or request label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant