rdblue commented on code in PR #6128:
URL: https://github.com/apache/iceberg/pull/6128#discussion_r1022140064
##########
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:
We should follow up to validate `NaN` handling in several places. I just
checked and we allow NaN values into literals, which we should not do. Java
disallows it here:
https://github.com/apache/iceberg/blob/master/api/src/main/java/org/apache/iceberg/expressions/Literals.java#L61
--
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]