DRILL-1123: Use double type for decimal division
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/c4a82f5e Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/c4a82f5e Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/c4a82f5e Branch: refs/heads/master Commit: c4a82f5ee4f461e85e82c9d8af01756340526db9 Parents: a6e296c Author: Mehant Baid <meha...@gmail.com> Authored: Fri Jul 11 15:31:37 2014 -0700 Committer: Jacques Nadeau <jacq...@apache.org> Committed: Sun Jul 20 16:29:47 2014 -0700 ---------------------------------------------------------------------- .../src/main/codegen/templates/Decimal/DecimalFunctions.java | 4 ++-- .../test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/c4a82f5e/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java index 03e9a24..671d15b 100644 --- a/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java +++ b/exec/java-exec/src/main/codegen/templates/Decimal/DecimalFunctions.java @@ -505,7 +505,7 @@ public class ${type.name}Functions { } } - @FunctionTemplate(name = "divide", scope = FunctionTemplate.FunctionScope.DECIMAL_DIV_SCALE, nulls = NullHandling.NULL_IF_NULL) + @FunctionTemplate(name = "exact_divide", scope = FunctionTemplate.FunctionScope.DECIMAL_DIV_SCALE, nulls = NullHandling.NULL_IF_NULL) public static class ${type.name}DivideFunction implements DrillSimpleFunc { @Param ${type.name}Holder left; @@ -1304,7 +1304,7 @@ public class ${type.name}Functions { } } - @FunctionTemplate(name = "divide", scope = FunctionTemplate.FunctionScope.DECIMAL_DIV_SCALE, nulls = NullHandling.NULL_IF_NULL) + @FunctionTemplate(name = "exact_divide", scope = FunctionTemplate.FunctionScope.DECIMAL_DIV_SCALE, nulls = NullHandling.NULL_IF_NULL) public static class ${type.name}DivideFunction implements DrillSimpleFunc { @Param ${type.name}Holder left; http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/c4a82f5e/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java ---------------------------------------------------------------------- diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java index 3a8bcbc..4651b1e 100644 --- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java +++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java @@ -607,6 +607,7 @@ public class TestFunctionsQuery { "DECIMAL_DOUBLE_CAST=1.0001\n"); } + @Ignore("we don't have decimal division") @Test public void testCastDecimalDivide() throws Exception { String query = "select (cast('9' as decimal(9, 1)) / cast('2' as decimal(4, 1))) as DEC9_DIV, " +