Hi 诸位同仁:
诸同仁好,flink TableEnvironment.sqlUpdate是不是不支持update 多表关联更新? 如下代码: bbTableEnv.sqlUpdate("update order_tb a, min_max_usertime_tb b set a.mark=-2 " + " where a.mac=b.mac and extract(epoch from a.usertime)/7200 = b.user_2hour " + " and a.usertime > b.min_usertime and a.usertime < b.max_usertime"); 报错如下: Exception in thread "main" org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "," at line 1, column 17. Was expecting: "SET" ... at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:96) at org.apache.flink.table.planner.delegation.PlannerBase.parse(PlannerBase.scala:127) at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlUpdate(TableEnvironmentImpl.java:335) at com.sir.idle.IdleAnalysis.runBlinkBatch(IdleAnalysis.java:101) at com.sir.BatchMain.main(BatchMain.java:17) Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "," at line 1, column 17. Was expecting: "SET" ... at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.convertException(FlinkSqlParserImpl.java:368) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.normalizeException(FlinkSqlParserImpl.java:167) at org.apache.calcite.sql.parser.SqlParser.handleException(SqlParser.java:147) at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:162) at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:187) at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:92) ... 4 more Caused by: org.apache.flink.sql.parser.impl.ParseException: Encountered "," at line 1, column 17. Was expecting: "SET" ... at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.generateParseException(FlinkSqlParserImpl.java:33107) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.jj_consume_token(FlinkSqlParserImpl.java:32921) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlUpdate(FlinkSqlParserImpl.java:8227) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmt(FlinkSqlParserImpl.java:3646) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmtEof(FlinkSqlParserImpl.java:3669) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.parseSqlStmtEof(FlinkSqlParserImpl.java:214) at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:160) ... 6 more |
Hi 诸位同仁:
诸同仁好,flink TableEnvironment.sqlUpdate是不是不支持update 多表关联更新? 如下代码: bbTableEnv.sqlUpdate("update order_tb a, min_max_usertime_tb b set a.mark=-2 " + " where a.mac=b.mac and extract(epoch from a.usertime)/7200 = b.user_2hour " + " and a.usertime > b.min_usertime and a.usertime < b.max_usertime"); 报错如下: Exception in thread "main" org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "," at line 1, column 17. Was expecting: "SET" ... at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:96) at org.apache.flink.table.planner.delegation.PlannerBase.parse(PlannerBase.scala:127) at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlUpdate(TableEnvironmentImpl.java:335) at com.sir.idle.IdleAnalysis.runBlinkBatch(IdleAnalysis.java:101) at com.sir.BatchMain.main(BatchMain.java:17) Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "," at line 1, column 17. Was expecting: "SET" ... at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.convertException(FlinkSqlParserImpl.java:368) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.normalizeException(FlinkSqlParserImpl.java:167) at org.apache.calcite.sql.parser.SqlParser.handleException(SqlParser.java:147) at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:162) at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:187) at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:92) ... 4 more Caused by: org.apache.flink.sql.parser.impl.ParseException: Encountered "," at line 1, column 17. Was expecting: "SET" ... at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.generateParseException(FlinkSqlParserImpl.java:33107) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.jj_consume_token(FlinkSqlParserImpl.java:32921) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlUpdate(FlinkSqlParserImpl.java:8227) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmt(FlinkSqlParserImpl.java:3646) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmtEof(FlinkSqlParserImpl.java:3669) at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.parseSqlStmtEof(FlinkSqlParserImpl.java:214) at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:160) ... 6 more |
SQL 也不能这样吧- - At 2021-03-03 16:43:49, "JackJia" <[hidden email]> wrote: >Hi 诸位同仁: >诸同仁好,flink TableEnvironment.sqlUpdate是不是不支持update 多表关联更新? > > >如下代码: >bbTableEnv.sqlUpdate("update order_tb a, min_max_usertime_tb b set a.mark=-2 " + >" where a.mac=b.mac and extract(epoch from a.usertime)/7200 = b.user_2hour " + >" and a.usertime > b.min_usertime and a.usertime < b.max_usertime"); >报错如下: >Exception in thread "main" org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "," at line 1, column 17. >Was expecting: >"SET" ... > >at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:96) >at org.apache.flink.table.planner.delegation.PlannerBase.parse(PlannerBase.scala:127) >at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlUpdate(TableEnvironmentImpl.java:335) >at com.sir.idle.IdleAnalysis.runBlinkBatch(IdleAnalysis.java:101) >at com.sir.BatchMain.main(BatchMain.java:17) >Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "," at line 1, column 17. >Was expecting: >"SET" ... > >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.convertException(FlinkSqlParserImpl.java:368) >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.normalizeException(FlinkSqlParserImpl.java:167) >at org.apache.calcite.sql.parser.SqlParser.handleException(SqlParser.java:147) >at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:162) >at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:187) >at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:92) >... 4 more >Caused by: org.apache.flink.sql.parser.impl.ParseException: Encountered "," at line 1, column 17. >Was expecting: >"SET" ... > >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.generateParseException(FlinkSqlParserImpl.java:33107) >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.jj_consume_token(FlinkSqlParserImpl.java:32921) >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlUpdate(FlinkSqlParserImpl.java:8227) >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmt(FlinkSqlParserImpl.java:3646) >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.SqlStmtEof(FlinkSqlParserImpl.java:3669) >at org.apache.flink.sql.parser.impl.FlinkSqlParserImpl.parseSqlStmtEof(FlinkSqlParserImpl.java:214) >at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:160) >... 6 more |
Free forum by Nabble | Edit this page |