rdblue commented on code in PR #6128: URL: https://github.com/apache/iceberg/pull/6128#discussion_r1028605806
########## python/pyiceberg/transforms.py: ########## @@ -511,6 +590,31 @@ def preserves_order(self) -> bool: def source_type(self) -> IcebergType: return self._source_type + def project(self, name: str, pred: BoundPredicate) -> Optional[UnboundPredicate]: + field_type = pred.term.ref().field.field_type + + if isinstance(pred.term, BoundTransform): + return _project_transform_predicate(self, name, pred) + + # Implement startswith and notstartswith for string (and probably binary) + # https://github.com/apache/iceberg/issues/6112 + + if isinstance(pred, BoundUnaryPredicate): + return pred.as_unbound(Reference(name)) + + if isinstance(field_type, (IntegerType, LongType, DecimalType)): + if isinstance(pred, BoundLiteralPredicate): + return _truncate_number(name, pred, self.transform(field_type)) + elif isinstance(pred, BoundIn): + return _transform_set(name, pred, self.transform(field_type)) Review Comment: Yeah, I just meant for the inner `elif` case, where both call `_set_apply_transform`. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org