phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [1/2] phoenix git commit: PHOENIX-3923 TimezoneOffsetFunctionIT failing after PHOENIX-3913
Date Thu, 08 Jun 2017 20:26:00 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 a798b0a99 -> 3138ad44b


PHOENIX-3923 TimezoneOffsetFunctionIT failing after PHOENIX-3913


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

Branch: refs/heads/4.x-HBase-1.1
Commit: f2be6bbf48139c84eaa9a4d6440406ae3999edd8
Parents: a798b0a
Author: James Taylor <jamestaylor@apache.org>
Authored: Thu Jun 8 11:21:00 2017 -0700
Committer: James Taylor <jamestaylor@apache.org>
Committed: Thu Jun 8 13:25:01 2017 -0700

----------------------------------------------------------------------
 .../expression/function/TimezoneOffsetFunction.java      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f2be6bbf/phoenix-core/src/main/java/org/apache/phoenix/expression/function/TimezoneOffsetFunction.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/TimezoneOffsetFunction.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/TimezoneOffsetFunction.java
index 8c70346..c61f838 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/TimezoneOffsetFunction.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/TimezoneOffsetFunction.java
@@ -20,15 +20,16 @@ package org.apache.phoenix.expression.function;
 
 import java.sql.SQLException;
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.cache.JodaTimezoneCache;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.parse.FunctionParseNode;
+import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.schema.types.PInteger;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.types.PVarchar;
-import org.apache.phoenix.schema.tuple.Tuple;
 import org.joda.time.DateTimeZone;
 
 /**
@@ -59,11 +60,17 @@ public class TimezoneOffsetFunction extends ScalarFunction {
         if (!children.get(0).evaluate(tuple, ptr)) {
             return false;
         }
+        if (ptr.getLength() == 0) {
+            return true;
+        }
         DateTimeZone timezoneInstance = JodaTimezoneCache.getInstance(ptr);
 
         if (!children.get(1).evaluate(tuple, ptr)) {
             return false;
         }
+        if (ptr.getLength() == 0) {
+            return true;
+        }
         long date = PDate.INSTANCE.getCodec().decodeLong(ptr, children.get(1).getSortOrder());
 
         int offset = timezoneInstance.getOffset(date);


Mime
View raw message