public static SingleValueBoundaryScanner getBoundaryScanner(BoundaryDef start, BoundaryDef end,
      boolean nullsLast, OrderExpressionDef exprDef, String typeString) throws HiveException {
    switch (typeString) {
    case serdeConstants.INT_TYPE_NAME:
    case serdeConstants.BIGINT_TYPE_NAME:
    case serdeConstants.SMALLINT_TYPE_NAME:
    case serdeConstants.TINYINT_TYPE_NAME:
      return new LongPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
    case serdeConstants.TIMESTAMP_TYPE_NAME:
      return new TimestampPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
    case serdeConstants.DOUBLE_TYPE_NAME:
    case serdeConstants.FLOAT_TYPE_NAME:
      return new DoublePrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
    case serdeConstants.DATE_TYPE_NAME:
      return new DatePrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
    case serdeConstants.STRING_TYPE_NAME:
      return new StringPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
    case serdeConstants.BOOLEAN_TYPE_NAME:
      return new BooleanPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
    default:
      // The following types includes scale/precision: "decimal(10,4), char(10) and varchar(15)"
      if (typeString.startsWith(serdeConstants.CHAR_TYPE_NAME) || typeString.startsWith(serdeConstants.VARCHAR_TYPE_NAME)) {
        return new StringPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
      } else if (typeString.startsWith(serdeConstants.DECIMAL_TYPE_NAME)) {
        return new HiveDecimalPrimitiveValueBoundaryScanner(start, end, exprDef, nullsLast);
      }
      throw new HiveException(String
          .format("Internal Error: attempt to setup a Window for typeString: '%s'", typeString));
    }
  }
Checks if the values of v1 or v2 are the same.
@return True if both values are the same or both are nulls.
ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java