DRILL-893: Remove unnecessary extract functions from time data type causing implicit cast errors. Enable tpch07.
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/fd6cdf84 Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/fd6cdf84 Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/fd6cdf84 Branch: refs/heads/master Commit: fd6cdf843b8629c5066dda147a8253525d613fca Parents: cec3fa5 Author: Mehant Baid <[email protected]> Authored: Sun Jun 1 16:44:44 2014 -0700 Committer: Jacques Nadeau <[email protected]> Committed: Wed Jun 4 16:39:22 2014 -0700 ---------------------------------------------------------------------- .../codegen/templates/DateIntervalFunctionTemplates/Extract.java | 2 ++ .../src/test/java/org/apache/drill/TestTpchDistributed.java | 1 - .../src/test/java/org/apache/drill/TestTpchSingleMode.java | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fd6cdf84/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java index b8ff73b..3d3d2da 100644 --- a/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java +++ b/exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/Extract.java @@ -34,6 +34,7 @@ public class ${className} { <#list extract.fromTypes as fromUnit> <#list extract.toTypes as toUnit> <#if fromUnit == "Date" || fromUnit == "Time" || fromUnit == "TimeStamp" || fromUnit == "TimeStampTZ"> +<#if !(fromUnit == "Time" && (toUnit == "Year" || toUnit == "Month" || toUnit == "Day"))> @FunctionTemplate(name = "extract${toUnit}", scope = FunctionTemplate.FunctionScope.SIMPLE, nulls = FunctionTemplate.NullHandling.NULL_IF_NULL) public static class ${toUnit}From${fromUnit} implements DrillSimpleFunc { @@ -68,6 +69,7 @@ public class ${className} { </#if> } } +</#if> <#else> @FunctionTemplate(name = "extract${toUnit}", scope = FunctionTemplate.FunctionScope.SIMPLE, nulls = FunctionTemplate.NullHandling.NULL_IF_NULL) http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fd6cdf84/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributed.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributed.java b/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributed.java index 7a6982d..5f33f51 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributed.java +++ b/exec/java-exec/src/test/java/org/apache/drill/TestTpchDistributed.java @@ -61,7 +61,6 @@ public class TestTpchDistributed extends BaseTestQuery{ } @Test - @Ignore // DRILL-516 public void tpch07() throws Exception{ testDistributed("queries/tpch/07.sql"); } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/fd6cdf84/exec/java-exec/src/test/java/org/apache/drill/TestTpchSingleMode.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestTpchSingleMode.java b/exec/java-exec/src/test/java/org/apache/drill/TestTpchSingleMode.java index a11bea6..d1ea910 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/TestTpchSingleMode.java +++ b/exec/java-exec/src/test/java/org/apache/drill/TestTpchSingleMode.java @@ -65,7 +65,6 @@ public class TestTpchSingleMode extends BaseTestQuery{ } @Test - @Ignore // DRILL-516 public void tpch07() throws Exception{ testSingleMode("queries/tpch/07.sql"); }
