Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public static ScalarType createType(PrimitiveType type, int len, int precision,
case DECIMAL32:
case DECIMAL64:
case DECIMAL128:
return createDecimalV3Type(precision, scale);
case DECIMALV2:
return createDecimalType(precision, scale);
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private Type icebergPrimitiveTypeToDorisType(org.apache.iceberg.types.Type.Primi
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
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;

Expand Down Expand Up @@ -880,11 +879,7 @@ public Type trinoTypeToDoris(JdbcFieldSchema fieldSchema) {

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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,6 @@ s_name TEXT Yes false \N NONE
s_address TEXT Yes false \N NONE
s_nationkey INT Yes false \N NONE
s_phone TEXT Yes false \N NONE
s_acctbal DECIMAL(12, 2) Yes false \N NONE
s_acctbal DECIMALV3(12, 2) Yes false \N NONE
s_comment TEXT Yes false \N NONE