You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ja...@apache.org on 2014/06/16 23:31:28 UTC
[19/32] git commit: DRILL-727: During logical transformation phase
use the Project's traits instead of input traits when creating a
DrillProjectRel.
DRILL-727: During logical transformation phase use the Project's traits instead of input traits when creating a DrillProjectRel.
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/ebe49ea2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/ebe49ea2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/ebe49ea2
Branch: refs/heads/master
Commit: ebe49ea2b606bb610c5242e61b7e5c61dd86e62a
Parents: 0648c9e
Author: Aman Sinha <as...@maprtech.com>
Authored: Thu Jun 12 19:04:04 2014 -0700
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Mon Jun 16 12:44:01 2014 -0700
----------------------------------------------------------------------
.../apache/drill/exec/planner/logical/DrillProjectRule.java | 4 ++--
.../src/test/java/org/apache/drill/TestExampleQueries.java | 8 ++++++++
2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/ebe49ea2/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
index 109588c..7cef038 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
@@ -38,9 +38,9 @@ public class DrillProjectRule extends RelOptRule {
public void onMatch(RelOptRuleCall call) {
final ProjectRel project = (ProjectRel) call.rel(0);
final RelNode input = project.getChild();
- //final RelTraitSet traits = project.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
+ final RelTraitSet traits = project.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
- call.transformTo(new DrillProjectRel(project.getCluster(), convertedInput.getTraitSet(), convertedInput, project.getProjects(), project
+ call.transformTo(new DrillProjectRel(project.getCluster(), traits, convertedInput, project.getProjects(), project
.getRowType()));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/ebe49ea2/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
index 783c562..59556b3 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
@@ -39,6 +39,7 @@ public class TestExampleQueries extends BaseTestQuery{
test("select count(*) from cp.`customer.json` limit 1");
}
+
@Test
public void testCaseReturnValueVarChar() throws Exception{
test("select case when employee_id < 1000 then 'ABC' else 'DEF' end from cp.`employee.json` limit 5");
@@ -195,4 +196,11 @@ public class TestExampleQueries extends BaseTestQuery{
test("select cast(NON_EXIST_COL as varchar(10)) from cp.`employee.json` limit 2; ");
}
+ @Test // Bugs DRILL-727, DRILL-940
+ public void testOrderByDiffColumn() throws Exception {
+ test("select r_name from cp.`tpch/region.parquet` order by r_regionkey");
+ test("select r_name from cp.`tpch/region.parquet` order by r_name, r_regionkey");
+ test("select cast(r_name as varchar(20)) from cp.`tpch/region.parquet` order by r_name");
+ }
+
}