Skip to content

Commit

Permalink
add IT for parsing explain query reponse
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
  • Loading branch information
penghuo committed Jan 31, 2024
1 parent 76f5afb commit 87a969e
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,27 @@ public void testInteractiveQueryResponseJsonNestedObjectArray() {
"{\"status\":\"SUCCESS\",\"schema\":[{\"name\":\"resourceSpans\",\"type\":\"struct\"}],\"datarows\":[[{\"scopeSpans\":{\"spans\":[{\"attribute\":{\"value\":{\"stringValue\":\"grpc\"},\"key\":\"rpc.system\"}},{\"attribute\":{\"value\":{\"stringValue\":\"grpc\"},\"key\":\"rpc.system\"}}]}}]],\"total\":1,\"size\":1}");
}

@Test
public void testExplainResponse() {
createAsyncQuery("EXPLAIN SELECT * FROM TABLE")
.withInteraction(InteractionStep::pluginSearchQueryResult)
.assertQueryResults("waiting", null)
.withInteraction(
interaction -> {
interaction.emrJobWriteResultDoc(
createResultDoc(
interaction.queryId,
ImmutableList.of("{'plan':'== Physical Plan ==\\nAdaptiveSparkPlan'}"),
ImmutableList.of("{'column_name':'plan','data_type':'string'}")));
interaction.emrJobUpdateStatementState(StatementState.SUCCESS);
return interaction.pluginSearchQueryResult();
})
.assertFormattedQueryResults(
"{\"status\":\"SUCCESS\",\"schema\":[{\"name\":\"plan\",\"type\":\"string\"}],\"datarows\":[[\"=="
+ " Physical Plan ==\\n"
+ "AdaptiveSparkPlan\"]],\"total\":1,\"size\":1}");
}

@Test
public void testInteractiveQueryEmptyResponseIssue2367() {
createAsyncQuery("SELECT * FROM TABLE")
Expand Down

0 comments on commit 87a969e

Please sign in to comment.