Skip to content

Commit 5aeba76

Browse files
committed
[fix][core] Adjust the precision and scale of the return type of avg function
1 parent 0b9633e commit 5aeba76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystemImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ && getDefaultPrecision(typeName) != -1) {
243243
if(argumentType.getSqlTypeName() == SqlTypeName.TINYINT ||
244244
argumentType.getSqlTypeName() == SqlTypeName.INTEGER ||
245245
argumentType.getSqlTypeName() == SqlTypeName.BIGINT) {
246-
return typeFactory.createSqlType(SqlTypeName.DECIMAL);
246+
return typeFactory.createSqlType(SqlTypeName.DECIMAL, 14, 4);
247247
}
248248
return argumentType;
249249
}

0 commit comments

Comments
 (0)