-
Notifications
You must be signed in to change notification settings - Fork 180
Add missing udfs in v3 #3957
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 missing udfs in v3 #3957
Conversation
Signed-off-by: Xinyu Hao <[email protected]>
core/src/main/java/org/opensearch/sql/expression/function/udf/math/CoshFunction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Xinyu Hao <[email protected]>
Signed-off-by: Xinyu Hao <[email protected]>
Signed-off-by: Xinyu Hao <[email protected]>
core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Xinyu Hao <[email protected]>
Signed-off-by: Xinyu Hao <[email protected]>
| registerOperator(RAND, SqlStdOperatorTable.RAND); | ||
| registerOperator(ROUND, SqlStdOperatorTable.ROUND); | ||
| registerOperator(SIGN, SqlStdOperatorTable.SIGN); | ||
| registerOperator(SIGNUM, SqlStdOperatorTable.SIGN); |
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.
The return type of SqlStdOperatorTable.SIGN (ARG0) seems to be different with SIGNUM (INTEGER) described in the documentation.
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.
Now the behavior is exactly the same as the existing function sign. Let me keep these changes first.
core/src/main/java/org/opensearch/sql/expression/function/PPLBuiltinOperators.java
Outdated
Show resolved
Hide resolved
| PLUS_FUCTION: 'ADD'; | ||
| MINUS_FUCTION: 'SUBTRACT'; | ||
| STAR_FUNCTION: 'MULTIPLY'; | ||
| DIVIDE_FUNCTION: 'DIVIDE'; |
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.
I'm a little unsure about whether should we explicitly add these functions or keep them as is.
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.
I added them with reference to this issue #1339. If you think they are inappropriate, I can delete these functions.
Signed-off-by: Xinyu Hao <[email protected]>
Signed-off-by: Xinyu Hao <[email protected]>
yuancu
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.
Looks good to me
| }; | ||
| } | ||
|
|
||
| public static ImplementorUDF adaptMathFunctionToUDF( |
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 add a Javadoc for this class?
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.
Of course. Added.
Signed-off-by: Xinyu Hao <[email protected]>
Description
Added some missing functions in v2 and v3.
Added related IT and doc.
Related Issues
Resolves #3898
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.