SqlUtils { public static String getBetweenClause(DateTime start, DateTime end) { return String.format("time BETWEEN '%s' AND '%s'", getDateString(start), getDateString(end)); }  static String getSql(String metricFunction,
                              String collection,
                              DateTime start,
                              DateTime end,
                              Map<String, String> dimensionValues); static String getSql(String metricFunction,
                              String collection,
                              DateTime start,
                              DateTime end,
                              Multimap<String, String> dimensionValues); static String getBetweenClause(DateTime start, DateTime end); static String getDimensionWhereClause(Multimap<String, String> dimensionValues); static String getDimensionGroupByClause(Multimap<String, String> dimensionValues); static String getDateString(DateTime dateTime);  }
@Test public void testGetBetweenClause() { DateTime start = ISODateTimeFormat.dateTimeParser().parseDateTime("2015-01-01TZ"); DateTime end = ISODateTimeFormat.dateTimeParser().parseDateTime("2015-01-02TZ"); String betweenClause = SqlUtils.getBetweenClause(start, end); Assert.assertEquals(betweenClause, "time BETWEEN '2015-01-01T00:00:00Z' AND '2015-01-02T00:00:00Z'"); }