-
Notifications
You must be signed in to change notification settings - Fork 585
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
Clarify that missing attributes should not result in errors #1257
Clarify that missing attributes should not result in errors #1257
Conversation
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
@lionelvillard any comments? |
@slinkydeveloper any comment? Howdy! :-) |
Not deep into the cesql stuff, but it seems like there are a few options for What does |
Hmm you bring up a good point @duglin - one other option would be to have the missing attribute cast to the "default" value for the SINGLE expression it is found within. For example, if we had However, I also like the idea of having the SINGLE expression with the unknown attribute evaluate to false, because then expressions like WDYT? |
I didn't offer a suggested answer in my previous comment because I just don't know yet :-) Way too many options and they all seem to have pros/cons. Let me walk thru some samples and see what I think might be the right answer for each (xxx=missingAttribute):
If the above makes sense, then I guess I'm leaning towards the current single operation (if there is one) returning Note that people can always use the |
@duglin I think I like the idea of the current single operation returning
Maybe here we could follow normal SQL and provide a So, someone could write |
Seems that could work. I think if the Knative folks (/cc @lionelvillard ) are happy with whatever direction is chosen then that is probably a good choice. Maybe you could discuss this issue on today's call to see what other's think. I"m pretty sure some of them will have an opinion. |
Signed-off-by: Calum Murray <cmurray@redhat.com>
@@ -197,7 +197,8 @@ Unless otherwise specified, every attribute and extension MUST be represented by | |||
Through implicit type casting, the user can convert the addressed value instances to _Integer_ and | |||
_Boolean_. | |||
|
|||
When addressing an attribute not included in the input event, an empty _String_ MUST be assumed as its value. | |||
When addressing an attribute not included in the input event, the entire subexpression MUST evaluate to `false`. | |||
For example, `true AND (missingAttribute = "")` would evaluate to `false` as the subexpression `missingAttribute = ""` would be false. |
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.
It might be clearer to say "the subexpression referencing the missing attribute MUST evaluate to 'false'". Use of the word "entire" could be easily misread as the "entire thing".... like I did at first 🤣
Approved (with edit) on the 2/22 call. @Cali0707 let me know when to merge |
Signed-off-by: Calum Murray <cmurray@redhat.com>
@duglin should be good now! I just updated the wording as you suggested. Thanks for the suggestion, I think it's much clearer now! |
@Cali0707 thanks |
Fixes #1230
Proposed Changes
Note: this is actually something that the SDKs currently implement incorrectly, so if this PR is merged I will go and fix them.
Release Note