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 2019/01/11 20:33:40 UTC

[GitHub] rdblue closed pull request #62: Remove calls to deprecated ColumnDescriptor.getType method.

rdblue closed pull request #62: Remove calls to deprecated ColumnDescriptor.getType method.
URL: https://github.com/apache/incubator-iceberg/pull/62
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnIterator.java b/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnIterator.java
index 37b4af4..fbd5e4b 100644
--- a/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnIterator.java
+++ b/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnIterator.java
@@ -32,7 +32,7 @@
 public abstract class ColumnIterator<T> implements TripleIterator<T> {
   @SuppressWarnings("unchecked")
   static <T> ColumnIterator<T> newIterator(ColumnDescriptor desc, String writerVersion) {
-    switch (desc.getType()) {
+    switch (desc.getPrimitiveType().getPrimitiveTypeName()) {
       case BOOLEAN:
         return (ColumnIterator<T>) new ColumnIterator<Boolean>(desc, writerVersion) {
           @Override
@@ -77,7 +77,8 @@ public Binary next() {
           }
         };
       default:
-        throw new UnsupportedOperationException("Unsupported primitive type: " + desc.getType());
+        throw new UnsupportedOperationException("Unsupported primitive type: "
+                + desc.getPrimitiveType().getPrimitiveTypeName());
     }
   }
 
diff --git a/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnWriter.java b/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnWriter.java
index 261bde5..bbac6c3 100644
--- a/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnWriter.java
+++ b/parquet/src/main/java/com/netflix/iceberg/parquet/ColumnWriter.java
@@ -26,7 +26,7 @@
 public abstract class ColumnWriter<T> implements TripleWriter<T> {
   @SuppressWarnings("unchecked")
   static <T> ColumnWriter<T> newWriter(ColumnDescriptor desc) {
-    switch (desc.getType()) {
+    switch (desc.getPrimitiveType().getPrimitiveTypeName()) {
       case BOOLEAN:
         return (ColumnWriter<T>) new ColumnWriter<Boolean>(desc) {
           @Override
@@ -71,7 +71,8 @@ public void write(int rl, Binary value) {
           }
         };
       default:
-        throw new UnsupportedOperationException("Unsupported primitive type: " + desc.getType());
+        throw new UnsupportedOperationException("Unsupported primitive type: "
+                + desc.getPrimitiveType().getPrimitiveTypeName());
     }
   }
 
diff --git a/parquet/src/main/java/com/netflix/iceberg/parquet/PageIterator.java b/parquet/src/main/java/com/netflix/iceberg/parquet/PageIterator.java
index 8444e1b..48f7578 100644
--- a/parquet/src/main/java/com/netflix/iceberg/parquet/PageIterator.java
+++ b/parquet/src/main/java/com/netflix/iceberg/parquet/PageIterator.java
@@ -50,7 +50,7 @@
 
   @SuppressWarnings("unchecked")
   static <T> PageIterator<T> newIterator(ColumnDescriptor desc, String writerVersion) {
-    switch (desc.getType()) {
+    switch (desc.getPrimitiveType().getPrimitiveTypeName()) {
       case BOOLEAN:
         return (PageIterator<T>) new PageIterator<Boolean>(desc, writerVersion) {
           @Override
@@ -95,7 +95,8 @@ public Binary next() {
           }
         };
       default:
-        throw new UnsupportedOperationException("Unsupported primitive type: " + desc.getType());
+        throw new UnsupportedOperationException("Unsupported primitive type: "
+                + desc.getPrimitiveType().getPrimitiveTypeName());
     }
   }
 
diff --git a/parquet/src/main/java/com/netflix/iceberg/parquet/ParquetDictionaryRowGroupFilter.java b/parquet/src/main/java/com/netflix/iceberg/parquet/ParquetDictionaryRowGroupFilter.java
index ab0112c..f7db1fb 100644
--- a/parquet/src/main/java/com/netflix/iceberg/parquet/ParquetDictionaryRowGroupFilter.java
+++ b/parquet/src/main/java/com/netflix/iceberg/parquet/ParquetDictionaryRowGroupFilter.java
@@ -325,7 +325,7 @@ public Boolean or(Boolean leftResult, Boolean rightResult) {
       Set<T> dictSet = Sets.newTreeSet(comparator);;
 
       for (int i=0; i<=dict.getMaxId(); i++) {
-        switch (col.getType()) {
+        switch (col.getPrimitiveType().getPrimitiveTypeName()) {
           case BINARY: dictSet.add((T) conversion.apply(dict.decodeToBinary(i)));
             break;
           case INT32: dictSet.add((T) conversion.apply(dict.decodeToInt(i)));
@@ -338,7 +338,7 @@ public Boolean or(Boolean leftResult, Boolean rightResult) {
             break;
           default:
             throw new IllegalArgumentException(
-                "Cannot decode dictionary of type: " + col.getType());
+                "Cannot decode dictionary of type: " + col.getPrimitiveType().getPrimitiveTypeName());
         }
       }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org