This repository was archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 188
Support NULL literal as function argument #985
Merged
dai-chen
merged 12 commits into
opendistro-for-elasticsearch:develop
from
dai-chen:support-null-literal-as-function-argument
Jan 15, 2021
Merged
Support NULL literal as function argument #985
dai-chen
merged 12 commits into
opendistro-for-elasticsearch:develop
from
dai-chen:support-null-literal-as-function-argument
Jan 15, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## develop #985 +/- ##
==========================================
Coverage 99.87% 99.87%
- Complexity 2397 2400 +3
==========================================
Files 234 234
Lines 5513 5517 +4
Branches 357 357
==========================================
+ Hits 5506 5510 +4
Misses 5 5
Partials 2 2
Continue to review full report at Codecov.
|
harold-wang
reviewed
Jan 13, 2021
chloe-zh
approved these changes
Jan 14, 2021
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.
LGTM, thanks for the changes!
harold-wang
approved these changes
Jan 15, 2021
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.
Thanks for the change!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available: #927, #715
Description of changes:
Documentation: https://github.com/dai-chen/sql/blob/support-null-literal-as-function-argument/docs/user/general/datatypes.rst#undefined-data-type
Design: A new undefined data type is added as narrowest and root of data type tree.
UNDEFINED
represents only the type of NULL literal for now (probably represent some other special literals in future)UNKNOWN
represents type not supported yet. For example, some new Elasticsearch type is given as function argument which yet to be added to core engine.With this new type, we're able to support NULL literal. For example, given
ABS(NULL)
, the distance between NULL and INTEGER and DOUBLE are 1 and 2 respectively, so function signature ABS(INTEGER) is used to evaluate its value. Previously NULL literal's type is unknown which caused exception thrown.Testing: Add UT and IT. Because SQLite and H2 has different result type for expression with NULL literal, a
NullLiteralIT
is added manually.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.