[ 
https://issues.apache.org/jira/browse/FLINK-41527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ramin Gharib closed FLINK-41527.
--------------------------------
    Fix Version/s: 2.5.0
       Resolution: Fixed

Fixed in master: 321f3eb5b44782e191ffe42e30e76334159ce57f

> Reject repeated column names in CTAS, RTAS and materialized table column lists
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-41527
>                 URL: https://issues.apache.org/jira/browse/FLINK-41527
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API, Table SQL / Planner
>            Reporter: Timo Theusner
>            Assignee: Timo Theusner
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.5.0
>
>
> CTAS, RTAS, {{CREATE MATERIALIZED TABLE}} and {{CREATE OR ALTER MATERIALIZED 
> TABLE}} accept a column list that names a query column twice: {{(a BIGINT, a 
> DOUBLE)}} silently keeps the last declaration, and {{(a, a) AS SELECT a, b}} 
> silently drops {{b}} from the table and the query. These statements should 
> fail with a {{ValidationException}}, as plain {{CREATE TABLE}} and {{INSERT 
> INTO}} already do.
> Proposed Changes
> * Reject a repeated declared column name in 
> {{AsQuerySchemaMerger#addDeclaredColumn}}, also when the query produces that 
> column
> * Reject repeated names in {{MergeTableAsUtil.SchemaBuilder#reorderColumns}} 
> before the column-count check
> * Remove the separate repeat check in 
> {{DescriptorMaterializedTableMergeContext#getMergedSchema}} (FLINK-41237), 
> now covered by {{AsQuerySchemaMerger}}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to