You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2018/03/09 23:09:45 UTC

phoenix git commit: PHOENIX-4644 Array modification functions should require two arguments (addendum)

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 c1391ba03 -> c78f58a6f


PHOENIX-4644 Array modification functions should require two arguments (addendum)


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

Branch: refs/heads/4.x-HBase-1.3
Commit: c78f58a6f454966b5e0e71fcbda8ae8b8c9f09c2
Parents: c1391ba
Author: James Taylor <jt...@salesforce.com>
Authored: Fri Mar 9 15:09:34 2018 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Fri Mar 9 15:09:34 2018 -0800

----------------------------------------------------------------------
 .../phoenix/expression/function/ArrayModifierFunction.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c78f58a6/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayModifierFunction.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayModifierFunction.java b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayModifierFunction.java
index 2b399fe..b53ca85 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayModifierFunction.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/ArrayModifierFunction.java
@@ -176,9 +176,9 @@ public abstract class ArrayModifierFunction extends ScalarFunction {
     public PDataType getDataType() {
         if (getLHSExpr().getDataType().isArrayType()) {
             // Use array of RHS type if we have a null constant since otherwise we'd use binary
-            return isNullArray ? PDataType.fromTypeId(getRHSExpr().getDataType().getSqlType() + PDataType.ARRAY_TYPE_BASE) : getLHSExpr().getDataType();
+            return isNullArray ? getRHSExpr().getDataType().isArrayType() ? getRHSExpr().getDataType() : PDataType.fromTypeId(getRHSExpr().getDataType().getSqlType() + PDataType.ARRAY_TYPE_BASE) : getLHSExpr().getDataType();
         } else {
-            return isNullArray ? PDataType.fromTypeId(getLHSExpr().getDataType().getSqlType() + PDataType.ARRAY_TYPE_BASE) : getRHSExpr().getDataType();
+            return isNullArray ? getLHSExpr().getDataType().isArrayType() ? getLHSExpr().getDataType() : PDataType.fromTypeId(getLHSExpr().getDataType().getSqlType() + PDataType.ARRAY_TYPE_BASE) : getRHSExpr().getDataType();
         }
     }