@Test public void testEmptyInput() throws Exception { BridgeJobConf conf = new BridgeJobConf(); conf.setReducerClass(WordCount.SumReducer.class); conf.setMapOutputKeySchema(SchemaUtils.fromString("word:string")); conf.setMapOutputValueSchema(SchemaUtils.fromString("count:bigint")); conf.setOutputSchema(SchemaUtils.fromString("word:string,count:bigint"), TableInfo.DEFAULT_LABEL); InputUtils.addTable(TableInfo.builder().tableName("in_tbl").build(), conf); OutputUtils.addTable(TableInfo.builder().tableName("out_tbl").build(), conf); MockReducerUDTF udtf = new MockReducerUDTF(conf); udtf.setup(ctx); udtf.close(); List<Object[]> forwarded = udtf.getForwarded(); assertEquals(0, forwarded.size()); }
@Override public void setup(ExecutionContext eCtx) { ctx = new ReduceContextImpl(conf); Column[] ks = conf.getMapOutputKeySchema(); Column[] vs = conf.getMapOutputValueSchema(); inputSchema = (Column[]) ArrayUtils.addAll(ks, vs); UDTFTaskContextImpl udtfCtx = (UDTFTaskContextImpl) ctx; udtfCtx.configure(eCtx); }
LotReducerUDTF extends LotTaskUDTF { @Override public void setup(ExecutionContext eCtx) { ctx = new ReduceContextImpl(conf); Column[] ks = conf.getMapOutputKeySchema(); Column[] vs = conf.getMapOutputValueSchema(); inputSchema = (Column[]) ArrayUtils.addAll(ks, vs); UDTFTaskContextImpl udtfCtx = (UDTFTaskContextImpl) ctx; udtfCtx.configure(eCtx); } }
LotReducerUDTF extends LotTaskUDTF { @Override public void setup(ExecutionContext eCtx) { ctx = new ReduceContextImpl(conf); Column[] ks = conf.getMapOutputKeySchema(); Column[] vs = conf.getMapOutputValueSchema(); inputSchema = (Column[]) ArrayUtils.addAll(ks, vs); UDTFTaskContextImpl udtfCtx = (UDTFTaskContextImpl) ctx; udtfCtx.configure(eCtx); } LotReducerUDTF();  LotReducerUDTF(String functionName); }
LotReducerUDTF extends LotTaskUDTF { @Override public void setup(ExecutionContext eCtx) { ctx = new ReduceContextImpl(conf); Column[] ks = conf.getMapOutputKeySchema(); Column[] vs = conf.getMapOutputValueSchema(); inputSchema = (Column[]) ArrayUtils.addAll(ks, vs); UDTFTaskContextImpl udtfCtx = (UDTFTaskContextImpl) ctx; udtfCtx.configure(eCtx); } LotReducerUDTF();  LotReducerUDTF(String functionName); @SuppressWarnings("deprecation") @Override com.aliyun.odps.udf.OdpsType[] resolve(com.aliyun.odps.udf.OdpsType[] unused); @SuppressWarnings("deprecation") @Override com.aliyun.odps.type.TypeInfo[] resolve(com.aliyun.odps.type.TypeInfo[] unused); @Override void setup(ExecutionContext eCtx); void run(); Object[] getNextRowWapper(); }
LotReducerUDTF extends LotTaskUDTF { @Override public void setup(ExecutionContext eCtx) { ctx = new ReduceContextImpl(conf); Column[] ks = conf.getMapOutputKeySchema(); Column[] vs = conf.getMapOutputValueSchema(); inputSchema = (Column[]) ArrayUtils.addAll(ks, vs); UDTFTaskContextImpl udtfCtx = (UDTFTaskContextImpl) ctx; udtfCtx.configure(eCtx); } LotReducerUDTF();  LotReducerUDTF(String functionName); @SuppressWarnings("deprecation") @Override com.aliyun.odps.udf.OdpsType[] resolve(com.aliyun.odps.udf.OdpsType[] unused); @SuppressWarnings("deprecation") @Override com.aliyun.odps.type.TypeInfo[] resolve(com.aliyun.odps.type.TypeInfo[] unused); @Override void setup(ExecutionContext eCtx); void run(); Object[] getNextRowWapper();  }