You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/01/20 00:02:48 UTC
[GitHub] [iceberg] emkornfield commented on a change in pull request #2115: [python] Completing ResidualEvaluator Implementation
emkornfield commented on a change in pull request #2115:
URL: https://github.com/apache/iceberg/pull/2115#discussion_r788244997
##########
File path: python/iceberg/api/expressions/projections.py
##########
@@ -15,32 +15,81 @@
# specific language governing permissions and limitations
# under the License.
+from typing import TYPE_CHECKING
from .expressions import Expressions, ExpressionVisitors, RewriteNot
from .predicate import BoundPredicate, UnboundPredicate
+if TYPE_CHECKING:
+ from .expression import Expression
+ from .predicate import Predicate
+ from ..partition_spec import PartitionSpec
-def inclusive(spec, case_sensitive=True):
+
+def inclusive(spec: 'PartitionSpec', case_sensitive: bool = True):
+ """
+ Creates an inclusive ProjectionEvaluator for the PartitionSpec, defaulting
+ to case sensitive mode.
+
+ An evaluator is used to project expressions for a table's data rows into expressions on the
+ table's partition values. The evaluator returned by this function is inclusive and will build
+ expressions with the following guarantee: if the original expression matches a row, then the
+ projected expression will match that row's partition.
+
+ Each predicate in the expression is projected using Transform.project(String, BoundPredicate).
+
+ Parameters
+ ----------
+ spec: PartitionSpec
+ a partition spec
+ case_sensitive: boolean
+ whether the Projection should consider case sensitivity on column names or not.
+
+ Returns
+ -------
+ InclusiveProjection
+ an inclusive projection evaluator for the partition spec. Inclusive transform used for each predicate
+ """
return InclusiveProjection(spec, case_sensitive)
-def strict(spec):
+def strict(spec: 'PartitionSpec'):
+ """
+ Creates a strict ProjectionEvaluatorfor the PartitionSpec, defaulting to case sensitive mode.
Review comment:
```suggestion
Creates a strict ProjectionEvaluator for the PartitionSpec, defaulting to case sensitive mode.
```
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org