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

SQL aggregation MAX/MIN and builtin functions COLL_MAX/COLL_MIN should result in a data type mismatch over non-comparable elements #1094

Open
alancai98 opened this issue May 23, 2023 · 0 comments
Labels
bug Something isn't working PartiQLSpec Features from the PartiQL Spec SQL92Spec Features from the SQL92 spec

Comments

@alancai98
Copy link
Member

Description

Spec issue partiql/partiql-lang#11 with more context. Kotlin implementation currently allows calling SQL aggregation MAX/MIN and building functions COLL_MAX/COLL_MIN on collections of non-comparable elements. These should return an error in strict mode (LEGACY typing mode with what Kotlin currently supports) and return MISSING in permissive mode.

Expected Behavior

The following queries to error in strict/legacy typing mode and return MISSING in permissive typing mode:

SELECT MIN(a) AS result FROM <<{'a': 1}, {'a': 'non-number'}>>
SELECT MAX(a) AS result FROM <<{'a': 1}, {'a': 'non-number'}>>
COLL_MIN(<<1, 'non-number'>>)
COLL_MAX(<<1, 'non_number'>>)

Additional Context

  • Java version: 11
  • PartiQL version: 0.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PartiQLSpec Features from the PartiQL Spec SQL92Spec Features from the SQL92 spec
Projects
None yet
Development

No branches or pull requests

1 participant