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

Implement SQL-consistent null and boolean handling #18

Closed
rw-access opened this issue Apr 17, 2020 · 0 comments · Fixed by #17
Closed

Implement SQL-consistent null and boolean handling #18

rw-access opened this issue Apr 17, 2020 · 0 comments · Fixed by #17
Assignees

Comments

@rw-access
Copy link
Contributor

Part of #15

We need to implement three-value logic for null, true and false consistent with Elasticsearch EQL and Elasticsearch SQL.

Some necessary changes

  • Any value can be compared to null
  • The only way to explicitly check for null is == null or != null (plus commutative versions)
    • Likely need an intermediate ast node to delineate these nulls from folded nulls
  • All other comparisons to null return null (< null, <= null, etc)
  • Dynamic nulls can not be compared. process_name == parent_process_name will be null even if both values are null. This is a change from the current implementation
  • Implement boolean logic similarly, while maintaining the short-circuiting properties: ... and false => false, and ... or true => true
  • Disable implicit boolean casting. We can keep a toggle to manually turn it back on
  • Functions with any null required inputs return null
  • Might be worthwhile to track functions that can return null, even when all parameters are the correct-type and non-null

And of course, update existing tests to be consistent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant