use of org.apache.asterix.lang.common.statement.WriteStatement in project asterixdb by apache.
the class QueryTranslator method handleWriteStatement.
protected Pair<IAWriterFactory, FileSplit> handleWriteStatement(Statement stmt) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
WriteStatement ws = (WriteStatement) stmt;
File f = new File(ws.getFileName());
FileSplit outputFile = new UnmanagedFileSplit(ws.getNcName().getValue(), f.getPath());
IAWriterFactory writerFactory = null;
if (ws.getWriterClassName() != null) {
writerFactory = (IAWriterFactory) Class.forName(ws.getWriterClassName()).newInstance();
}
return new Pair<>(writerFactory, outputFile);
}
Aggregations