This is an automated email from the ASF dual-hosted git repository. chinmayskulkarni pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push: new 08ed702 PHOENIX-5593 : Remove redundant null check in JoinCompiler 08ed702 is described below commit 08ed7027da64d47b8ed4ed43ac47d94983d14d41 Author: Viraj Jasani <virajjasani...@gmail.com> AuthorDate: Wed Nov 27 01:07:22 2019 +0530 PHOENIX-5593 : Remove redundant null check in JoinCompiler Signed-off-by: Chinmay Kulkarni <chinmayskulka...@apache.org> --- .../org/apache/phoenix/compile/JoinCompiler.java | 70 ++++++++++------------ 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java index 1743748..1897b42 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java @@ -718,56 +718,46 @@ public class JoinCompiler { .setMessage("On-clause LHS expression and RHS expression must be comparable. LHS type: " + lType + ", RHS type: " + rType) .build().buildException(); - if ((lType == null || lType.isCoercibleTo(PTinyint.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PTinyint.INSTANCE))) { - return lType == null ? rType : lType; // to preserve UNSIGNED type + if (lType.isCoercibleTo(PTinyint.INSTANCE) + && (rType == null || rType.isCoercibleTo(PTinyint.INSTANCE))) { + return lType; // to preserve UNSIGNED type } - - if ((lType == null || lType.isCoercibleTo(PSmallint.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PSmallint.INSTANCE))) { - return lType == null ? rType : lType; // to preserve UNSIGNED type + if (lType.isCoercibleTo(PSmallint.INSTANCE) + && (rType == null || rType.isCoercibleTo(PSmallint.INSTANCE))) { + return lType; // to preserve UNSIGNED type } - - if ((lType == null || lType.isCoercibleTo(PInteger.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PInteger.INSTANCE))) { - return lType == null ? rType : lType; // to preserve UNSIGNED type + if (lType.isCoercibleTo(PInteger.INSTANCE) + && (rType == null || rType.isCoercibleTo(PInteger.INSTANCE))) { + return lType; // to preserve UNSIGNED type } - - if ((lType == null || lType.isCoercibleTo(PLong.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PLong.INSTANCE))) { - return lType == null ? rType : lType; // to preserve UNSIGNED type + if (lType.isCoercibleTo(PLong.INSTANCE) + && (rType == null || rType.isCoercibleTo(PLong.INSTANCE))) { + return lType; // to preserve UNSIGNED type } - - if ((lType == null || lType.isCoercibleTo(PDouble.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PDouble.INSTANCE))) { - return lType == null ? rType : lType; // to preserve UNSIGNED type + if (lType.isCoercibleTo(PDouble.INSTANCE) + && (rType == null || rType.isCoercibleTo(PDouble.INSTANCE))) { + return lType; // to preserve UNSIGNED type } - - if ((lType == null || lType.isCoercibleTo(PDecimal.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PDecimal.INSTANCE))) { - return PDecimal.INSTANCE; + if (lType.isCoercibleTo(PDecimal.INSTANCE) + && (rType == null || rType.isCoercibleTo(PDecimal.INSTANCE))) { + return PDecimal.INSTANCE; } - - if ((lType == null || lType.isCoercibleTo(PDate.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PDate.INSTANCE))) { - return lType == null ? rType : lType; + if (lType.isCoercibleTo(PDate.INSTANCE) + && (rType == null || rType.isCoercibleTo(PDate.INSTANCE))) { + return lType; } - - if ((lType == null || lType.isCoercibleTo(PTimestamp.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PTimestamp.INSTANCE))) { - return lType == null ? rType : lType; + if (lType.isCoercibleTo(PTimestamp.INSTANCE) + && (rType == null || rType.isCoercibleTo(PTimestamp.INSTANCE))) { + return lType; } - - if ((lType == null || lType.isCoercibleTo(PVarchar.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PVarchar.INSTANCE))) { - return PVarchar.INSTANCE; + if (lType.isCoercibleTo(PVarchar.INSTANCE) + && (rType == null || rType.isCoercibleTo(PVarchar.INSTANCE))) { + return PVarchar.INSTANCE; } - - if ((lType == null || lType.isCoercibleTo(PBoolean.INSTANCE)) - && (rType == null || rType.isCoercibleTo(PBoolean.INSTANCE))) { - return PBoolean.INSTANCE; + if (lType.isCoercibleTo(PBoolean.INSTANCE) + && (rType == null || rType.isCoercibleTo(PBoolean.INSTANCE))) { + return PBoolean.INSTANCE; } - return PVarbinary.INSTANCE; } }