@Test public void parseMetrics() { SelectHandler handler = new SelectHandler(FIELD_FILTER); final List<String> queryStrings = handler.queriesForInterval(BEGIN_TS, END_TS) .collect(Collectors.toList()); assertThat(queryStrings, Matchers.containsInAnyOrder(FIELD_FILTER_EXPECT)); }
public Stream<String> queriesForInterval(@NonNull DateTime begin, @NonNull DateTime end) { final String querySuffix = " WHERE time > '" + begin.toString() + "' and time <= '" + end.toString() + "' GROUP BY * ORDER BY time ASC"; return selectStmts.stream().map(select -> select + querySuffix); }
SelectHandler { public Stream<String> queriesForInterval(@NonNull DateTime begin, @NonNull DateTime end) { final String querySuffix = " WHERE time > '" + begin.toString() + "' and time <= '" + end.toString() + "' GROUP BY * ORDER BY time ASC"; return selectStmts.stream().map(select -> select + querySuffix); } }
SelectHandler { public Stream<String> queriesForInterval(@NonNull DateTime begin, @NonNull DateTime end) { final String querySuffix = " WHERE time > '" + begin.toString() + "' and time <= '" + end.toString() + "' GROUP BY * ORDER BY time ASC"; return selectStmts.stream().map(select -> select + querySuffix); } SelectHandler(@NonNull TimeSeriesMetricFilter filter); }
SelectHandler { public Stream<String> queriesForInterval(@NonNull DateTime begin, @NonNull DateTime end) { final String querySuffix = " WHERE time > '" + begin.toString() + "' and time <= '" + end.toString() + "' GROUP BY * ORDER BY time ASC"; return selectStmts.stream().map(select -> select + querySuffix); } SelectHandler(@NonNull TimeSeriesMetricFilter filter); Stream<String> queriesForInterval(@NonNull DateTime begin, @NonNull DateTime end); }
SelectHandler { public Stream<String> queriesForInterval(@NonNull DateTime begin, @NonNull DateTime end) { final String querySuffix = " WHERE time > '" + begin.toString() + "' and time <= '" + end.toString() + "' GROUP BY * ORDER BY time ASC"; return selectStmts.stream().map(select -> select + querySuffix); } SelectHandler(@NonNull TimeSeriesMetricFilter filter); Stream<String> queriesForInterval(@NonNull DateTime begin, @NonNull DateTime end);  }