Search in sources :

Example 16 with ResultDescriptor

use of org.apache.flink.table.client.gateway.ResultDescriptor in project flink by apache.

the class CliClient method callSelect.

private void callSelect(QueryOperation operation) {
    final ResultDescriptor resultDesc = executor.executeQuery(sessionId, operation);
    if (resultDesc.isTableauMode()) {
        try (CliTableauResultView tableauResultView = new CliTableauResultView(terminal, executor, sessionId, resultDesc)) {
            tableauResultView.displayResults();
        }
    } else {
        final CliResultView<?> view;
        if (resultDesc.isMaterialized()) {
            view = new CliTableResultView(this, resultDesc);
        } else {
            view = new CliChangelogResultView(this, resultDesc);
        }
        // enter view
        view.open();
        // view left
        printInfo(CliStrings.MESSAGE_RESULT_QUIT);
    }
}
Also used : ResultDescriptor(org.apache.flink.table.client.gateway.ResultDescriptor)

Aggregations

ResultDescriptor (org.apache.flink.table.client.gateway.ResultDescriptor)16 Test (org.junit.Test)12 Configuration (org.apache.flink.configuration.Configuration)11 URL (java.net.URL)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 SqlExecutionException (org.apache.flink.table.client.gateway.SqlExecutionException)3 ExecutorService (java.util.concurrent.ExecutorService)2 MiniClusterResourceConfiguration (org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration)2 Executor (org.apache.flink.table.client.gateway.Executor)2 CountDownLatch (java.util.concurrent.CountDownLatch)1 ReadableConfig (org.apache.flink.configuration.ReadableConfig)1 TableResultInternal (org.apache.flink.table.api.internal.TableResultInternal)1 ResolvedSchema (org.apache.flink.table.catalog.ResolvedSchema)1 TypedResult (org.apache.flink.table.client.gateway.TypedResult)1 SessionContext (org.apache.flink.table.client.gateway.context.SessionContext)1 DynamicResult (org.apache.flink.table.client.gateway.local.result.DynamicResult)1 RowDataToStringConverterImpl (org.apache.flink.table.planner.functions.casting.RowDataToStringConverterImpl)1 AttributedString (org.jline.utils.AttributedString)1