wuchong commented on a change in pull request #9243: [FLINK-13335][sql-parser]
Align the SQL CREATE TABLE DDL with FLIP-37
URL: https://github.com/apache/flink/pull/9243#discussion_r310013599
##########
File path:
flink-table/flink-sql-parser/src/test/java/org/apache/flink/sql/parser/FlinkSqlParserImplTest.java
##########
@@ -383,19 +383,21 @@ public void testCreateTableWithComplexType() {
}
@Test
- public void testCreateTableWithDecimalType() {
+ public void testCreateTableWithComplexType() {
check("CREATE TABLE tbl1 (\n" +
- " a decimal, \n" +
- " b decimal(10, 0),\n" +
- " c decimal(38, 38),\n" +
+ " a ARRAY<bigint>, \n" +
+ " b MAP<int, varchar>,\n" +
+ " c ROW<cc0 int, cc1 float, cc2 varchar>,\n" +
+ " d MULTISET<varchar>,\n" +
" PRIMARY KEY (a, b) \n" +
") with (\n" +
" x = 'y', \n" +
" asd = 'data'\n" +
")\n", "CREATE TABLE `TBL1` (\n" +
- " `A` DECIMAL,\n" +
- " `B` DECIMAL(10, 0),\n" +
- " `C` DECIMAL(38, 38),\n" +
+ " `A` ARRAY< BIGINT >,\n" +
+ " `B` MAP< INTEGER, VARCHAR >,\n" +
+ " `C` ROW< `CC0` INTEGER, `CC1` FLOAT, `CC2` VARCHAR
>,\n" +
+ " `D` MULTISET< VARCHAR >,\n" +
Review comment:
Jump in the discussion. Mysql forces to specify a length when using VARCHAR.
So in order to avoid misuse `VARCHAR`, we can drop the support of `VARCHAR`
(without length), and force users to specify a length. I think this doesn't
break ANSI-SQL?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services