use of org.apache.hadoop.hive.ql.plan.ListSinkDesc in project hive by apache.
the class SimpleFetchOptimizer method replaceFSwithLS.
public static ListSinkOperator replaceFSwithLS(Operator<?> fileSink, String nullFormat) {
ListSinkDesc desc = new ListSinkDesc(nullFormat);
ListSinkOperator sink = (ListSinkOperator) OperatorFactory.get(fileSink.getCompilationOpContext(), desc);
sink.setParentOperators(new ArrayList<Operator<? extends OperatorDesc>>());
Operator<? extends OperatorDesc> parent = fileSink.getParentOperators().get(0);
sink.getParentOperators().add(parent);
parent.replaceChild(fileSink, sink);
fileSink.setParentOperators(null);
return sink;
}
Aggregations