ankitsultana commented on code in PR #10472:
URL: https://github.com/apache/pinot/pull/10472#discussion_r1152821725


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/operands/FunctionOperand.java:
##########
@@ -52,6 +52,9 @@ public FunctionOperand(RexExpression.FunctionCall 
functionCall, DataSchema dataS
     _resultName = computeColumnName(functionCall.getFunctionName(), 
_childOperandList);
     // TODO: Check type match between functionCall's data type and result type.
     _resultType = 
FunctionUtils.getColumnDataType(_functionInvoker.getResultClass());
+
+    boolean isTypeMatched = functionCall.getDataType() == 
_resultType.toDataType();
+    Preconditions.checkState(isTypeMatched, "Mismatch function data type and 
result type");

Review Comment:
   I think it might be worthwhile to add a couple or so queries which do 
comparisons of double/float columns with double/float literals, and likewise 
for int/long columns.
   
   Stuff like:
   
   ```
   case longCol > 10
   ...
   case doubleCol < 1.3
   case floatCol < 10
   ..
   where longCol < 10 and doubleCol < 1.3 and floatCol < 10...
   
   ..
   with tmp as (select sum(floatCol) as float_sum from ... group by col1) 
select * from tmp where float_sum < 10
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to