Fokko commented on code in PR #6128:
URL: https://github.com/apache/iceberg/pull/6128#discussion_r1027300222
##########
python/pyiceberg/transforms.py:
##########
@@ -246,9 +296,26 @@ def granularity(self) -> TimeResolution:
def satisfies_order_of(self, other: Transform) -> bool:
return self.granularity <= other.granularity if hasattr(other,
"granularity") else False
- def result_type(self, source: IcebergType) -> IcebergType:
+ def result_type(self, source: IcebergType) -> IntegerType:
return IntegerType()
+ @abstractmethod
+ def transform(self, source: IcebergType) -> Callable[[Optional[Any]],
Optional[int]]:
+ ...
+
+ def project(self, name: str, pred: BoundPredicate) ->
Optional[UnboundPredicate]:
+ transformer = self.transform(pred.term.ref().field.field_type)
+ if isinstance(pred.term, BoundTransform):
+ return _project_transform_predicate(self, name, pred)
+ elif isinstance(pred, BoundUnaryPredicate):
+ return pred.as_unbound(Reference(name))
Review Comment:
Good one! I've split this out in a separate ticket:
https://github.com/apache/iceberg/issues/6230
--
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]