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

Robert Metzger updated FLINK-16506:
-----------------------------------
    Component/s: Table SQL / Planner

> SqlCreateTable can not get the original text when there exists non-ascii char 
> in the column definition
> ------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-16506
>                 URL: https://issues.apache.org/jira/browse/FLINK-16506
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.10.0
>            Reporter: Terry Wang
>            Priority: Major
>
> We can reproduce this problem in FlinkSqlParserImplTest, add one more column 
> definition
> `  x varchar comment 'Flink 社区', \n`
> ```
>       @Test
>       public void testCreateTableWithComment() {
>               conformance0 = FlinkSqlConformance.HIVE;
>               check("CREATE TABLE tbl1 (\n" +
>                               "  a bigint comment 'test column comment 
> AAA.',\n" +
>                               "  h varchar, \n" +
>                               "  x varchar comment 'Flink 社区', \n" +
>                               "  g as 2 * (a + 1), \n" +
>                               "  ts as toTimestamp(b, 'yyyy-MM-dd HH:mm:ss'), 
> \n" +
>                               "  b varchar,\n" +
>                               "  proc as PROCTIME(), \n" +
>                               "  PRIMARY KEY (a, b)\n" +
>                               ")\n" +
>                               "comment 'test table comment ABC.'\n" +
>                               "PARTITIONED BY (a, h)\n" +
>                               "  with (\n" +
>                               "    'connector' = 'kafka', \n" +
>                               "    'kafka.topic' = 'log.test'\n" +
>                               ")\n",
>                       "CREATE TABLE `TBL1` (\n" +
>                               "  `A`  BIGINT  COMMENT 'test column comment 
> AAA.',\n" +
>                               "  `H`  VARCHAR,\n" +
>                               "  `X` VARCHAR COMMENT 'Flink 社区', \n" +
>                               "  `G` AS (2 * (`A` + 1)),\n" +
>                               "  `TS` AS `TOTIMESTAMP`(`B`, 'yyyy-MM-dd 
> HH:mm:ss'),\n" +
>                               "  `B`  VARCHAR,\n" +
>                               "  `PROC` AS `PROCTIME`(),\n" +
>                               "  PRIMARY KEY (`A`, `B`)\n" +
>                               ")\n" +
>                               "COMMENT 'test table comment ABC.'\n" +
>                               "PARTITIONED BY (`A`, `H`)\n" +
>                               "WITH (\n" +
>                               "  'connector' = 'kafka',\n" +
>                               "  'kafka.topic' = 'log.test'\n" +
>                               ")");
>       }
> ```
> the actual unparse of x column will be   ` X`  VARCHAR  COMMENT u&'Flink 
> \793e\533a' instead of our expection.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to