You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Hong Liang Teoh (Jira)" <ji...@apache.org> on 2024/06/03 07:41:00 UTC
[jira] [Updated] (FLINK-35229) join An error occurred when the table was empty
[ https://issues.apache.org/jira/browse/FLINK-35229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hong Liang Teoh updated FLINK-35229:
------------------------------------
Fix Version/s: 1.19.2
(was: 1.19.1)
> 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.18.1, 1.17.3, 1.19.2
>
>
> {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)