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 2020/04/26 07:48:21 UTC

[GitHub] [incubator-iceberg] waterlx commented on a change in pull request #891: Parquet: Use new logical type annotations

waterlx commented on a change in pull request #891:
URL: https://github.com/apache/incubator-iceberg/pull/891#discussion_r415244991



##########
File path: data/src/main/java/org/apache/iceberg/data/parquet/GenericParquetWriter.java
##########
@@ -117,6 +120,13 @@ private GenericParquetWriter() {
     @Override
     public ParquetValueWriter<?> primitive(PrimitiveType primitive) {
       ColumnDescriptor desc = type.getColumnDescription(currentPath());
+      LogicalTypeAnnotation logicalType = primitive.getLogicalTypeAnnotation();
+      if (logicalType != null) {
+        Optional<PrimitiveWriter<?>> writer = logicalType.accept(new LogicalTypeWriterVisitor(desc));
+        if (writer.isPresent()) {
+          return writer.get();
+        }

Review comment:
       When writer.isPresent() == false, we falls back to the previous logic, right?




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

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