ASTERIXDB-1256: wait for job completion on SYNC results delivery
Change-Id: Ib8a214ba4ff636d12927720c2311a9a5ca247d9e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/580
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java b/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
index 7c055e2..01b0514 100644
--- a/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
+++ b/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
@@ -218,7 +218,7 @@
private final IRewriterFactory rewriterFactory;
public QueryTranslator(List<Statement> aqlStatements, SessionConfig conf,
- ILangCompilationProvider compliationProvider) throws MetadataException, AsterixException {
+ ILangCompilationProvider compliationProvider) {
this.statements = aqlStatements;
this.sessionConfig = conf;
this.declaredFunctions = getDeclaredFunctions(aqlStatements);
@@ -414,8 +414,7 @@
}
}
- private void handleSetStatement(AqlMetadataProvider metadataProvider, Statement stmt, Map<String, String> config)
- throws RemoteException, ACIDException {
+ private void handleSetStatement(AqlMetadataProvider metadataProvider, Statement stmt, Map<String, String> config) {
SetStatement ss = (SetStatement) stmt;
String pname = ss.getPropName();
String pvalue = ss.getPropValue();
@@ -2487,6 +2486,7 @@
hcc.waitForCompletion(jobId);
break;
case SYNC:
+ hcc.waitForCompletion(jobId);
ResultReader resultReader = new ResultReader(hcc, hdc);
resultReader.open(jobId, metadataProvider.getResultSetId());
@@ -2498,8 +2498,6 @@
ResultUtils.displayCSVHeader(metadataProvider.findOutputRecordType(), sessionConfig);
}
ResultUtils.displayResults(resultReader, sessionConfig);
-
- hcc.waitForCompletion(jobId);
break;
case ASYNC_DEFERRED:
handle = new JSONArray();