/** * Returns an operator given the conf and a list of children operators. */ public static <T extends OperatorDesc> Operator<T> get(CompilationOpContext cContext, T conf) { Operator<T> ret = get(cContext, (Class<T>) conf.getClass()); ret.setConf(conf); return (ret); }
/** * Returns an operator given the conf and a list of children operators. */ public static <T extends OperatorDesc> Operator<T> get(CompilationOpContext cContext, T conf) { Operator<T> ret = get(cContext, (Class<T>) conf.getClass()); ret.setConf(conf); return (ret); }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild( CompilationOpContext cContext, T conf, RowSchema rwsch) { Operator<T> ret = get(cContext, (Class<T>) conf.getClass()); ret.setConf(conf); ret.setSchema(rwsch); return ret; }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild( CompilationOpContext cContext, T conf, RowSchema rwsch) { Operator<T> ret = get(cContext, (Class<T>) conf.getClass()); ret.setConf(conf); ret.setSchema(rwsch); return ret; }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild(CompilationOpContext cContext, T conf, List<Operator<? extends OperatorDesc>> oplist) { Operator<T> ret = get(cContext, (Class<T>) conf.getClass()); ret.setConf(conf); if (oplist.size() == 0) { return ret; } // Add the new operator as child of each of the passed in operators for (Operator op : oplist) { List<Operator> children = op.getChildOperators(); children.add(ret); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return ret; }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild(CompilationOpContext cContext, T conf, List<Operator<? extends OperatorDesc>> oplist) { Operator<T> ret = get(cContext, (Class<T>) conf.getClass()); ret.setConf(conf); if (oplist.size() == 0) { return ret; } // Add the new operator as child of each of the passed in operators for (Operator op : oplist) { List<Operator> children = op.getChildOperators(); children.add(ret); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return ret; }
/** * Returns an operator given the conf and a list of children operators. */ public static <T extends OperatorDesc> Operator<T> get(T conf, Operator<? extends OperatorDesc> oplist0, Operator<? extends OperatorDesc>... oplist) { Operator<T> ret = get(oplist0.getCompilationOpContext(), (Class<T>) conf.getClass()); ret.setConf(conf); makeChild(ret, oplist0); makeChild(ret, oplist); return (ret); }
/** * Returns an operator given the conf and a list of children operators. */ public static <T extends OperatorDesc> Operator<T> get(T conf, Operator<? extends OperatorDesc> oplist0, Operator<? extends OperatorDesc>... oplist) { Operator<T> ret = get(oplist0.getCompilationOpContext(), (Class<T>) conf.getClass()); ret.setConf(conf); makeChild(ret, oplist0); makeChild(ret, oplist); return (ret); }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild( CompilationOpContext ctx, T conf, RowSchema rwsch, Operator[] oplist) { Operator<T> ret = get(ctx, (Class<T>) conf.getClass()); ret.setConf(conf); ret.setSchema(rwsch); if (oplist.length == 0) return ret; // Add the new operator as child of each of the passed in operators for (Operator op : oplist) { List<Operator> children = op.getChildOperators(); children.add(ret); op.setChildOperators(children); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return (ret); }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild( CompilationOpContext ctx, T conf, RowSchema rwsch, Operator[] oplist) { Operator<T> ret = get(ctx, (Class<T>) conf.getClass()); ret.setConf(conf); ret.setSchema(rwsch); if (oplist.length == 0) return ret; // Add the new operator as child of each of the passed in operators for (Operator op : oplist) { List<Operator> children = op.getChildOperators(); children.add(ret); op.setChildOperators(children); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return (ret); }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild( T conf, Operator oplist0, Operator... oplist) { Operator<T> ret = get(oplist0.getCompilationOpContext(), (Class<T>) conf.getClass()); ret.setConf(conf); // Add the new operator as child of each of the passed in operators List<Operator> children = oplist0.getChildOperators(); children.add(ret); oplist0.setChildOperators(children); for (Operator op : oplist) { children = op.getChildOperators(); children.add(ret); op.setChildOperators(children); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); parent.add(oplist0); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return (ret); }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild( T conf, Operator oplist0, Operator... oplist) { Operator<T> ret = get(oplist0.getCompilationOpContext(), (Class<T>) conf.getClass()); ret.setConf(conf); // Set the bucketing Version ret.setBucketingVersion(oplist0.getBucketingVersion()); // Add the new operator as child of each of the passed in operators List<Operator> children = oplist0.getChildOperators(); children.add(ret); oplist0.setChildOperators(children); for (Operator op : oplist) { children = op.getChildOperators(); children.add(ret); op.setChildOperators(children); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); parent.add(oplist0); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return (ret); }
op.setConf(filterCtx);
/** * This method drives the test. It takes the data from getBaseTable() and * feeds it through a SELECT operator with a COLLECT operator after. Each * row that is produced by the collect operator is compared to getExpectedResult() * and if every row is the expected result the method completes without asserting. * @throws HiveException */ public final void testUdf() throws HiveException { InspectableObject [] data = getBaseTable(); List<ExprNodeDesc> expressionList = getExpressionList(); SelectDesc selectCtx = new SelectDesc(expressionList, OperatorTestUtils.createOutputColumnNames(expressionList)); Operator<SelectDesc> op = OperatorFactory.get(new CompilationOpContext(), SelectDesc.class); op.setConf(selectCtx); CollectDesc cd = new CollectDesc(Integer.valueOf(10)); CollectOperator cdop = (CollectOperator) OperatorFactory.getAndMakeChild(cd, op); op.initialize(new JobConf(OperatorTestUtils.class), new ObjectInspector[] {data[0].oi}); OperatorTestUtils.assertResults(op, cdop, data, getExpectedResult()); }
op.setConf(selectCtx);
/** * Returns an operator given the conf and a list of children operators. */ public static <T extends OperatorDesc> Operator<T> get(T conf, Operator<? extends OperatorDesc>... oplist) { Operator<T> ret = get((Class<T>) conf.getClass()); ret.setConf(conf); makeChild(ret, oplist); return (ret); }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild(T conf, List<Operator<? extends OperatorDesc>> oplist) { Operator<T> ret = get((Class<T>) conf.getClass()); ret.setConf(conf); if (oplist.size() == 0) { return ret; } // Add the new operator as child of each of the passed in operators for (Operator op : oplist) { List<Operator> children = op.getChildOperators(); children.add(ret); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return ret; }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends Serializable> Operator<T> getAndMakeChild(T conf, List<Operator<? extends Serializable>> oplist) { Operator<T> ret = get((Class<T>) conf.getClass()); ret.setConf(conf); if (oplist.size() == 0) { return (ret); } // Add the new operator as child of each of the passed in operators for (Operator op : oplist) { List<Operator> children = op.getChildOperators(); if (children == null) { children = new ArrayList<Operator>(); } children.add(ret); op.setChildOperators(children); } // add parents for the newly created operator List<Operator<? extends Serializable>> parent = new ArrayList<Operator<? extends Serializable>>(); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return (ret); }
/** * Returns an operator given the conf and a list of children operators. */ public static <T extends Serializable> Operator<T> get(T conf, Operator<? extends Serializable>... oplist) { Operator<T> ret = get((Class<T>) conf.getClass()); ret.setConf(conf); if (oplist.length == 0) { return (ret); } ArrayList<Operator<? extends Serializable>> clist = new ArrayList<Operator<? extends Serializable>>(); for (Operator op : oplist) { clist.add(op); } ret.setChildOperators(clist); // Add this parent to the children for (Operator op : oplist) { List<Operator<? extends Serializable>> parents = op.getParentOperators(); if (parents == null) { parents = new ArrayList<Operator<? extends Serializable>>(); } parents.add(ret); op.setParentOperators(parents); } return (ret); }
/** * Returns an operator given the conf and a list of parent operators. */ public static <T extends OperatorDesc> Operator<T> getAndMakeChild(T conf, Operator... oplist) { Operator<T> ret = get((Class<T>) conf.getClass()); ret.setConf(conf); if (oplist.length == 0) { return (ret); } // Add the new operator as child of each of the passed in operators for (Operator op : oplist) { List<Operator> children = op.getChildOperators(); children.add(ret); op.setChildOperators(children); } // add parents for the newly created operator List<Operator<? extends OperatorDesc>> parent = new ArrayList<Operator<? extends OperatorDesc>>(); for (Operator op : oplist) { parent.add(op); } ret.setParentOperators(parent); return (ret); }