| Constructor and Description |
|---|
LocalExecutor(Environment defaultEnvironment,
List<URL> dependencies,
org.apache.flink.configuration.Configuration flinkConfig,
org.apache.flink.client.cli.CustomCommandLine<?> commandLine)
Constructor for testing purposes.
|
LocalExecutor(URL defaultEnv,
List<URL> jars,
List<URL> libraries)
Creates a local executor for submitting table programs and retrieving results.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelQuery(SessionContext session,
String resultId)
Cancels a table program and stops the result retrieval.
|
List<String> |
completeStatement(SessionContext session,
String statement,
int position)
Returns a list of completion hints for the given statement at the given position.
|
ResultDescriptor |
executeQuery(SessionContext session,
String query)
Submits a Flink SQL query job (detached) and returns the result descriptor.
|
ProgramTargetDescriptor |
executeUpdate(SessionContext session,
String statement)
Submits a Flink SQL update statement such as INSERT INTO.
|
String |
explainStatement(SessionContext session,
String statement)
Returns a string-based explanation about AST and execution plan of the given statement.
|
Map<String,String> |
getSessionProperties(SessionContext session)
Lists all session properties that are defined by the executor and the session.
|
org.apache.flink.table.api.TableSchema |
getTableSchema(SessionContext session,
String name)
Returns the schema of a table.
|
List<String> |
listTables(SessionContext session)
Lists all tables known to the executor.
|
List<String> |
listUserDefinedFunctions(SessionContext session)
Lists all user-defined functions known to the executor.
|
TypedResult<List<org.apache.flink.api.java.tuple.Tuple2<Boolean,org.apache.flink.types.Row>>> |
retrieveResultChanges(SessionContext session,
String resultId)
Asks for the next changelog results (non-blocking).
|
List<org.apache.flink.types.Row> |
retrieveResultPage(String resultId,
int page)
Returns the rows that are part of the current page or throws an exception if the snapshot has been expired.
|
TypedResult<Integer> |
snapshotResult(SessionContext session,
String resultId,
int pageSize)
Creates an immutable result snapshot of the running Flink job.
|
void |
start()
Starts the executor and ensures that its is ready for commands to be executed.
|
void |
stop(SessionContext session)
Stops the executor.
|
void |
validateSession(SessionContext session)
Validates the current session.
|
public LocalExecutor(URL defaultEnv, List<URL> jars, List<URL> libraries)
public LocalExecutor(Environment defaultEnvironment, List<URL> dependencies, org.apache.flink.configuration.Configuration flinkConfig, org.apache.flink.client.cli.CustomCommandLine<?> commandLine)
public void start()
Executorpublic Map<String,String> getSessionProperties(SessionContext session) throws SqlExecutionException
ExecutorgetSessionProperties in interface ExecutorSqlExecutionExceptionpublic List<String> listTables(SessionContext session) throws SqlExecutionException
ExecutorlistTables in interface ExecutorSqlExecutionExceptionpublic List<String> listUserDefinedFunctions(SessionContext session) throws SqlExecutionException
ExecutorlistUserDefinedFunctions in interface ExecutorSqlExecutionExceptionpublic org.apache.flink.table.api.TableSchema getTableSchema(SessionContext session, String name) throws SqlExecutionException
ExecutorgetTableSchema in interface ExecutorSqlExecutionExceptionpublic String explainStatement(SessionContext session, String statement) throws SqlExecutionException
ExecutorexplainStatement in interface ExecutorSqlExecutionExceptionpublic List<String> completeStatement(SessionContext session, String statement, int position)
ExecutorcompleteStatement in interface Executorpublic ResultDescriptor executeQuery(SessionContext session, String query) throws SqlExecutionException
ExecutorexecuteQuery in interface ExecutorSqlExecutionExceptionpublic TypedResult<List<org.apache.flink.api.java.tuple.Tuple2<Boolean,org.apache.flink.types.Row>>> retrieveResultChanges(SessionContext session, String resultId) throws SqlExecutionException
ExecutorretrieveResultChanges in interface ExecutorSqlExecutionExceptionpublic TypedResult<Integer> snapshotResult(SessionContext session, String resultId, int pageSize) throws SqlExecutionException
ExecutorsnapshotResult in interface ExecutorSqlExecutionExceptionpublic List<org.apache.flink.types.Row> retrieveResultPage(String resultId, int page) throws SqlExecutionException
ExecutorretrieveResultPage in interface ExecutorSqlExecutionExceptionpublic void cancelQuery(SessionContext session, String resultId) throws SqlExecutionException
ExecutorcancelQuery in interface ExecutorSqlExecutionExceptionpublic ProgramTargetDescriptor executeUpdate(SessionContext session, String statement) throws SqlExecutionException
ExecutorexecuteUpdate in interface Executorsession - context in with the statement is executedstatement - SQL update statement (currently only INSERT INTO is supported)SqlExecutionExceptionpublic void validateSession(SessionContext session) throws SqlExecutionException
ExecutorvalidateSession in interface ExecutorSqlExecutionExceptionpublic void stop(SessionContext session)
ExecutorCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.