Search in sources :

Example 1 with TableResultInternal

use of org.apache.flink.table.api.internal.TableResultInternal 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());
}
Also used : ReadableConfig(org.apache.flink.configuration.ReadableConfig) SessionContext(org.apache.flink.table.client.gateway.context.SessionContext) ResultDescriptor(org.apache.flink.table.client.gateway.ResultDescriptor) DynamicResult(org.apache.flink.table.client.gateway.local.result.DynamicResult) TableResultInternal(org.apache.flink.table.api.internal.TableResultInternal)

Aggregations

ReadableConfig (org.apache.flink.configuration.ReadableConfig)1 TableResultInternal (org.apache.flink.table.api.internal.TableResultInternal)1 ResultDescriptor (org.apache.flink.table.client.gateway.ResultDescriptor)1 SessionContext (org.apache.flink.table.client.gateway.context.SessionContext)1 DynamicResult (org.apache.flink.table.client.gateway.local.result.DynamicResult)1