直接使用redis数据 查询语句出错。报: Cannot generate a valid execution plan for the given query
maskainv opened this issue · 1 comments
看例子都是用一个自动生成数据的源连接查询的。为什么不直接查询?
` StringBuilder redisOutTable = new StringBuilder("");
redisOutTable.append("create table sink_redis (id varchar, login_account varchar, nick_name varchar) ");
redisOutTable.append("with ( 'connector'='redis', 'host'='127.0.0.1','port'='6379'," +
" 'redis-mode'='single','password'='','command'='hget'," +
" 'maxIdle'='2', 'minIdle'='1', 'lookup.cache.max-rows'='10', 'lookup.cache.ttl'='10', 'lookup.max-retries'='3')");
envTable.executeSql(redisOutTable.toString());
envTable.executeSql("create table result_table(uid VARCHAR, login_account VARCHAR, nick_name VARCHAR) with ('connector'='print')");
envTable.executeSql("insert into result_table select id, login_account, nick_name from sink_redis;");`
异常信息:Exception in thread "main" org.apache.flink.table.api.TableException: Cannot generate a valid execution plan for the given query:
FlinkLogicalSink(table=[default_catalog.default_database.result_table], fields=[id, login_account, nick_name])
+- FlinkLogicalTableSourceScan(table=[[default_catalog, default_database, sink_redis]], fields=[id, login_account, nick_name])
This exception indicates that the query uses an unsupported SQL feature.
Please check the documentation for the set of currently supported SQL features.
at org.apache.flink.table.planner.plan.optimize.program.FlinkVolcanoProgram.optimize(FlinkVolcanoProgram.scala:70)
at org.apache.flink.table.planner.plan.optimize.program.FlinkChainedProgram.$anonfun$optimize$1(FlinkChainedProgram.scala:59)
不能直接查询,只能作为维表进行join,或者sink