[ https://issues.apache.org/jira/browse/FLINK-37941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17959632#comment-17959632 ]
Xuyang Zhong commented on FLINK-37941: -------------------------------------- Hi, [~dwysakowicz] . I've noticed that you were involved in this [Flip-110|https://cwiki.apache.org/confluence/display/FLINK/FLIP-110%3A+Support+LIKE+clause+in+CREATE+TABLE]. Could you help confirm whether this is by design? I checked the Flip, but it doesn’t seem to describe this behavior. > EXCLUDING PARTITIONS doesn't work when using CREATE TABLE LIKE > -------------------------------------------------------------- > > Key: FLINK-37941 > URL: https://issues.apache.org/jira/browse/FLINK-37941 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 2.0.0, 1.20.1 > Reporter: Xuyang Zhong > Priority: Major > > The following test can reproduce this bug: > > {code:java} > @Test > def test(): Unit = { > tEnv > .executeSql(s""" > |CREATE TABLE `originalT` ( > | `msisdn` VARCHAR(2147483647), > | `uuid` VARCHAR(2147483647) NOT NULL, > | `street_id` VARCHAR(2147483647), > | `dt` VARCHAR(2147483647) NOT NULL, > | CONSTRAINT `PK_dt_uuid` PRIMARY KEY (`dt`, `uuid`) NOT > ENFORCED > |) COMMENT 'radius日志表,以事件日期为分区' > |PARTITIONED BY (`dt`) > |WITH ( > | 'connector' = 'values' > |) > |""".stripMargin) > .await() > tEnv > .executeSql(s""" > |create table `newT` LIKE `originalT`( > | INCLUDING ALL > | EXCLUDING PARTITIONS > | ) > |; > |""".stripMargin) > .await() > val re = tEnv.executeSql("show create table `newT`;") > println(re.asInstanceOf[TableResultImpl].collect().next()) > } {code} > The result is: > {code:java} > CREATE TABLE `default_catalog`.`default_database`.`newT` ( > `msisdn` VARCHAR(2147483647), > `uuid` VARCHAR(2147483647) NOT NULL, > `street_id` VARCHAR(2147483647), > `dt` VARCHAR(2147483647) NOT NULL, > CONSTRAINT `PK_dt_uuid` PRIMARY KEY (`dt`, `uuid`) NOT ENFORCED > ) PARTITIONED BY (`dt`) > WITH ( > 'connector' = 'values' > ) {code} > It seems that `EXCLUDING PARTITIONS` doesn't work actually. -- This message was sent by Atlassian Jira (v8.20.10#820010)