deniskuzZ commented on code in PR #5645:
URL: https://github.com/apache/hive/pull/5645#discussion_r1965094527
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java:
##########
@@ -97,22 +109,36 @@ private static Expression translate(ExpressionTree tree,
List<PredicateLeaf> lea
* @return Expression fully translated from Hive PredicateLeaf
*/
private static Expression translateLeaf(PredicateLeaf leaf) {
- String column = leaf.getColumnName();
+ TransformSpec transformSpec =
TransformSpec.fromStringWithColumnName(leaf.getColumnName());
+ String column = transformSpec.getColumnName();
+ UnboundTerm<Object> columnTransform = getPartitionTransform(column,
transformSpec);
+ boolean withoutTransform = columnTransform == null;
+
switch (leaf.getOperator()) {
case EQUALS:
- Object literal = leafToLiteral(leaf);
- return NaNUtil.isNaN(literal) ? isNaN(column) : equal(column, literal);
+ Object literal = leafToLiteral(leaf, transformSpec);
+ return NaNUtil.isNaN(literal) ?
+ (withoutTransform ? isNaN(column) : isNaN(columnTransform)) :
Review Comment:
could we substitute `column` with `columnTransform` and don't bring a
ternary operator inside of each case block?
--
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]