[Enhancement](data-type) add FE config to prohibit create date and decimalv2 type (#19077)

* prohibits date and decimal type

* add config in test
This commit is contained in:
WenYao
2023-04-28 11:31:51 +08:00
committed by GitHub
parent 65a82a0b57
commit 5e9c0c3500
10 changed files with 36 additions and 0 deletions

View File

@ -329,6 +329,13 @@ public class CreateTableStmt extends DdlStmt {
if (Objects.equals(columnDef.getType(), Type.ALL)) {
throw new AnalysisException("Disable to create table with `ALL` type columns.");
}
if (Objects.equals(columnDef.getType(), Type.DATE) && Config.disable_datev1) {
throw new AnalysisException("Disable to create table with `DATE` type columns, please use `DATEV2`.");
}
if (Objects.equals(columnDef.getType(), Type.DECIMALV2) && Config.disable_decimalv2) {
throw new AnalysisException("Disable to create table with `DECIMAL` type columns,"
+ "please use `DECIMALV3`.");
}
}
// analyze key desc
if (engineName.equalsIgnoreCase("olap")) {