Skip to content

Commit 0e39831

Browse files
nokiaMSgithubgxll
authored andcommitted
[fix][dingo-common] Decimal pushdown - Set precision and scale for column definition.
1 parent 8f59aa2 commit 0e39831

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dingo-common/src/main/java/io/dingodb/common/table/ColumnDefinition.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io.dingodb.common.meta.SchemaState;
2525
import io.dingodb.common.type.DingoType;
2626
import io.dingodb.common.type.DingoTypeFactory;
27+
import io.dingodb.common.type.scalar.DecimalType;
2728
import lombok.Builder;
2829
import lombok.EqualsAndHashCode;
2930
import lombok.Getter;
@@ -166,7 +167,12 @@ public boolean isPrimary() {
166167

167168
@JsonIgnore
168169
public DingoType getType() {
169-
return DingoTypeFactory.INSTANCE.fromName(type, elementType, nullable);
170+
DingoType dingoType = DingoTypeFactory.INSTANCE.fromName(type, elementType, nullable);
171+
if (dingoType instanceof DecimalType) {
172+
((DecimalType) dingoType).setPrecision(precision);
173+
((DecimalType) dingoType).setScale(scale);
174+
}
175+
return dingoType;
170176
}
171177

172178
@JsonIgnore

0 commit comments

Comments
 (0)