AnalyticQueryEngine { public static AnalyticQueryEngine create(AnalyticQuery query) { return new AnalyticQueryEngine(query); } private  AnalyticQueryEngine(AnalyticQuery query); static AnalyticQueryEngine create(AnalyticQuery query); Table execute();  }
@Test public void testInvalidSourceColumn() { String destinationColumnName = "dest"; Table table = Table.create("table", StringColumn.create("col1", new String[] {"bad"})); AnalyticQuery query = AnalyticQuery.quickQuery() .from(table) .rowsBetween() .preceding(1) .andCurrentRow() .sum("col1") .as(destinationColumnName) .build(); AnalyticQueryEngine queryEngine = AnalyticQueryEngine.create(query); Throwable thrown = assertThrows(IllegalArgumentException.class, queryEngine::execute); assertTrue( thrown.getMessage().contains("Function: SUM Is not compatible with column type: STRING")); }