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
#1938 GEO_DISTANCE function broken by new UDF Invoker #2700
Conversation
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 @uurl! I think the preferred approach, however, would be to move this to the new UDF framework (e.g. using the @UdfDescription
annotation, you can see an example in DateToString.java
). This way, it will require primitives (non-null) to match the function without the explicit null checks simply by looking at the signature of the method and seeing primitives as parameters.
I would also recommend that you add a test for this using our QueryTranslationTest
framework, which you can see an example in datestring.json
, including a case for when it should _not _work (e.g. nulls are passed in). To see an example syntax for expected exception take a look at cast.json
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.
This is looking really good! Just a few comments in-line :)
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/test/resources/query-validation-tests/geodistance.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 @uurl! Some more comments in-line, also please check why the tests are failing https://jenkins.confluent.io/job/confluentinc-pr/job/ksql/job/PR-2700/12/testReport/ - I think the comments that I have given will address them, but you can run the tests locally with mvn clean install
ksql-engine/src/main/java/io/confluent/ksql/function/InternalFunctionRegistry.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/test/resources/query-validation-tests/geodistance.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.
LGTM! Thanks for the contribution @uurl - we may need to rebase to get the tests passing, the current failure seems unrelated to your change. I'll ask some folk to give you a second review and then we can get this merged.
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.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.
Thanks for the contribution, @uurl ! Apologies I've left so many nits, but they shouldn't take long to address and I'm happy to get this merged for you as soon as that happens.
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/test/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudfTest.java
Outdated
Show resolved
Hide resolved
ksql-engine/src/main/java/io/confluent/ksql/function/udf/geo/GeoDistanceKudf.java
Outdated
Show resolved
Hide resolved
@vcrfxia Ready, thanks |
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 so much @uurl -- merging now!
Description
This PR fixes #1938 GEO_DISTANCE function broken by new UDF Invoker
Testing done
mvn clean package
Reviewer checklist