[
https://issues.apache.org/jira/browse/FLINK-35229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xuannan Su updated FLINK-35229:
-------------------------------
Fix Version/s: 1.20.4
(was: 1.20.3)
> join An error occurred when the table was empty
> -----------------------------------------------
>
> Key: FLINK-35229
> URL: https://issues.apache.org/jira/browse/FLINK-35229
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Affects Versions: 1.18.0, 1.17.2, 1.19.0
> Reporter: lixu
> Priority: Major
> Fix For: 1.19.4, 1.20.4
>
>
> {code:java}
> //代码占位符
> StreamExecutionEnvironment env =
> StreamExecutionEnvironment.getExecutionEnvironment();
> env.setRuntimeMode(RuntimeExecutionMode.BATCH).setParallelism(1);
> StreamTableEnvironment tableEnvironment = StreamTableEnvironment.create(env);
> Table ticker = tableEnvironment.fromValues(
> DataTypes.ROW(
> DataTypes.FIELD("symbol", DataTypes.STRING()),
> DataTypes.FIELD("price", DataTypes.BIGINT())
> ),
> row("A", 12L),
> row("B", 17L)
> );
> tableEnvironment.createTemporaryView("ticker_t", ticker);
> Table ticker1 = tableEnvironment.fromValues(
> DataTypes.ROW(
> DataTypes.FIELD("symbol", DataTypes.STRING()),
> DataTypes.FIELD("price", DataTypes.BIGINT())
> )
> );
> tableEnvironment.createTemporaryView("ticker_y", ticker1);
> Table ticker2 = tableEnvironment.fromValues(
> DataTypes.ROW(
> DataTypes.FIELD("symbol", DataTypes.STRING()),
> DataTypes.FIELD("price", DataTypes.BIGINT())
> ),
> row("A", 12L),
> row("B", 17L)
> );
> tableEnvironment.createTemporaryView("ticker_z", ticker2);
> tableEnvironment.sqlQuery("select coalesce(t.symbol, y.symbol, z.symbol) as
> symbol, " +
> " t.price as price_t, y.price as price_y, z.price as price_z
> " +
> "from ticker_t t FULL OUTER JOIN ticker_y y ON t.symbol =
> y.symbol " +
> "FULL OUTER JOIN ticker_z z ON y.symbol = z.symbol")
> .execute().print(); {code}
> +----+--------------------------------+----------------------+----------------------+----------------------+
> | op | symbol | price_t |
> price_y | price_z |
> +----+--------------------------------+----------------------+----------------------+----------------------+
> | +I | A | 12 |
> <NULL> | <NULL> |
> | +I | B | 17 |
> <NULL> | <NULL> |
> | +I | A | <NULL> |
> <NULL> | 12 |
> | +I | B | <NULL> |
> <NULL> | 17 |
> +----+--------------------------------+----------------------+----------------------+----------------------+
--
This message was sent by Atlassian Jira
(v8.20.10#820010)