Skip to content

Commit

Permalink
fix codestyle
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
  • Loading branch information
penghuo committed Oct 23, 2023
1 parent fbfa1be commit d47c963
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,27 @@ public StartJobRequest getStartJobRequest() {
resultIndex);
}

static class InteractiveSessionStartJobRequest extends StartJobRequest{
public InteractiveSessionStartJobRequest(String query, String jobName, String applicationId,
String executionRoleArn, String sparkSubmitParams,
Map<String, String> tags,
String resultIndex) {
super(query, jobName, applicationId, executionRoleArn, sparkSubmitParams, tags,
false, resultIndex);
static class InteractiveSessionStartJobRequest extends StartJobRequest {
public InteractiveSessionStartJobRequest(
String query,
String jobName,
String applicationId,
String executionRoleArn,
String sparkSubmitParams,
Map<String, String> tags,
String resultIndex) {
super(
query,
jobName,
applicationId,
executionRoleArn,
sparkSubmitParams,
tags,
false,
resultIndex);
}

/**
* Interactive query keep running.
*/
/** Interactive query keep running. */
@Override
public Long executionTimeout() {
return 0L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ public void datasourceWithBasicAuth() {
"http://ec2-18-237-133-156.us-west-2.compute.amazonaws" + ".com:9200",
"glue.indexstore.opensearch.auth",
"basicauth",
"glue.indexstore.opensearch.auth.username", "username",
"glue.indexstore.opensearch.auth.password","admin"),
"glue.indexstore.opensearch.auth.username",
"username",
"glue.indexstore.opensearch.auth.password",
"admin"),
null));
LocalEMRSClient emrsClient = new LocalEMRSClient();
AsyncQueryExecutorService asyncQueryExecutorService =
Expand All @@ -327,15 +329,11 @@ public void datasourceWithBasicAuth() {
asyncQueryExecutorService.createAsyncQuery(
new CreateAsyncQueryRequest("select 1", "mybasicauth", LangType.SQL, null));
String params = emrsClient.getJobRequest().getSparkSubmitParams();
assertTrue(params.contains(String.format("--conf spark.datasource.flint.auth=mybasicauth")));
assertTrue(
params.contains(
String.format("--conf spark.datasource.flint.auth=mybasicauth")));
assertTrue(
params.contains(
String.format("--conf spark.datasource.flint.auth.username=username")));
params.contains(String.format("--conf spark.datasource.flint.auth.username=username")));
assertTrue(
params.contains(
String.format("--conf spark.datasource.flint.auth.password=password")));
params.contains(String.format("--conf spark.datasource.flint.auth.password=password")));
}

@Test
Expand All @@ -360,25 +358,25 @@ public void withSessionCreateAsyncQueryFailed() {
// 2. fetch async query result. not result write to SPARK_RESPONSE_BUFFER_INDEX_NAME yet.
// mock failed statement.
StatementModel submitted = statementModel.get();
StatementModel mocked = StatementModel.builder()
.version("1.0")
.statementState(submitted.getStatementState())
.statementId(submitted.getStatementId())
.sessionId(submitted.getSessionId())
.applicationId(submitted.getApplicationId())
.jobId(submitted.getJobId())
.langType(submitted.getLangType())
.datasourceName(submitted.getDatasourceName())
.query(submitted.getQuery())
.queryId(submitted.getQueryId())
.submitTime(submitted.getSubmitTime())
.error("mock error")
.seqNo(submitted.getSeqNo())
.primaryTerm(submitted.getPrimaryTerm())
.build();
StatementModel mocked =
StatementModel.builder()
.version("1.0")
.statementState(submitted.getStatementState())
.statementId(submitted.getStatementId())
.sessionId(submitted.getSessionId())
.applicationId(submitted.getApplicationId())
.jobId(submitted.getJobId())
.langType(submitted.getLangType())
.datasourceName(submitted.getDatasourceName())
.query(submitted.getQuery())
.queryId(submitted.getQueryId())
.submitTime(submitted.getSubmitTime())
.error("mock error")
.seqNo(submitted.getSeqNo())
.primaryTerm(submitted.getPrimaryTerm())
.build();
updateStatementState(stateStore, DATASOURCE).apply(mocked, StatementState.FAILED);


AsyncQueryExecutionResponse asyncQueryResults =
asyncQueryExecutorService.getAsyncQueryResults(response.getQueryId());
assertEquals(StatementState.FAILED.getState(), asyncQueryResults.getStatus());
Expand Down

0 comments on commit d47c963

Please sign in to comment.