@Override public String validate(String value) { try { long time = HiveConf.toTime(value, timeUnit, timeUnit); if (min != null && (minInclusive ? time < min : time <= min)) { return value + " is smaller than " + timeString(min); } if (max != null && (maxInclusive ? time > max : time >= max)) { return value + " is bigger than " + timeString(max); } } catch (Exception e) { return e.toString(); } return null; }
@Override public String validate(String value) { try { long time = HiveConf.toTime(value, timeUnit, timeUnit); if (min != null && (minInclusive ? time < min : time <= min)) { return value + " is smaller than " + timeString(min); } if (max != null && (maxInclusive ? time > max : time >= max)) { return value + " is bigger than " + timeString(max); } } catch (Exception e) { return e.toString(); } return null; }
@Override public String validate(String value) { try { long time = HiveConf.toTime(value, timeUnit, timeUnit); if (min != null && (minInclusive ? time < min : time <= min)) { return value + " is smaller than " + timeString(min); } if (max != null && (maxInclusive ? time > max : time >= max)) { return value + " is bigger than " + timeString(max); } } catch (Exception e) { return e.toString(); } return null; }
public String toDescription() { String description = "Expects a time value with unit " + "(d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec)" + ", which is " + HiveConf.stringFor(timeUnit) + " if not specified"; if (min != null && max != null) { description += ".\nThe time should be in between " + timeString(min) + (minInclusive ? " (inclusive)" : " (exclusive)") + " and " + timeString(max) + (maxInclusive ? " (inclusive)" : " (exclusive)"); } else if (min != null) { description += ".\nThe time should be bigger than " + (minInclusive ? "or equal to " : "") + timeString(min); } else if (max != null) { description += ".\nThe time should be smaller than " + (maxInclusive ? "or equal to " : "") + timeString(max); } return description; }
public String toDescription() { String description = "Expects a time value with unit " + "(d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec)" + ", which is " + HiveConf.stringFor(timeUnit) + " if not specified"; if (min != null && max != null) { description += ".\nThe time should be in between " + timeString(min) + (minInclusive ? " (inclusive)" : " (exclusive)") + " and " + timeString(max) + (maxInclusive ? " (inclusive)" : " (exclusive)"); } else if (min != null) { description += ".\nThe time should be bigger than " + (minInclusive ? "or equal to " : "") + timeString(min); } else if (max != null) { description += ".\nThe time should be smaller than " + (maxInclusive ? "or equal to " : "") + timeString(max); } return description; }
public String toDescription() { String description = "Expects a time value with unit " + "(d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec)" + ", which is " + HiveConf.stringFor(timeUnit) + " if not specified"; if (min != null && max != null) { description += ".\nThe time should be in between " + timeString(min) + (minInclusive ? " (inclusive)" : " (exclusive)") + " and " + timeString(max) + (maxInclusive ? " (inclusive)" : " (exclusive)"); } else if (min != null) { description += ".\nThe time should be bigger than " + (minInclusive ? "or equal to " : "") + timeString(min); } else if (max != null) { description += ".\nThe time should be smaller than " + (maxInclusive ? "or equal to " : "") + timeString(max); } return description; }