public void process(long start, long end, String query) throws Throwable { try { Macro macroProcessor = new Macro(start, end, query); query = macroProcessor.toString(); db.execute(query); } catch (Exception e) { log.error("Query: " + query); throw new Exception("Aggregation failed for: " + query); } }