Emm... 这个好奇怪,理论上 IDEA 中运行的时候可能会有问题 (Calcite bug 导致的问题),SQL CLI 中不应该有问题。 你的集群/作业中有其他的依赖吗? 比如自己依赖了 Calcite?
Best, Jark On Tue, 24 Mar 2020 at 23:37, flink小猪 <[email protected]> wrote: > 当我尝试通过sql client创建kafka源表时(这里借鉴了云邪大佬的《Demo:基于 Flink SQL 构建流式应用》文章), > CREATE TABLE user_behavior ( > user_id BIGINT, > item_id BIGINT, > category_id BIGINT, > behavior STRING, > ts TIMESTAMP(3), > proctime as PROCTIME(), > WATERMARK FOR ts as ts - INTERVAL '5' SECOND > ) WITH ( > 'connector.type' = 'kafka', > 'connector.version' = 'universal', > 'connector.topic' = 'user_behavior', > 'connector.startup-mode' = 'earliest-offset', > 'connector.properties.zookeeper.connect' = '192.168.1.214:2181', > 'connector.properties.bootstrap.servers' = '192.168.1.214:9092', > 'format.type' = 'json' > ) > 出现错误 > org.apache.calcite.sql.validate.SqlValidatorException: Unknown identifier > 'ts' > 我以为是我的建表语句有问题,但是当我通过代码(在idea上运行)创建这个表时,没有任何问题,数据也是可以正常查询到。当我提交到集群上运行时又出现org.apache.calcite.sql.validate.SqlValidatorException: > Unknown identifier 'ts' > ,我猜测是jar不全的问题,但是我按照云邪大佬的文章导入了 > flink-sql-connector-kafka_2.11-1.10.0.jar > flink-json-1.10.0.jar > 在sql-client上执行还是错误,是我缺少什么jar包吗? > > > > > >
