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/06/28 05:34:39 UTC

[GitHub] [iceberg] Fokko commented on a diff in pull request #5116: Python: Resolve write/read schemas

Fokko commented on code in PR #5116:
URL: https://github.com/apache/iceberg/pull/5116#discussion_r908049734


##########
python/src/iceberg/avro/reader.py:
##########
@@ -76,66 +76,102 @@ class Reader(Singleton):
     def read(self, decoder: BinaryDecoder) -> Any:
         ...
 
+    @abstractmethod
+    def skip(self, decoder: BinaryDecoder) -> None:
+        ...
+
 
 class NoneReader(Reader):
     def read(self, _: BinaryDecoder) -> None:
         return None
 
+    def skip(self, decoder: BinaryDecoder) -> None:
+        return None
+
 
 class BooleanReader(Reader):
     def read(self, decoder: BinaryDecoder) -> bool:
         return decoder.read_boolean()
 
+    def skip(self, decoder: BinaryDecoder) -> None:
+        decoder.skip_boolean()
+
 
 class IntegerReader(Reader):
     def read(self, decoder: BinaryDecoder) -> int:
         return decoder.read_int()
 
+    def skip(self, decoder: BinaryDecoder) -> None:
+        decoder.skip_int()
 
-class LongReader(Reader):
-    def read(self, decoder: BinaryDecoder) -> int:
-        return decoder.read_long()
+
+class LongReader(IntegerReader):
+    """Longs and ints are encoded the same way, and there is no long in Python"""

Review Comment:
   In Python we don't have a distinction between int/long, but in Avro we do, therefore I left it in. I'm also totally fine with removing it here as well 👍🏻 



-- 
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