danny0405 commented on code in PR #10524: URL: https://github.com/apache/hudi/pull/10524#discussion_r1456761992
########## hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/source/TestExpressionPredicates.java: ########## @@ -164,4 +166,20 @@ public void testFilterPredicateFromExpression() { assertEquals(predicate19.toString(), predicate20.toString()); assertEquals(or(lt, gt), predicate20.filter()); } + + @Test + public void testDisablePredicatesPushDownForUnsupportedType() { + FieldReferenceExpression fieldReference = new FieldReferenceExpression("f_decimal", DataTypes.DECIMAL(7, 2), 0, 0); + ValueLiteralExpression valueLiteral = new ValueLiteralExpression(BigDecimal.valueOf(100.00)); + List<ResolvedExpression> expressions = Arrays.asList(fieldReference, valueLiteral); + + CallExpression greaterThanExpression = new CallExpression(BuiltInFunctionDefinitions.GREATER_THAN, expressions, DataTypes.DECIMAL(7, 2)); + Predicate greaterThanPredicate = fromExpression(greaterThanExpression); + CallExpression lessThanExpression = new CallExpression(BuiltInFunctionDefinitions.LESS_THAN, expressions, DataTypes.DECIMAL(7, 2)); + Predicate lessThanPredicate = fromExpression(lessThanExpression); + +// Decimal type push down is unsupported, so we expect null + assertNull(And.getInstance().bindPredicates(greaterThanPredicate, lessThanPredicate).filter()); Review Comment: you can move the comment inside `assertNull`. -- 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...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org