[Enhancement](multi-catalogs) Use decimal V3 type in multi-catalogs module. (#18926)

1. Use decimal V3 type in JDBC and Iceberg tables.
2. Fix hdfs TVF decimal V3 type and regression test.
This commit is contained in:
Qi Chen
2023-04-25 14:49:40 +08:00
committed by GitHub
parent a4a85f2476
commit 61b7a52444
4 changed files with 4 additions and 8 deletions

View File

@ -87,7 +87,7 @@ public class IcebergExternalTable extends ExternalTable {
return ScalarType.createCharType(fixed.length());
case DECIMAL:
Types.DecimalType decimal = (Types.DecimalType) primitive;
return ScalarType.createDecimalType(decimal.precision(), decimal.scale());
return ScalarType.createDecimalV3Type(decimal.precision(), decimal.scale());
case DATE:
return ScalarType.createDateV2Type();
case TIMESTAMP:

View File

@ -23,7 +23,6 @@ import org.apache.doris.catalog.JdbcResource;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.catalog.ScalarType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.util.Util;
@ -880,11 +879,7 @@ public class JdbcClient {
private Type createDecimalOrStringType(int precision, int scale) {
if (precision <= ScalarType.MAX_DECIMAL128_PRECISION) {
if (!Config.enable_decimal_conversion && (precision > ScalarType.MAX_DECIMALV2_PRECISION
|| scale > ScalarType.MAX_DECIMALV2_SCALE)) {
return ScalarType.createStringType();
}
return ScalarType.createDecimalType(precision, scale);
return ScalarType.createDecimalV3Type(precision, scale);
}
return ScalarType.createStringType();
}