Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/1232#discussion_r183771627
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/TypeInferenceUtils.java
---
@@ -382,13 +407,26 @@ public RelDataType inferReturnType(SqlOperatorBinding
opBinding) {
final RelDataType operandType = opBinding.getOperandType(0);
final TypeProtos.MinorType inputMinorType =
getDrillTypeFromCalciteType(operandType);
-
if(TypeCastRules.getLeastRestrictiveType(Lists.newArrayList(inputMinorType,
TypeProtos.MinorType.BIGINT))
+ if
(TypeCastRules.getLeastRestrictiveType(Lists.newArrayList(inputMinorType,
TypeProtos.MinorType.BIGINT))
== TypeProtos.MinorType.BIGINT) {
return createCalciteTypeWithNullability(
factory,
SqlTypeName.BIGINT,
isNullable);
- } else
if(TypeCastRules.getLeastRestrictiveType(Lists.newArrayList(inputMinorType,
TypeProtos.MinorType.FLOAT8))
+ } else if
(TypeCastRules.getLeastRestrictiveType(Lists.newArrayList(inputMinorType,
TypeProtos.MinorType.FLOAT4))
--- End diff --
Please add explanation.
---