You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Sergey Nuyanzin (Jira)" <ji...@apache.org> on 2026/04/16 10:31: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 ]

Sergey Nuyanzin updated FLINK-35229:
------------------------------------
    Fix Version/s:     (was: 1.19.4)
                       (was: 1.20.4)

> 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
>
> {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)