-
Notifications
You must be signed in to change notification settings - Fork 180
Support casting to IP with Calcite #3919
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
Conversation
Signed-off-by: Yuanchun Shen <[email protected]>
Signed-off-by: Yuanchun Shen <[email protected]>
Signed-off-by: Yuanchun Shen <[email protected]>
Signed-off-by: Yuanchun Shen <[email protected]>
Signed-off-by: Yuanchun Shen <[email protected]>
LantaoJin
left a comment
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.
Can you update the https://github.com/opensearch-project/sql/blob/main/docs/user/ppl/functions/conversion.rst doc, and the IP datatype is missing in https://github.com/opensearch-project/sql/blob/main/docs/user/ppl/general/datatypes.rst
Signed-off-by: Yuanchun Shen <[email protected]>
|
I saw IP in the PPL Data Types section. Do you mean we need a specific section like Date and Time Data Types to describe its behaviors? |
…ng ip to string Signed-off-by: Yuanchun Shen <[email protected]>
Yes. we miss a IP type description in datatypes.rst. please add one. But I think it could be a separated PR. |
|
The backport to To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-3919-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 411395dd595359acdd94a54f0544aa20a6f9833d
# Push it to GitHub
git push --set-upstream origin backport/backport-3919-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
* Support casting ip Signed-off-by: Yuanchun Shen <[email protected]> * Refactor type checking for UDT (specifically, IP) Signed-off-by: Yuanchun Shen <[email protected]> * Remove IPCastFunctionTest Signed-off-by: Yuanchun Shen <[email protected]> * Remove unused IPUtil function Signed-off-by: Yuanchun Shen <[email protected]> * Fix error message of comparing with different types Signed-off-by: Yuanchun Shen <[email protected]> * Correct casting ip to string & update conversion doc Signed-off-by: Yuanchun Shen <[email protected]> * Change string representation form IP [ip] to [ip] to accomadate casting ip to string Signed-off-by: Yuanchun Shen <[email protected]> --------- Signed-off-by: Yuanchun Shen <[email protected]> (cherry picked from commit 411395d)
* Support casting ip Signed-off-by: Yuanchun Shen <[email protected]> * Refactor type checking for UDT (specifically, IP) Signed-off-by: Yuanchun Shen <[email protected]> * Remove IPCastFunctionTest Signed-off-by: Yuanchun Shen <[email protected]> * Remove unused IPUtil function Signed-off-by: Yuanchun Shen <[email protected]> * Fix error message of comparing with different types Signed-off-by: Yuanchun Shen <[email protected]> * Correct casting ip to string & update conversion doc Signed-off-by: Yuanchun Shen <[email protected]> * Change string representation form IP [ip] to [ip] to accomadate casting ip to string Signed-off-by: Yuanchun Shen <[email protected]> --------- Signed-off-by: Yuanchun Shen <[email protected]> (cherry picked from commit 411395d)
* Support casting ip * Refactor type checking for UDT (specifically, IP) * Remove IPCastFunctionTest * Remove unused IPUtil function * Fix error message of comparing with different types * Correct casting ip to string & update conversion doc * Change string representation form IP [ip] to [ip] to accomadate casting ip to string --------- (cherry picked from commit 411395d) Signed-off-by: Yuanchun Shen <[email protected]>
Description
Support casting to IP:
It supports:
Implementation
I created a IP_CAST operator to handle IP casting. It is called in
ExtendedRexBuilder.makeCast. Besides, I refactored type checkers relating to IP type checking, so that we don't have to create a new type checker class for each function that uses an UDT that can not be mapped to Calcite's data types.Related Issues
Resolves #3918
Check List
--signoff.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.