walterddr commented on code in PR #9909:
URL: https://github.com/apache/pinot/pull/9909#discussion_r1044889116
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/operands/FilterOperand.java:
##########
@@ -243,28 +103,32 @@ public Predicate(List<RexExpression> functionOperands,
DataSchema dataSchema) {
* <li>if we can't resolve a common data type, exception occurs.</li>
* </ul>
*
- * @param lhsType left-hand-side type
- * @param rhsType right-hand-side type
- * @return best common conversion data type.
- * @see DataSchema.ColumnDataType#isSuperTypeOf(DataSchema.ColumnDataType)
+ *
*/
- private static DataSchema.ColumnDataType
resolveResultType(DataSchema.ColumnDataType lhsType,
- DataSchema.ColumnDataType rhsType) {
+ public Predicate(List<RexExpression> functionOperands, DataSchema
inputDataSchema) {
+ Preconditions.checkState(functionOperands.size() == 2,
+ "Expected 2 function ops for Predicate but got:" +
functionOperands.size());
+ _lhs = TransformOperand.toTransformOperand(functionOperands.get(0),
inputDataSchema);
+ _rhs = TransformOperand.toTransformOperand(functionOperands.get(1),
inputDataSchema);
+
// TODO: Correctly throw exception instead of returning null.
// Currently exception thrown during constructor is not piped back to
query dispatcher, thus in order to
// avoid silent failure, we deliberately set to null here, make the
exception thrown during data processing.
- if (lhsType == null && rhsType == null) {
- return null;
- } else if (lhsType == null || lhsType ==
DataSchema.ColumnDataType.OBJECT) {
- return rhsType;
- } else if (rhsType == null || rhsType ==
DataSchema.ColumnDataType.OBJECT) {
- return lhsType;
- } else if (lhsType.isSuperTypeOf(rhsType)) {
- return lhsType;
- } else if (rhsType.isSuperTypeOf(rhsType)) {
- return rhsType;
+ // TODO: right now all the numeric columns are still doing conversion
b/c even if the inputDataSchema asked for
+ // one of the number type, it might not contain the exact type in the
payload.
+ if (_lhs._resultType == null || _lhs._resultType ==
DataSchema.ColumnDataType.OBJECT
+ || _rhs._resultType == null || _rhs._resultType ==
DataSchema.ColumnDataType.OBJECT) {
+ _requireCasting = false;
+ _commonCastType = null;
Review Comment:
yeah we should throw in this case so will keep it for now
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]