-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: Implement ROUND() UDF #3404
Conversation
…er of decimal places
…er of decimal places
…RoundKudf.java Co-Authored-By: Andy Coates <[email protected]>
…unctionRegistry.java Co-Authored-By: Andy Coates <[email protected]>
Co-Authored-By: Andy Coates <[email protected]>
Co-Authored-By: Andy Coates <[email protected]>
…igDecimal implementation
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, with a couple of suggestions.
Great job Tim and awesome you used the schema provider! LGTM with one minor 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.
nice! thanks @purplefox
ksql-engine/src/main/java/io/confluent/ksql/function/udf/math/Round.java
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/math/Round.java
Show resolved
Hide resolved
Hi @vpapavas - the json file is called that because that's what it was called in the original PR where it was created. But I agree it could have a better name :) |
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 @purplefox
Few nits and few questions & suggestions below.
Also, this PR would benefit from tests that ensured the return type schema was correct. You can do this in the unit test, but also in the json test. (I've called this out below).
ksql-engine/src/test/java/io/confluent/ksql/function/udf/math/RoundTest.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/test/java/io/confluent/ksql/function/udf/math/RoundTest.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/math/Round.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/math/Round.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/math/Round.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/math/Round.java
Outdated
Show resolved
Hide resolved
ksql-functional-tests/src/test/resources/query-validation-tests/array-functions.json
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.
Thanks @purplefox
Only nit's remaining.
I've again expressed my thoughts on the, in my view, excessive comments. But won't press you again on it.
I've also again asked for the QTT tests to be placed in a more appropriate file name. I'll ping you to discuss, as I think there is some confusion here.
Aside from those, LGTM!
Description
This PR implements the ROUND function for KSQL.
It continues the work started in #3028 - thanks @ouertani for your contribution!
To summarise:
Testing:
Reviewer checklist