-
Notifications
You must be signed in to change notification settings - Fork 62
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
Addresses some conformance edge cases #1539
Conversation
c402e10
to
0c657d9
Compare
partiql-eval/src/main/kotlin/org/partiql/eval/internal/helpers/ValueUtility.kt
Outdated
Show resolved
Hide resolved
partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprStruct.kt
Outdated
Show resolved
Hide resolved
partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RexConverter.kt
Outdated
Show resolved
Hide resolved
partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt
Show resolved
Hide resolved
partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprStructPermissive.kt
Show resolved
Hide resolved
partiql-eval/src/main/kotlin/org/partiql/eval/internal/operator/rex/ExprStructPermissive.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one followup comment for a struct constructor edge case. otherwise looks good
val fields = fields.mapNotNull { | ||
val key = it.key.eval(env) | ||
if (key.isNull) { | ||
return Datum.nullValue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is null
returned for the overall struct constructor expression if one key is null
? For the following query,
SELECT VALUE {v.a: v.b} FROM [{'a':'legit', 'b':1}, {'a':null, 'b':2}] AS v
<< { legit: 1 }, null >>
will currently be the output.
My read of the "Treatment of mistyped attribute names" section of the PartiQL spec is that null
struct key values (alike non-strings and missing
values) would just omit that struct field from the struct in permissive mode. Following my read, the above query would result in << { 'legit': 1 }, {} >>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, nice! From our offline discussion, I've created an issue with the team's consensus on behavior as well as the need for potential clarification in the PartiQL Spec: partiql/partiql-lang#88
I've just updated this PR accordingly. I also needed to rebase off of the type-renaming PR. The last two commits represent what has been updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one followup comment for a struct constructor edge case. otherwise looks good
c546284
to
79cb973
Compare
Description
Other Information
and Code Style Guidelines? YES
License Information
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.