You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by js...@apache.org on 2014/11/29 20:16:18 UTC

[06/10] drill git commit: DRILL-1775: Fix BINARY ENUM in Parquet converter.

DRILL-1775: Fix BINARY ENUM in Parquet converter.


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/32e97112
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/32e97112
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/32e97112

Branch: refs/heads/master
Commit: 32e971126a119dd1594d47962171cf084001295c
Parents: 116e4dc
Author: Jacques Nadeau <ja...@apache.org>
Authored: Wed Nov 19 17:47:31 2014 -0800
Committer: Jason Altekruse <al...@gmail.com>
Committed: Fri Nov 28 22:28:25 2014 -0800

----------------------------------------------------------------------
 .../exec/store/parquet/columnreaders/ColumnReaderFactory.java  | 4 +++-
 .../parquet/columnreaders/ParquetToDrillTypeConverter.java     | 6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/32e97112/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ColumnReaderFactory.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ColumnReaderFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ColumnReaderFactory.java
index f9a3c9f..cbdc0b0 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ColumnReaderFactory.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ColumnReaderFactory.java
@@ -141,11 +141,13 @@ public class ColumnReaderFactory {
               return new VarLengthColumnReaders.Decimal38Column(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, (Decimal38SparseVector) v, schemaElement);
             }
           default:
+            return new VarLengthColumnReaders.VarBinaryColumn(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, (VarBinaryVector) v, schemaElement);
         }
       default:
         if (convertedType == null) {
           return new VarLengthColumnReaders.NullableVarBinaryColumn(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, (NullableVarBinaryVector) v, schemaElement);
         }
+
         switch (convertedType) {
           case UTF8:
             return new VarLengthColumnReaders.NullableVarCharColumn(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, (NullableVarCharVector) v, schemaElement);
@@ -156,9 +158,9 @@ public class ColumnReaderFactory {
               return new VarLengthColumnReaders.NullableDecimal38Column(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, (NullableDecimal38SparseVector) v, schemaElement);
             }
           default:
+            return new VarLengthColumnReaders.NullableVarBinaryColumn(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, (NullableVarBinaryVector) v, schemaElement);
         }
     }
-    throw new UnsupportedOperationException();
   }
 
   public static NullableColumnReader getNullableColumnReader(ParquetRecordReader parentReader, int allocateSize,

http://git-wip-us.apache.org/repos/asf/drill/blob/32e97112/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetToDrillTypeConverter.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetToDrillTypeConverter.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetToDrillTypeConverter.java
index 15f648c..7c3eeb8 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetToDrillTypeConverter.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetToDrillTypeConverter.java
@@ -51,7 +51,7 @@ public class ParquetToDrillTypeConverter {
               case DECIMAL:
                 return Types.withScaleAndPrecision(getDecimalType(schemaElement), TypeProtos.DataMode.OPTIONAL, schemaElement.getScale(), schemaElement.getPrecision());
               default:
-                throw new UnsupportedOperationException(String.format("unsupported type: %s %s", primitiveTypeName, convertedType));
+                return Types.optional(TypeProtos.MinorType.VARBINARY);
             }
           case INT64:
             if (convertedType == null) {
@@ -115,7 +115,7 @@ public class ParquetToDrillTypeConverter {
               case DECIMAL:
                 return Types.withScaleAndPrecision(getDecimalType(schemaElement), DataMode.REQUIRED, schemaElement.getScale(), schemaElement.getPrecision());
               default:
-                throw new UnsupportedOperationException(String.format("unsupported type: %s %s", primitiveTypeName, convertedType));
+                return Types.required(TypeProtos.MinorType.VARBINARY);
             }
           case INT64:
             if (convertedType == null) {
@@ -178,7 +178,7 @@ public class ParquetToDrillTypeConverter {
               case DECIMAL:
                 return Types.withScaleAndPrecision(getDecimalType(schemaElement), DataMode.REPEATED, schemaElement.getScale(), schemaElement.getPrecision());
               default:
-                throw new UnsupportedOperationException(String.format("unsupported type: %s %s", primitiveTypeName, convertedType));
+                return Types.repeated(TypeProtos.MinorType.VARBINARY);
             }
           case INT64:
             if (convertedType == null) {