Skip to content

Commit 031d832

Browse files
nokiaMSgithubgxll
authored andcommitted
[fix][core] Return decimal for tinyint division.
1 parent 61bb8c2 commit 031d832

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ && getDefaultPrecision(typeName) != -1) {
240240

241241
@Override public RelDataType deriveAvgAggType(RelDataTypeFactory typeFactory,
242242
RelDataType argumentType) {
243-
if(argumentType.getSqlTypeName() == SqlTypeName.INTEGER || argumentType.getSqlTypeName() == SqlTypeName.BIGINT) {
243+
if(argumentType.getSqlTypeName() == SqlTypeName.TINYINT ||
244+
argumentType.getSqlTypeName() == SqlTypeName.INTEGER ||
245+
argumentType.getSqlTypeName() == SqlTypeName.BIGINT) {
244246
return typeFactory.createSqlType(SqlTypeName.DECIMAL);
245247
}
246248
return argumentType;

0 commit comments

Comments
 (0)