You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by ja...@apache.org on 2014/05/13 02:56:31 UTC

[08/11] git commit: DRILL-691: Function alias to be able to cast to TIMESTAMPTZ data type

DRILL-691: Function alias to be able to cast to TIMESTAMPTZ data type


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

Branch: refs/heads/master
Commit: a50ab2b9bf2131ba44dd566343a1cac0d751319d
Parents: 8a290ea
Author: Mehant Baid <me...@gmail.com>
Authored: Sun May 11 18:18:48 2014 -0700
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Mon May 12 12:13:06 2014 -0700

----------------------------------------------------------------------
 exec/java-exec/src/main/codegen/data/Casts.tdd               | 8 ++++----
 .../src/main/codegen/templates/CastVarCharDate.java          | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a50ab2b9/exec/java-exec/src/main/codegen/data/Casts.tdd
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/data/Casts.tdd b/exec/java-exec/src/main/codegen/data/Casts.tdd
index 0dc0090..73cdede 100644
--- a/exec/java-exec/src/main/codegen/data/Casts.tdd
+++ b/exec/java-exec/src/main/codegen/data/Casts.tdd
@@ -57,10 +57,10 @@
     {from: "TimeStampTZ", to: "Date", major: "Date"},
     {from: "TimeStampTZ", to: "TimeStamp", major: "Date"},
 
-    {from: "VarChar", to: "Date", major: "VarCharDate"},
-    {from: "VarChar", to: "TimeStamp", major: "VarCharDate"},
-    {from: "VarChar", to: "TimeStampTZ", major: "VarCharDate"},
-    {from: "VarChar", to: "Time", major: "VarCharDate"},
+    {from: "VarChar", to: "Date", major: "VarCharDate", alias: "datetype"},
+    {from: "VarChar", to: "TimeStamp", major: "VarCharDate", alias: "timestamptype"},
+    {from: "VarChar", to: "TimeStampTZ", major: "VarCharDate", alias: "timestamptztype"},
+    {from: "VarChar", to: "Time", major: "VarCharDate", alias: "timetype"},
 
     {from: "Date", to: "VarChar", major: "DateVarChar", bufferLength: "10"}
     {from: "TimeStamp", to: "VarChar", major: "DateVarChar", bufferLength: "23"},

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a50ab2b9/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java b/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java
index 249b555..5a3127a 100644
--- a/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java
+++ b/exec/java-exec/src/main/codegen/templates/CastVarCharDate.java
@@ -41,7 +41,7 @@ import org.joda.time.DateMidnight;
 import org.apache.drill.exec.expr.fn.impl.DateUtility;
 
 @SuppressWarnings("unused")
-@FunctionTemplate(name = "cast${type.to?upper_case}", scope = FunctionTemplate.FunctionScope.SIMPLE, nulls=NullHandling.NULL_IF_NULL)
+@FunctionTemplate(names = {"cast${type.to?upper_case}", "${type.alias}"}, scope = FunctionTemplate.FunctionScope.SIMPLE, nulls=NullHandling.NULL_IF_NULL)
 public class Cast${type.from}To${type.to} implements DrillSimpleFunc {
 
   @Param ${type.from}Holder in;