[fix](type) forbid time type when creating table (#15093)
This commit is contained in:
@ -401,6 +401,10 @@ public class CreateTableStmt extends DdlStmt {
|
||||
}
|
||||
}
|
||||
|
||||
if (columnDef.getType().isTime() || columnDef.getType().isTimeV2()) {
|
||||
throw new AnalysisException("Time type is not supported for olap table");
|
||||
}
|
||||
|
||||
if (columnDef.getType().isObjectStored()) {
|
||||
hasObjectStored = true;
|
||||
objectStoredColumn = columnDef.getName();
|
||||
|
||||
@ -118,7 +118,8 @@ public class AlterTest {
|
||||
+ "PROPERTIES('replication_num' = '1');");
|
||||
|
||||
createTable(
|
||||
"CREATE TABLE test.tbl6\n" + "(\n" + " k1 datetime(3),\n" + " k2 time(3),\n" + " v1 int \n,"
|
||||
"CREATE TABLE test.tbl6\n" + "(\n" + " k1 datetime(3),\n" + " k2 datetime(3),\n"
|
||||
+ " v1 int \n,"
|
||||
+ " v2 datetime(3)\n" + ") ENGINE=OLAP\n" + "UNIQUE KEY (k1,k2)\n"
|
||||
+ "PARTITION BY RANGE(k1)\n" + "(\n"
|
||||
+ " PARTITION p1 values less than('2020-02-01 00:00:00'),\n"
|
||||
@ -410,7 +411,7 @@ public class AlterTest {
|
||||
alterTable(stmt, true);
|
||||
|
||||
// no conflict
|
||||
stmt = "alter table test.tbl6 add column k3 int, add column k4 time(6)";
|
||||
stmt = "alter table test.tbl6 add column k3 int, add column k4 datetime(6)";
|
||||
alterTable(stmt, false);
|
||||
waitSchemaChangeJobDone(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user