You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Shandy (Jira)" <ji...@apache.org> on 2021/12/31 13:00:00 UTC

[jira] [Created] (FLINK-25499) Column 'window_start' is ambiguous

Shandy created FLINK-25499:
------------------------------

             Summary: Column 'window_start' is ambiguous
                 Key: FLINK-25499
                 URL: https://issues.apache.org/jira/browse/FLINK-25499
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / API
    Affects Versions: 1.14.2
         Environment: Flink 1.14.0
            Reporter: Shandy


*use sql-client create view such as:*
=================================================
CREATE TEMPORARY VIEW IF NOT EXISTS telemetry_r_yangchen_standard_t
AS
(
    SELECT a.window_start,a.window_end,a.window_time as rowTime,last_value(a.tenantId) as tenantId      
    FROM TABLE(TUMBLE(TABLE telemetry_r_yangchen_normal, DESCRIPTOR(receiveTimeTS), INTERVAL '10' MINUTES)) as a
    group by a.window_start, a.window_end,a.window_time
);

SELECT b.window_start, b.window_end,b.window_time as rowTime,sum(b.tenantId) as tenantId
    FROM TABLE(TUMBLE(TABLE telemetry_r_yangchen_standard_t, DESCRIPTOR(rowTime), INTERVAL '60' MINUTES)) as b
    group by b.window_start, b.window_end,b.window_time;
=================================================
*above select occurs error message:*

{color:#FF0000}*[ERROR] Could not execute SQL statement. Reason:
org.apache.calcite.sql.validate.SqlValidatorException: Column 'window_start' is ambiguous
*{color}

*if modify create sql to({color:#de350b}remove a.window_start{color}) :*

============================================

CREATE TEMPORARY VIEW IF NOT EXISTS telemetry_r_yangchen_standard_t
AS
(
    SELECT {color:#de350b}-a.windw_start,-{color}a.window_end,a.window_time as rowTime,last_value(a.tenantId) as tenantId      
    FROM TABLE(TUMBLE(TABLE telemetry_r_yangchen_normal, DESCRIPTOR(receiveTimeTS), INTERVAL '10' MINUTES)) as a
    group by a.window_start, a.window_end,a.window_time
);

============================================

*above select execute success!*



--
This message was sent by Atlassian Jira
(v8.20.1#820001)