Skip to content

Commit

Permalink
fix error response
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
  • Loading branch information
penghuo committed Oct 25, 2023
1 parent 50980fa commit f30079a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class StatementModel extends StateModel {
public static final String QUERY_ID = "queryId";
public static final String SUBMIT_TIME = "submitTime";
public static final String ERROR = "error";
public static final String UNKNOWN = "unknown";
public static final String UNKNOWN = "";
public static final String STATEMENT_DOC_TYPE = "statement";

private final String version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.common.Strings;
import org.opensearch.index.query.QueryBuilder;
import org.opensearch.index.query.QueryBuilders;
import org.opensearch.plugins.Plugin;
Expand Down Expand Up @@ -227,6 +228,7 @@ public void withSessionCreateAsyncQueryThenGetResultThenCancel() {
// 2. fetch async query result.
AsyncQueryExecutionResponse asyncQueryResults =
asyncQueryExecutorService.getAsyncQueryResults(response.getQueryId());
assertTrue(Strings.isEmpty(asyncQueryResults.getError()));
assertEquals(StatementState.WAITING.getState(), asyncQueryResults.getStatus());

// 3. cancel async query.
Expand Down

0 comments on commit f30079a

Please sign in to comment.