public void initializeForFetch(CompilationOpContext ctx) { if (source == null) { ListSinkDesc desc = new ListSinkDesc(serializationNullFormat); sink = (ListSinkOperator) OperatorFactory.get(ctx, desc); source = sink; } }
private FetchFormatter initializeFetcher(Configuration conf) throws Exception { String formatterName = conf.get(SerDeUtils.LIST_SINK_OUTPUT_FORMATTER); FetchFormatter fetcher; if (formatterName != null && !formatterName.isEmpty()) { Class<? extends FetchFormatter> fetcherClass = Class.forName(formatterName, true, Utilities.getSessionSpecifiedClassLoader()).asSubclass(FetchFormatter.class); fetcher = ReflectionUtils.newInstance(fetcherClass, null); } else { fetcher = new DefaultFetchFormatter(); } // selectively used by fetch formatter Properties props = new Properties(); props.put(serdeConstants.SERIALIZATION_FORMAT, "" + Utilities.tabCode); props.put(serdeConstants.SERIALIZATION_NULL_FORMAT, getConf().getSerializationNullFormat()); fetcher.initialize(conf, props); return fetcher; }
public void initializeForFetch(CompilationOpContext ctx) { if (source == null) { ListSinkDesc desc = new ListSinkDesc(serializationNullFormat); sink = (ListSinkOperator) OperatorFactory.get(ctx, desc); source = sink; } }
private FetchFormatter initializeFetcher(Configuration conf) throws Exception { String formatterName = conf.get(SerDeUtils.LIST_SINK_OUTPUT_FORMATTER); FetchFormatter fetcher; if (formatterName != null && !formatterName.isEmpty()) { Class<? extends FetchFormatter> fetcherClass = Class.forName(formatterName, true, Utilities.getSessionSpecifiedClassLoader()).asSubclass(FetchFormatter.class); fetcher = ReflectionUtils.newInstance(fetcherClass, null); } else { fetcher = new DefaultFetchFormatter(); } // selectively used by fetch formatter Properties props = new Properties(); props.put(serdeConstants.SERIALIZATION_FORMAT, "" + Utilities.tabCode); props.put(serdeConstants.SERIALIZATION_NULL_FORMAT, getConf().getSerializationNullFormat()); fetcher.initialize(conf, props); return fetcher; }
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; } }
private FetchFormatter initializeFetcher(Configuration conf) throws Exception { String formatterName = conf.get(OUTPUT_FORMATTER); FetchFormatter fetcher; if (formatterName != null && !formatterName.isEmpty()) { Class<? extends FetchFormatter> fetcherClass = Class.forName(formatterName, true, Utilities.getSessionSpecifiedClassLoader()).asSubclass(FetchFormatter.class); fetcher = ReflectionUtils.newInstance(fetcherClass, null); } else { fetcher = new DefaultFetchFormatter(); } // selectively used by fetch formatter Properties props = new Properties(); props.put(serdeConstants.SERIALIZATION_FORMAT, "" + Utilities.tabCode); props.put(serdeConstants.SERIALIZATION_NULL_FORMAT, getConf().getSerializationNullFormat()); fetcher.initialize(conf, props); return fetcher; }
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; } }
public void initializeForFetch() { if (source == null) { ListSinkDesc desc = new ListSinkDesc(serializationNullFormat); sink = (ListSinkOperator) OperatorFactory.get(desc); source = sink; } }
public static ListSinkOperator replaceFSwithLS(Operator<?> fileSink, String nullFormat) { ListSinkDesc desc = new ListSinkDesc(nullFormat); ListSinkOperator sink = (ListSinkOperator) OperatorFactory.get(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; } }