drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [1/3] drill git commit: DRILL-1873: Fix boolean type writing in parquet record writer.
Date Wed, 17 Dec 2014 20:31:36 GMT
Repository: drill
Updated Branches:
  refs/heads/master 9dfa4a1c5 -> d2c582918


DRILL-1873: Fix boolean type writing in parquet record writer.


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

Branch: refs/heads/master
Commit: d2103dbc00073d72074fa2b718aa3f893760bb2e
Parents: 9dfa4a1
Author: Aman Sinha <asinha@maprtech.com>
Authored: Tue Dec 16 17:50:10 2014 -0800
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Wed Dec 17 11:53:27 2014 -0800

----------------------------------------------------------------------
 .../main/codegen/templates/ParquetOutputRecordWriter.java    | 1 +
 .../drill/exec/physical/impl/writer/TestParquetWriter.java   | 8 ++++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/d2103dbc/exec/java-exec/src/main/codegen/templates/ParquetOutputRecordWriter.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/templates/ParquetOutputRecordWriter.java b/exec/java-exec/src/main/codegen/templates/ParquetOutputRecordWriter.java
index 2fbbc6f..80f3633 100644
--- a/exec/java-exec/src/main/codegen/templates/ParquetOutputRecordWriter.java
+++ b/exec/java-exec/src/main/codegen/templates/ParquetOutputRecordWriter.java
@@ -178,6 +178,7 @@ public abstract class ParquetOutputRecordWriter extends AbstractRecordWriter
imp
               consumer.addBoolean(holder.value == 1);
       <#else>
     consumer.startField(fieldName, fieldId);
+    reader.read(holder);
     consumer.addBoolean(holder.value == 1);
     consumer.endField(fieldName, fieldId);
       </#if>

http://git-wip-us.apache.org/repos/asf/drill/blob/d2103dbc/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestParquetWriter.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestParquetWriter.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestParquetWriter.java
index 6f32847..8ecb6c1 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestParquetWriter.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestParquetWriter.java
@@ -216,6 +216,14 @@ public class TestParquetWriter extends BaseTestQuery {
     runTestAndValidate(selection, validateSelection, inputTable, "foodmart_employee_parquet");
   }
 
+  @Test
+  public void testBoolean() throws Exception {
+    String selection = "true as x, false as y";
+    String validateSelection = "x, y";
+    String inputTable = "cp.`tpch/region.parquet`";
+    runTestAndValidate(selection, validateSelection, inputTable, "region_boolean_parquet");
+  }
+
   public void compareParquetReadersColumnar(String selection, String table) throws Exception
{
     String query = "select " + selection + " from " + table;
     testBuilder()


Mime
View raw message