-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add typeof
function.
#867
Add typeof
function.
#867
Conversation
Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
core/src/test/java/org/opensearch/sql/expression/operator/convert/TypeOfOperatorTest.java
Outdated
Show resolved
Hide resolved
integ-test/src/test/java/org/opensearch/sql/legacy/SQLFunctionsIT.java
Outdated
Show resolved
Hide resolved
* Move function definition in ANTLR grammar into a separate group; * Move SQL integration tests outside of legacy block; * Extend integration tests. Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
…ssion`. It is able to recognize `OpenSearchDataType` as well. Co-authored-by: MaxKsyunz <maxk@bitquilltech.com> Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
core/src/main/java/org/opensearch/sql/expression/operator/convert/TypeOfOperator.java
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.
Just a minor comment. Thanks for the changes!
Btw, do we want to add this to user manual like PGSQL? Doc: https://www.postgresql.org/docs/current/functions-info.html
Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
b4dc828
Added in b4dc828. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #867 +/- ##
============================================
- Coverage 97.85% 95.10% -2.75%
- Complexity 2989 3075 +86
============================================
Files 281 304 +23
Lines 7357 8258 +901
Branches 467 609 +142
============================================
+ Hits 7199 7854 +655
- Misses 157 350 +193
- Partials 1 54 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 changes!
Signed-off-by: Yury-Fridlyand yuryf@bitquilltech.com
Description
TYPEOF
function is useful for debugging to check types of other functions. Extremely useful for testing and debugging upcoming PRs with datetime functions.Not added to documentation, because it is not supposed for an end user.
See team review discussion in Bit-Quill#123.
Usage
UPD
TYPEOF
function perfectly works with SQL types. It works with some OpenSearch (OpenSearchDataType
) types, which could be implicitly casted to SQL ones. Unfortunately, function can't accept OpenSearch types, so some information lost.IP
,GEO_POINT
,BINARY
andNESTED
types cause crash.https://github.com/Bit-Quill/opensearch-project-sql/blob/d02e16f147a9f3e6afa065f701efa7ece70d310b/opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataType.java#L49-L53
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.