use of io.crate.analyze.Analysis in project crate by crate.
the class BatchPortal method describe.
@Override
public List<Field> describe() {
Analysis lastAnalysis = analysis.get(analysis.size() - 1);
if (lastAnalysis.rootRelation() == null) {
return null;
}
List<Field> fields = lastAnalysis.rootRelation().fields();
outputTypes.add(Symbols.extractTypes(fields));
return fields;
}
use of io.crate.analyze.Analysis in project crate by crate.
the class BulkPortal method sync.
@Override
public CompletableFuture<?> sync(Planner planner, JobsLogs jobsLogs) {
List<Row> bulkParams = Rows.of(bulkArgs);
Analysis analysis = portalContext.getAnalyzer().boundAnalyze(statement, sessionContext, new ParameterContext(Row.EMPTY, bulkParams));
UUID jobId = UUID.randomUUID();
Plan plan;
try {
plan = planner.plan(analysis, jobId, 0, maxRows);
} catch (Throwable t) {
jobsLogs.logPreExecutionFailure(jobId, query, SQLExceptions.messageOf(t));
throw t;
}
jobsLogs.logExecutionStart(jobId, query);
synced = true;
return executeBulk(portalContext.getExecutor(), plan, jobId, jobsLogs);
}