Clarify whether missing attributes should return an `error` or `false`
Currently, when evaluating a CESQL expression with a missing attribute we return an error. However, the spec does not specify whether we should return an error or whether we should return false in this case. The convention of returning an error is coming from the tck tests, which have a missingAttribute error.
From conversation on slack there is a suggestion to return false instead of a missingAttribute error when there is a missing attribute in a CESQL expression.
Regardless of the decision to return an error or false, the behaviour should be clarified in the spec. Hence, the scope of this issue is to:
- Decide whether
errororfalseshould be the result of a missing attribute in a CESQL expression - Clarify the spec to explain the result
This issue is stale because it has been open for 30 days with no
activity. Mark as fresh by updating e.g., adding the comment /remove-lifecycle stale.
@duglin could you assign this to me?
done
Interesting, from the spec it seems like:
When addressing an attribute not included in the input event, an empty String MUST be assumed as its value.
IMO this seems reasonable, and would fix a lot of the problems that the current implementations have regarding errors, where it is unclear whether or not you would get an error as it depends on whether or not AND and OR are optimized to return early.
@duglin @pierDipi what do you think of adding a clarification to the 3.3 Errors section that states that Addressing an attribute which is missing from the input event MUST not return an error. ?
We could then update the tck tests to reflect this, and fix SDKs
I agree