@Test(expected = LogicalOperatorException.class) public void testParseTimeFormatFail2() throws LogicalOperatorException { generator.parseTimeFormat(""); }
public long parseTimeFormat(String timestampStr) throws LogicalOperatorException { if (timestampStr == null || timestampStr.trim().equals("")) { throw new LogicalOperatorException("input timestamp cannot be empty"); } if (timestampStr.toLowerCase().equals(SQLConstant.NOW_FUNC)) { return System.currentTimeMillis(); } try { return DatetimeUtils.convertDatetimeStrToMillisecond(timestampStr, zoneId); } catch (Exception e) { throw new LogicalOperatorException(String .format("Input time format %s error. " + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or " + "refer to user document for more info.", timestampStr)); } }
LogicalGenerator { public long parseTimeFormat(String timestampStr) throws LogicalOperatorException { if (timestampStr == null || timestampStr.trim().equals("")) { throw new LogicalOperatorException("input timestamp cannot be empty"); } if (timestampStr.toLowerCase().equals(SQLConstant.NOW_FUNC)) { return System.currentTimeMillis(); } try { return DatetimeUtils.convertDatetimeStrToMillisecond(timestampStr, zoneId); } catch (Exception e) { throw new LogicalOperatorException(String .format("Input time format %s error. " + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or " + "refer to user document for more info.", timestampStr)); } } }
LogicalGenerator { public long parseTimeFormat(String timestampStr) throws LogicalOperatorException { if (timestampStr == null || timestampStr.trim().equals("")) { throw new LogicalOperatorException("input timestamp cannot be empty"); } if (timestampStr.toLowerCase().equals(SQLConstant.NOW_FUNC)) { return System.currentTimeMillis(); } try { return DatetimeUtils.convertDatetimeStrToMillisecond(timestampStr, zoneId); } catch (Exception e) { throw new LogicalOperatorException(String .format("Input time format %s error. " + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or " + "refer to user document for more info.", timestampStr)); } } LogicalGenerator(ZoneId zoneId); }
LogicalGenerator { public long parseTimeFormat(String timestampStr) throws LogicalOperatorException { if (timestampStr == null || timestampStr.trim().equals("")) { throw new LogicalOperatorException("input timestamp cannot be empty"); } if (timestampStr.toLowerCase().equals(SQLConstant.NOW_FUNC)) { return System.currentTimeMillis(); } try { return DatetimeUtils.convertDatetimeStrToMillisecond(timestampStr, zoneId); } catch (Exception e) { throw new LogicalOperatorException(String .format("Input time format %s error. " + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or " + "refer to user document for more info.", timestampStr)); } } LogicalGenerator(ZoneId zoneId); RootOperator getLogicalPlan(AstNode astNode); long parseTimeFormat(String timestampStr); }
LogicalGenerator { public long parseTimeFormat(String timestampStr) throws LogicalOperatorException { if (timestampStr == null || timestampStr.trim().equals("")) { throw new LogicalOperatorException("input timestamp cannot be empty"); } if (timestampStr.toLowerCase().equals(SQLConstant.NOW_FUNC)) { return System.currentTimeMillis(); } try { return DatetimeUtils.convertDatetimeStrToMillisecond(timestampStr, zoneId); } catch (Exception e) { throw new LogicalOperatorException(String .format("Input time format %s error. " + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or " + "refer to user document for more info.", timestampStr)); } } LogicalGenerator(ZoneId zoneId); RootOperator getLogicalPlan(AstNode astNode); long parseTimeFormat(String timestampStr);  }