Github user hsuanyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/397#discussion_r56456528
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillAvgVarianceConvertlet.java
 ---
    @@ -40,7 +43,16 @@
     public class DrillAvgVarianceConvertlet implements SqlRexConvertlet {
     
       private final SqlAvgAggFunction.Subtype subtype;
    -  private static final DrillSqlOperator CastHighOp = new 
DrillSqlOperator("CastHigh", 1, false);
    +  private static final DrillSqlOperator CastHighOp = new 
DrillSqlOperator("CastHigh", 1, false,
    +      new SqlReturnTypeInference() {
    +        @Override
    +        public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
    +          return TypeInferenceUtils.createCalciteTypeWithNullability(
    +              opBinding.getTypeFactory(),
    +              SqlTypeName.ANY,
    --- End diff --
    
    1.This is the legacy code. In theory, we should not create DrillSqlOperator 
outside of DrillFunctionRegistry. 
    
    2. Convertlet follows after validation.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to