org.apache.calcite.sql.validate.SqlValidatorException: Unknown identifier 'ts'

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

org.apache.calcite.sql.validate.SqlValidatorException: Unknown identifier 'ts'

fenglei
大家好,我在定义DDL的时候,根据数据源中的logTime 字段,设置了watermark,但是我在idea 运行的时候,出现了这个问题。Unknown identifier 'ts'。
        String sourceDDL = "CREATE TABLE kafka_source (\n" +
                "  msg VARCHAR,\n" +
                "  level VARCHAR,\n" +
                "  timeConsuming INT,\n" +
                "  logTime TIMESTAMP(3), " +  
                " proctime AS PROCTIME(), \n" +  
                " WATERMARK FOR logTime AS ts - INTERVAL '1' SECOND \n" +  
                ") WITH (\n" +
                "  'connector' = 'kafka', \n" +
                "  'topic'='*******',\n" +
                "  'properties.bootstrap.servers' = '*****', \n" +
                "  'format' = 'json',\n" +
                "  'scan.startup.mode' = 'latest-offset'\n" +
                ")";

我不知道,这是什么原因导致的,请大佬们指点下。我是用的flink 版本是 1.13.1 我maven 中依赖的包如下:
flink-table-api-java-bridge  flink-table-planner-blink  flink-table-common  flink-connector-jdbc  
flink-connector-kafka_2.11 flink-json  flink-clients