[ 
https://issues.apache.org/jira/browse/FLINK-39276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18067071#comment-18067071
 ] 

Sergey Nuyanzin commented on FLINK-39276:
-----------------------------------------

Merged as 
[37004bb3953fe06015ef4af2902d658c1ee1eb4c|https://github.com/apache/flink/commit/37004bb3953fe06015ef4af2902d658c1ee1eb4c]

> CREATE OR ALTER MATERIALIZED TABLE should respect nullability defined in 
> schema
> -------------------------------------------------------------------------------
>
>                 Key: FLINK-39276
>                 URL: https://issues.apache.org/jira/browse/FLINK-39276
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / Planner
>            Reporter: Sergey Nuyanzin
>            Assignee: Sergey Nuyanzin
>            Priority: Major
>              Labels: pull-request-available
>
> The problem is that
> if there is existing materialized table {{mt}} with schema
> {noformat}
> `a` BIGINT NOT NULL, `b` STRING, `c` INT, `d` STRING
> {noformat}
> and then we use {{CREATE OR ALTER}} like
> {code:sql}
> CREATE OR ALTER MATERIALIZED TABLE mt (
> `a` BIGINT NOT NULL, `b` STRING, `c` INT, `d` STRING, `a1` BIGINT NOT NULL) 
> AS SELECT a, b, c, d, a as `a1` FROM t3
> {code}
> then it will update existing schema adding {{`a1` BIGINT}}, i.e. it omits 
> nullability.
> It would make sense if there is no explicit schema mentioned
> however in case of schema is present it should respect it



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to