MergeReducer extends Reducer<Text, NullWritable, Text, Text> { ResultSetFuture getFlightInfo(String origin, String dest, LocalDate flightDate) { Statement statement; if (origin != null) { statement = QueryBuilder .select() .all() .from("capstone", "flightinfo_origin") .where(eq("origin", origin)) .and(eq("flightdate", flightDate)); } else { statement = QueryBuilder .select() .all() .from("capstone", "flightinfo_dest") .allowFiltering() .where(eq("dest", dest)) .and(eq("flightdate", flightDate)); } return connect.executeAsync(statement); }  @Override void reduce(Text key, Iterable<NullWritable> values, Context context); static final String INSERT_INTO_CAPSTONE_FLIGHTCONNECTIONS_X_Y_Z_X_DEP_DATE_Y_DEP_DATE_XYFLIGHTNR_YZFLIGHTNR_VALUES; static Logger log; }
@Test public void testGetFlightInfo() { MergeReducer reducer = new MergeReducer(); LocalDate date = LocalDate.fromYearMonthDay(2008, 1, 3); String dest = "POR"; }