英文:
Could not determine output schema for query due to error: Can't find any functions with the name 'OUNT_DISTINCT'
问题
I am following Confluent KSQLDB tutorials from here: https://www.youtube.com/watch?v=fXJw0jAyn7M&list=PLa7VYi0yPIH3ulxsOf5g43_QiB-HOg5_Y&index=4
我正在按照这里的Confluent KSQLDB教程进行学习:https://www.youtube.com/watch?v=fXJw0jAyn7M&list=PLa7VYi0yPIH3ulxsOf5g43_QiB-HOg5_Y&index=4
I've created a topic like below:
我创建了一个主题如下:
kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic person_stats
Also, I've created a table like this:
此外,我创建了一个表格如下:
CREATE TABLE PERSON_STATS WITH (VALUE_FORMAT='AVRO') AS
SELECT PERSON,
LATEST_BY_OFFSET(LOCATION) AS LATEST_LOCATION,
COUNT(*) AS LOCATION_CHANGES,
OUNT_DISTINCT(LOCATION) AS UNIQUE_LOCATIONS
FROM MOVEMENTS
GROUP BY PERSON
EMIT CHANGES;
Getting below error:
出现以下错误:
Could not determine the output schema for the query due to an error: Can't find any functions with the name 'OUNT_DISTINCT'
Statement: CREATE TABLE PERSON_STATS WITH (KAFKA_TOPIC='PERSON_STATS', PARTITIONS=1, REPLICAS=1, VALUE_FORMAT='AVRO') AS SELECT
MOVEMENTS.PERSON PERSON,
LATEST_BY_OFFSET(MOVEMENTS.LOCATION) LATEST_LOCATION,
COUNT(*) LOCATION_CHANGES,
OUNT_DISTINCT(MOVEMENTS.LOCATION) UNIQUE_LOCATIONS
FROM MOVEMENTS MOVEMENTS
GROUP BY MOVEMENTS.PERSON
EMIT CHANGES;
ksql>
Any quick help?
是否可以提供一些快速的帮助?
英文:
I am following Confluent KSQLDB tutorials from here: https://www.youtube.com/watch?v=fXJw0jAyn7M&list=PLa7VYi0yPIH3ulxsOf5g43_QiB-HOg5_Y&index=4
I've created topic like below:
kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic person_stats
Also, I've created
CREATE TABLE PERSON_STATS WITH (VALUE_FORMAT='AVRO') AS
SELECT PERSON,
LATEST_BY_OFFSET(LOCATION) AS LATEST_LOCATION,
COUNT(*) AS LOCATION_CHANGES,
OUNT_DISTINCT(LOCATION) AS UNIQUE_LOCATIONS
FROM MOVEMENTS
GROUP BY PERSON
EMIT CHANGES;
Getting below error:
Could not determine output schema for query due to error: Can't find any functions with the name 'OUNT_DISTINCT'
Statement: CREATE TABLE PERSON_STATS WITH (KAFKA_TOPIC='PERSON_STATS', PARTITIONS=1, REPLICAS=1, VALUE_FORMAT='AVRO') AS SELECT
MOVEMENTS.PERSON PERSON,
LATEST_BY_OFFSET(MOVEMENTS.LOCATION) LATEST_LOCATION,
COUNT(*) LOCATION_CHANGES,
OUNT_DISTINCT(MOVEMENTS.LOCATION) UNIQUE_LOCATIONS
FROM MOVEMENTS MOVEMENTS
GROUP BY MOVEMENTS.PERSON
EMIT CHANGES;
ksql>
Any quick help?
答案1
得分: 0
我已经能够通过以下方式修复它,运行正常
CREATE TABLE PERSON_STATS WITH (VALUE_FORMAT='AVRO') AS
SELECT PERSON,
LATEST_BY_OFFSET(LOCATION) AS LATEST_LOCATION,
COUNT(*) AS LOCATION_CHANGES,
COUNT_DISTINCT(LOCATION) AS UNIQUE_LOCATIONS
FROM MOVEMENTS
GROUP BY PERSON
EMIT CHANGES;
英文:
I was able to fix it by using below, works fine
CREATE TABLE PERSON_STATS WITH (VALUE_FORMAT='AVRO') AS
SELECT PERSON,
LATEST_BY_OFFSET(LOCATION) AS LATEST_LOCATION,
COUNT(*) AS LOCATION_CHANGES,
COUNT_DISTINCT(LOCATION) AS UNIQUE_LOCATIONS
FROM MOVEMENTS
GROUP BY PERSON
EMIT CHANGES;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论