confluentinc / ksql

The database purpose-built for stream processing applications.
https://ksqldb.io
Other
41 stars 1.04k forks source link

No variations for GEO_DISTANCE on latest master #5024

Closed vcrfxia closed 4 years ago

vcrfxia commented 4 years ago

Describe the bug

Submitting a query with the built-in GEO_DISTANCE function results in

Code generation failed for Predicate: Function 'geo_distance' does not accept parameters (DOUBLE, DOUBLE, DECIMAL(6, 4), DECIMAL(7, 4)).
Valid alternatives are:

For detailed information on a function run: DESCRIBE FUNCTION <Function-Name>;. expression:(GEO_DISTANCE(LATITUDE, LONGITUDE, 37.4133, -122.1162) <= 5), schema:`ROWKEY` STRING KEY, `PROFILEID` STRING, `LATITUDE` DOUBLE, `LONGITUDE` DOUBLE, `ROWTIME` BIGINT, `ROWKEY` STRING

To Reproduce

  1. Build ksqlDB from master.
  2. Follow the quickstart including the command SELECT * FROM riderLocations WHERE GEO_DISTANCE(latitude, longitude, 37.4133, -122.1162) <= 5 EMIT CHANGES;

Expected behavior

Query is submitted successfully.

Actual behaviour

The error message

Code generation failed for Predicate: Function 'geo_distance' does not accept parameters (DOUBLE, DOUBLE, DECIMAL(6, 4), DECIMAL(7, 4)).
Valid alternatives are:

For detailed information on a function run: DESCRIBE FUNCTION <Function-Name>;. expression:(GEO_DISTANCE(LATITUDE, LONGITUDE, 37.4133, -122.1162) <= 5), schema:`ROWKEY` STRING KEY, `PROFILEID` STRING, `LATITUDE` DOUBLE, `LONGITUDE` DOUBLE, `ROWTIME` BIGINT, `ROWKEY` STRING

Additional context

This is not an issue on 0.8.1 or earlier.

agavra commented 4 years ago

@vcrfxia did you compile with the -parameters flag? (do any UDFs work?)

vcrfxia commented 4 years ago

I built a docker image from master using the command in https://github.com/confluentinc/ksql/blob/master/ksqldb-docker/README.md.

I just tried the latest RC from Jenkins and it's not an issue there so it must be something about the docker build command, but the two look more or less the same to me. Can you spot the difference?

vcrfxia commented 4 years ago

The only difference that jumps out at me is that the two commands use different maven profiles, but comparing the two profiles I don't see any overrides that affect the -parameters compiler arg specified in the ksqldb-parent pom.

vcrfxia commented 4 years ago

Tried reproducing this just now on the latest master and was unsuccessful with either the UBI base image or the old Debian base image, so I'm going to close this issue as fluke šŸ¤·