You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "HunterXHunter (Jira)" <ji...@apache.org> on 2022/11/11 09:40:00 UTC

[jira] [Created] (FLINK-29992) Join execution plan parsing error

HunterXHunter created FLINK-29992:
-------------------------------------

             Summary: Join execution plan parsing error
                 Key: FLINK-29992
                 URL: https://issues.apache.org/jira/browse/FLINK-29992
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
    Affects Versions: 1.16.0, 1.17.0
            Reporter: HunterXHunter


{code:java}
//
tableEnv.executeSql(" CREATE CATALOG hive WITH (\n"
        + "  'type' = 'hive',\n"
        + " 'default-database' = 'flinkdebug',\n"
        + " 'hive-conf-dir' = '/programe/hadoop/hive-3.1.2/conf'\n"
        + " )");
tableEnv.executeSql("create table datagen_tbl (\n"
        + "id STRING\n"
        + ",name STRING\n"
        + ",age bigint\n"
        + ",ts bigint\n"
        + ",`par` STRING\n"
        + ",pro_time as PROCTIME()\n"
        + ") with (\n"
        + "  'connector'='datagen'\n"
        + ",'rows-per-second'='10'\n"
        + " \n"
        + ")");
String dml1 = "select * "
        + " from datagen_tbl as p "
        + " join hive.flinkdebug.default_hive_src_tbl "
        + " FOR SYSTEM_TIME AS OF p.pro_time AS c"
        + " ON p.id = c.id";
// Execution succeeded
  System.out.println(tableEnv.explainSql(dml1));
String dml2 = "select p.id "
        + " from datagen_tbl as p "
        + " join hive.flinkdebug.default_hive_src_tbl "
        + " FOR SYSTEM_TIME AS OF p.pro_time AS c"
        + " ON p.id = c.id";
// Throw an exception
 System.out.println(tableEnv.explainSql(dml2)); {code}
{code:java}
org.apache.flink.table.api.TableException: Cannot generate a valid execution plan for the given query: FlinkLogicalCalc(select=[id]) +- FlinkLogicalJoin(condition=[=($0, $1)], joinType=[inner])    :- FlinkLogicalCalc(select=[id])    :  +- FlinkLogicalTableSourceScan(table=[[default_catalog, default_database, datagen_tbl]], fields=[id, name, age, ts, par])    +- FlinkLogicalSnapshot(period=[$cor1.pro_time])       +- FlinkLogicalTableSourceScan(table=[[hive, flinkdebug, default_hive_src_tbl, project=[id]]], fields=[id])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)
 
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)