Remove calls to deprecated ColumnDescriptor.getType method. (#62)
authorJakob Homan <jghoman@users.noreply.github.com>
Fri, 11 Jan 2019 20:33:35 +0000 (12:33 -0800)
committerRyan Blue <rdblue@users.noreply.github.com>
Fri, 11 Jan 2019 20:33:35 +0000 (12:33 -0800)
parquet/src/main/java/com/netflix/iceberg/parquet/ColumnIterator.java
parquet/src/main/java/com/netflix/iceberg/parquet/ColumnWriter.java
parquet/src/main/java/com/netflix/iceberg/parquet/PageIterator.java
parquet/src/main/java/com/netflix/iceberg/parquet/ParquetDictionaryRowGroupFilter.java

index 37b4af4..fbd5e4b 100644 (file)
@@ -32,7 +32,7 @@ import java.io.IOException;
 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 abstract class ColumnIterator<T> implements TripleIterator<T> {
           }
         };
       default:
-        throw new UnsupportedOperationException("Unsupported primitive type: " + desc.getType());
+        throw new UnsupportedOperationException("Unsupported primitive type: "
+                + desc.getPrimitiveType().getPrimitiveTypeName());
     }
   }
 
index 261bde5..bbac6c3 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.parquet.io.api.Binary;
 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 abstract class ColumnWriter<T> implements TripleWriter<T> {
           }
         };
       default:
-        throw new UnsupportedOperationException("Unsupported primitive type: " + desc.getType());
+        throw new UnsupportedOperationException("Unsupported primitive type: "
+                + desc.getPrimitiveType().getPrimitiveTypeName());
     }
   }
 
index 8444e1b..48f7578 100644 (file)
@@ -50,7 +50,7 @@ abstract class PageIterator<T> implements TripleIterator<T> {
 
   @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 @@ abstract class PageIterator<T> implements TripleIterator<T> {
           }
         };
       default:
-        throw new UnsupportedOperationException("Unsupported primitive type: " + desc.getType());
+        throw new UnsupportedOperationException("Unsupported primitive type: "
+                + desc.getPrimitiveType().getPrimitiveTypeName());
     }
   }
 
index ab0112c..f7db1fb 100644 (file)
@@ -325,7 +325,7 @@ public class ParquetDictionaryRowGroupFilter {
       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 class ParquetDictionaryRowGroupFilter {
             break;
           default:
             throw new IllegalArgumentException(
-                "Cannot decode dictionary of type: " + col.getType());
+                "Cannot decode dictionary of type: " + col.getPrimitiveType().getPrimitiveTypeName());
         }
       }