private int getTokenStringLength(String candidate) {
    Integer length = SPECIAL_LENGTHS.get(candidate.toLowerCase());
    if (length != null) {
      return length;
    }
    return candidate.length();
  }
Parse pattern to list of tokens.
common/src/java/org/apache/hadoop/hive/common/format/datetime/HiveSqlDateTimeFormatter.java