Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill, mail # dev - [17/21] git commit: Disable project pushdown rules as it causes regression in INFORMATION_SCHEMA. Update HiveTextRecordReader to support nullable types.


Copy link to this message
-
[17/21] git commit: Disable project pushdown rules as it causes regression in INFORMATION_SCHEMA. Update HiveTextRecordReader to support nullable types.
jacques@... 2014-05-04, 16:56
Disable project pushdown rules as it causes regression in INFORMATION_SCHEMA.
Update HiveTextRecordReader to support nullable types.
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/fe19f5f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/fe19f5f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/fe19f5f6

Branch: refs/heads/master
Commit: fe19f5f63e16af1094fa6278442127adc34d4dd8
Parents: f7b66b4
Author: Jacques Nadeau <[EMAIL PROTECTED]>
Authored: Sat May 3 20:14:14 2014 -0700
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Sun May 4 09:32:59 2014 -0700

 .../org/apache/drill/exec/planner/logical/DrillRuleSets.java | 8 ++++----
 .../org/apache/drill/exec/planner/physical/ScanPrule.java    | 1 +
 .../apache/drill/exec/store/hive/HiveTextRecordReader.java   | 6 +++---
 .../src/test/java/org/apache/drill/TestProjectPushDown.java  | 2 ++
 4 files changed, 10 insertions(+), 7 deletions(-)
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fe19f5f6/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
index 3777c66..7898937 100644
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRuleSets.java
@@ -65,7 +65,7 @@ public class DrillRuleSets {
 //      SwapJoinRule.INSTANCE,
       RemoveDistinctRule.INSTANCE,
 //      UnionToDistinctRule.INSTANCE,
-      RemoveTrivialProjectRule.INSTANCE,
+//      RemoveTrivialProjectRule.INSTANCE,
 //      RemoveTrivialCalcRule.INSTANCE,
       RemoveSortRule.INSTANCE,
 
@@ -74,14 +74,14 @@ public class DrillRuleSets {
       new MergeProjectRule(true, RelFactories.DEFAULT_PROJECT_FACTORY),
       RemoveDistinctAggregateRule.INSTANCE, //
       ReduceAggregatesRule.INSTANCE, //
-      PushProjectPastJoinRule.INSTANCE,
-      PushProjectPastFilterRule.INSTANCE,
+//      PushProjectPastJoinRule.INSTANCE,
+//      PushProjectPastFilterRule.INSTANCE,
 //      SwapJoinRule.INSTANCE, //
 //      PushJoinThroughJoinRule.RIGHT, //
 //      PushJoinThroughJoinRule.LEFT, //
 //      PushSortPastProjectRule.INSTANCE, //
 
-      DrillPushProjIntoScan.INSTANCE,
+//      DrillPushProjIntoScan.INSTANCE,
 
       ////////////////////////////////
       DrillScanRule.INSTANCE,

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fe19f5f6/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrule.java
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrule.java
index 201a358..880c6fa 100644
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrule.java
@@ -39,6 +39,7 @@ public class ScanPrule extends RelOptRule{
     final DrillScanRel scan = (DrillScanRel) call.rel(0);
 
     List<SchemaPath> columns = PrelUtil.getColumns(scan.getRowType());
+    columns = columns == null || columns.isEmpty() ? null : columns;
 
     GroupScan groupScan = scan.getGroupScan().clone(columns);
 

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fe19f5f6/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/HiveTextRecordReader.java
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/HiveTextRecordReader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/HiveTextRecordReader.java
index 13719d6..f182196 100644
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/hive/HiveTextRecordReader.java
@@ -80,7 +80,7 @@ public class HiveTextRecordReader extends HiveRecordReader {
         for (int i = start; (b = bytes[i]) != delimiter; i++) {
           value = (value * 10) + b - 48;
         }
-        ((IntVector) vv).getMutator().set(index, value); // No need to use setSafe for fixed length vectors
+        ((NullableIntVector) vv).getMutator().set(index, value); // No need to use setSafe for fixed length vectors
         return true;
       }
       case LONG: {
@@ -89,7 +89,7 @@ public class HiveTextRecordReader extends HiveRecordReader {
         for (int i = start; (b = bytes[i]) != delimiter; i++) {
           value = (value * 10) + b - 48;
         }
-        ((BigIntVector) vv).getMutator().set(index, value); // No need to use setSafe for fixed length vectors
+        ((NullableBigIntVector) vv).getMutator().set(index, value); // No need to use setSafe for fixed length vectors
         return true;
       }
       case SHORT:
@@ -103,7 +103,7 @@ public class HiveTextRecordReader extends HiveRecordReader {
           }
           end = bytes.length;
         }
-        return ((VarCharVector) vv).getMutator().setSafe(index, bytes, start, end - start);
+        return ((NullableVarCharVector) vv).getMutator().setSafe(index, bytes, start, end - start);
       }
       case TIMESTAMP:
         throw new UnsupportedOperationException();

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fe19f5f6/exec/java-exec/src/test/java/org/apache/drill/TestProjectPushDown.java
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestProjectPushDown.java b/exec/java-exec/src/test/java/org/apache/drill/TestProjectPushDown.java
index 675cddb..a8c059b 100644
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestProjectPushDown.java
@@ -18,6 +18,7 @@
 
 package org.apache.drill;
 
+import org.junit.Ignore;
 import org.junit.Test;
 
 // Test the optimizer plan in terms of project pushdown.
@@ -78,6 +79,7 @@ public class TestProjectPushDown extends PlanTestBase {
   }
 
   @Test
+  @Ignore
   public void testFromInfoSchema() throws Exception {
     String expectedColNames = " \"columns\" : [ \"`CATALOG_DESCRIPTION`\" ]";
     testPhysicalPlan(