public static Constraint of(RexNode n) {
      if (!(n instanceof RexCall)) {
        return null;
      }
      RexCall call = (RexCall) n;
      if (call.getOperator().getKind() != SqlKind.EQUALS) {
        return null;
      }
      RexNode opA = call.operands.get(0);
      RexNode opB = call.operands.get(1);
      if (RexUtil.isNull(opA) || RexUtil.isNull(opB)) {
        // dont try to compare nulls
        return null;
      }
      if (isConstExpr(opA) && isColumnExpr(opB)) {
        return new Constraint(opB, opA);
      }
      if (isColumnExpr(opA) && isConstExpr(opB)) {
        return new Constraint(opA, opB);
      }
      return null;
    }
Interprets argument as a constraint; if not possible returns null.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java