use of org.apache.flink.table.client.gateway.context.SessionContext in project flink by apache.
the class LocalExecutor method executeQuery.
@Override
public ResultDescriptor executeQuery(String sessionId, QueryOperation query) throws SqlExecutionException {
final TableResultInternal tableResult = executeOperation(sessionId, query);
final SessionContext context = getSessionContext(sessionId);
final ReadableConfig config = context.getReadableConfig();
final DynamicResult result = resultStore.createResult(config, tableResult);
checkArgument(tableResult.getJobClient().isPresent());
String jobId = tableResult.getJobClient().get().getJobID().toString();
// store the result under the JobID
resultStore.storeResult(jobId, result);
return new ResultDescriptor(jobId, tableResult.getResolvedSchema(), result.isMaterialized(), config, tableResult.getRowDataToStringConverter());
}
use of org.apache.flink.table.client.gateway.context.SessionContext in project flink by apache.
the class LocalExecutor method addJar.
@Override
public void addJar(String sessionId, String jarUrl) {
final SessionContext context = getSessionContext(sessionId);
context.addJar(jarUrl);
}
use of org.apache.flink.table.client.gateway.context.SessionContext in project flink by apache.
the class LocalExecutor method closeSession.
@Override
public void closeSession(String sessionId) throws SqlExecutionException {
resultStore.getResults().forEach((resultId) -> {
try {
cancelQuery(sessionId, resultId);
} catch (Throwable t) {
// ignore any throwable to keep the clean up running
}
});
// Remove the session's ExecutionContext from contextMap and close it.
SessionContext context = this.contextMap.remove(sessionId);
if (context != null) {
context.close();
}
}
use of org.apache.flink.table.client.gateway.context.SessionContext in project flink by apache.
the class LocalExecutor method setSessionProperty.
@Override
public void setSessionProperty(String sessionId, String key, String value) throws SqlExecutionException {
SessionContext context = getSessionContext(sessionId);
context.set(key, value);
}
use of org.apache.flink.table.client.gateway.context.SessionContext in project flink by apache.
the class LocalExecutor method resetSessionProperties.
@Override
public void resetSessionProperties(String sessionId) throws SqlExecutionException {
SessionContext context = getSessionContext(sessionId);
context.reset();
}
Aggregations