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/05/09 06:22:26 UTC
[GitHub] [iceberg] jun-he opened a new pull request, #4727: add VoidTransform
jun-he opened a new pull request, #4727:
URL: https://github.com/apache/iceberg/pull/4727
To split the PR https://github.com/apache/iceberg/pull/3450, open a new PR for void transform here.
--
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
[GitHub] [iceberg] rdblue commented on pull request #4727: add VoidTransform
Posted by GitBox <gi...@apache.org>.
rdblue commented on PR #4727:
URL: https://github.com/apache/iceberg/pull/4727#issuecomment-1121819613
@jun-he, since #4728 was merged, I think this will fail tests. Can you update please?
--
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
[GitHub] [iceberg] jun-he commented on a diff in pull request #4727: add VoidTransform
Posted by GitBox <gi...@apache.org>.
jun-he commented on code in PR #4727:
URL: https://github.com/apache/iceberg/pull/4727#discussion_r872649108
##########
python/src/iceberg/transforms.py:
##########
@@ -249,6 +249,32 @@ def result_type(self, source: IcebergType) -> IcebergType:
return StringType()
+class VoidTransform(Transform):
+ """A transform that always returns None"""
+
+ _instance = None
+
+ def __new__(cls):
Review Comment:
👍 Updated the test.
--
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
[GitHub] [iceberg] jun-he commented on a diff in pull request #4727: add VoidTransform
Posted by GitBox <gi...@apache.org>.
jun-he commented on code in PR #4727:
URL: https://github.com/apache/iceberg/pull/4727#discussion_r872648390
##########
python/src/iceberg/transforms.py:
##########
@@ -249,6 +249,32 @@ def result_type(self, source: IcebergType) -> IcebergType:
return StringType()
+class VoidTransform(Transform):
+ """A transform that always returns None"""
+
+ _instance = None
+
+ def __new__(cls):
+ if cls._instance is None:
+ cls._instance = super(VoidTransform, cls).__new__(cls)
+ return cls._instance
+
+ def __init__(self):
+ super().__init__("void", "transforms.always_null()")
+
+ def apply(self, value):
Review Comment:
Thanks for the comment. Updated.
--
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
[GitHub] [iceberg] rdblue commented on pull request #4727: add VoidTransform
Posted by GitBox <gi...@apache.org>.
rdblue commented on PR #4727:
URL: https://github.com/apache/iceberg/pull/4727#issuecomment-1126564730
Thanks, @jun-he!
--
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
[GitHub] [iceberg] rdblue merged pull request #4727: add VoidTransform
Posted by GitBox <gi...@apache.org>.
rdblue merged PR #4727:
URL: https://github.com/apache/iceberg/pull/4727
--
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
[GitHub] [iceberg] jun-he commented on pull request #4727: add VoidTransform
Posted by GitBox <gi...@apache.org>.
jun-he commented on PR #4727:
URL: https://github.com/apache/iceberg/pull/4727#issuecomment-1126320169
@rdblue @Fokko I rebased it and updated the PR accordingly. Can you please take a look? Thanks.
--
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
[GitHub] [iceberg] Fokko commented on a diff in pull request #4727: add VoidTransform
Posted by GitBox <gi...@apache.org>.
Fokko commented on code in PR #4727:
URL: https://github.com/apache/iceberg/pull/4727#discussion_r867736811
##########
python/src/iceberg/transforms.py:
##########
@@ -249,6 +249,32 @@ def result_type(self, source: IcebergType) -> IcebergType:
return StringType()
+class VoidTransform(Transform):
+ """A transform that always returns None"""
+
+ _instance = None
+
+ def __new__(cls):
+ if cls._instance is None:
+ cls._instance = super(VoidTransform, cls).__new__(cls)
+ return cls._instance
+
+ def __init__(self):
+ super().__init__("void", "transforms.always_null()")
+
+ def apply(self, value):
Review Comment:
Related to https://github.com/apache/iceberg/pull/4728/
```suggestion
def apply(self, value: Optional[S]) -> Optional[int]:
```
##########
python/src/iceberg/transforms.py:
##########
@@ -249,6 +249,32 @@ def result_type(self, source: IcebergType) -> IcebergType:
return StringType()
+class VoidTransform(Transform):
+ """A transform that always returns None"""
+
+ _instance = None
+
+ def __new__(cls):
Review Comment:
We could add a test for this:
```python
def test_check_if_identical():
assert transforms.always_null() is transforms.always_null()
```
##########
python/src/iceberg/transforms.py:
##########
@@ -249,6 +249,32 @@ def result_type(self, source: IcebergType) -> IcebergType:
return StringType()
+class VoidTransform(Transform):
+ """A transform that always returns None"""
+
+ _instance = None
+
+ def __new__(cls):
+ if cls._instance is None:
+ cls._instance = super(VoidTransform, cls).__new__(cls)
+ return cls._instance
+
+ def __init__(self):
+ super().__init__("void", "transforms.always_null()")
+
+ def apply(self, value):
+ return None
+
+ def can_transform(self, target: IcebergType) -> bool:
+ return True
+
+ def result_type(self, source: IcebergType) -> IcebergType:
+ return source
+
+ def to_human_string(self, value) -> str:
Review Comment:
```suggestion
def to_human_string(self, Optional[value]) -> str:
```
--
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