@Test public void testEvaluateFormatted3() { String s1 = "2014-9-9"; ToDate udf = new ToDate(null); assertNotNull(udf.evaluate(s1)); }
public Date evaluate(String s) { if (Strings.isNullOrEmpty(s)) { return null; } try { formatter.parse(s); return Date.valueOf(s); } catch (Exception e) { LOG.warn(EVALUATE_IGNORE_MESSAGE); return null; } }
ToDate extends UDF { public Date evaluate(String s) { if (Strings.isNullOrEmpty(s)) { return null; } try { formatter.parse(s); return Date.valueOf(s); } catch (Exception e) { LOG.warn(EVALUATE_IGNORE_MESSAGE); return null; } } }
ToDate extends UDF { public Date evaluate(String s) { if (Strings.isNullOrEmpty(s)) { return null; } try { formatter.parse(s); return Date.valueOf(s); } catch (Exception e) { LOG.warn(EVALUATE_IGNORE_MESSAGE); return null; } } ToDate(Map<String, String> config); }
ToDate extends UDF { public Date evaluate(String s) { if (Strings.isNullOrEmpty(s)) { return null; } try { formatter.parse(s); return Date.valueOf(s); } catch (Exception e) { LOG.warn(EVALUATE_IGNORE_MESSAGE); return null; } } ToDate(Map<String, String> config); Date evaluate(String s); Date evaluate(String s, String format); }
ToDate extends UDF { public Date evaluate(String s) { if (Strings.isNullOrEmpty(s)) { return null; } try { formatter.parse(s); return Date.valueOf(s); } catch (Exception e) { LOG.warn(EVALUATE_IGNORE_MESSAGE); return null; } } ToDate(Map<String, String> config); Date evaluate(String s); Date evaluate(String s, String format);  }