Skip to content
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

Udf parameters should be automatically cast to double #4400

Closed
vpapavas opened this issue Jan 28, 2020 · 0 comments · Fixed by #4406
Closed

Udf parameters should be automatically cast to double #4400

vpapavas opened this issue Jan 28, 2020 · 0 comments · Fixed by #4406
Assignees
Milestone

Comments

@vpapavas
Copy link
Member

Describe the bug
Udf parameters are interpreted as BigDecimals which causes existing udf to fail because they expect double.

To Reproduce
Steps to reproduce the behavior, include:

  1. The version of KSQL.
    Current master
  2. Sample source data.
    No data needed
  3. Any SQL statements you ran
    Quickstart guide:
CREATE STREAM riderLocations (profileId VARCHAR, latitude DOUBLE, longitude DOUBLE) WITH (kafka_topic='locations', key='profileId', value_format='json', partitions=1);
SELECT * FROM riderLocations
WHERE GEO_DISTANCE(latitude, longitude, 37.4133, -122.1162) <= 5 EMIT CHANGES;

Actual behaviour
A clear and concise description of what actually happens, including:

  1. CLI output
Code generation failed for Predicate: Function 'geo_distance' does not accept parameters of types:[DOUBLE, DOUBLE, DECIMAL(6, 4), DECIMAL(7, 4)]. expression:(GEO_DISTANCE(LATITUDE, LONGITUDE, 37.4133, -122.1162) <= 5), schema:`ROWKEY` STRING KEY, `ROWTIME` BIGINT, `ROWKEY` STRING, `PROFILEID` STRING, `LATITUDE` DOUBLE, `LONGITUDE` DOUBLE
Caused by: Function 'geo_distance' does not accept parameters of types:[DOUBLE,
	DOUBLE, DECIMAL(6, 4), DECIMAL(7, 4)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants