danny0405 commented on code in PR #10531:
URL: https://github.com/apache/hudi/pull/10531#discussion_r1463133565
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/source/TestExpressionPredicates.java:
##########
@@ -182,4 +187,188 @@ public void
testDisablePredicatesPushDownForUnsupportedType() {
assertNull(Or.getInstance().bindPredicates(greaterThanPredicate,
lessThanPredicate).filter(), "Decimal type push down is unsupported, so we
expect null");
assertNull(Not.getInstance().bindPredicate(greaterThanPredicate).filter(),
"Decimal type push down is unsupported, so we expect null");
}
+
+ private void testColumnPredicateLiteralTypeConversion(String fieldName,
DataType dataType, Object literalValue, String errorMsg) {
+ FieldReferenceExpression fieldReference = new
FieldReferenceExpression(fieldName, dataType, 0, 0);
+ ValueLiteralExpression valueLiteral = new
ValueLiteralExpression(literalValue);
+
+ ExpressionPredicates.ColumnPredicate predicate =
Equals.getInstance().bindFieldReference(fieldReference).bindValueLiteral(valueLiteral);
+ assertDoesNotThrow(predicate::filter, errorMsg);
+ }
+
+ @Test
+ public void testColumnPredicateLiteralTypeConversionFromBoolean2Boolean() {
Review Comment:
Can we write the test as a `ParameterizedTest` and the data type could be a
param.
--
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]