Constructor and Description |
---|
LocalExecutor(Environment defaultEnvironment,
List<URL> dependencies,
Configuration flinkConfig,
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.
|
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<Tuple2<Boolean,Row>>> |
retrieveResultChanges(SessionContext session,
String resultId)
Asks for the next changelog results (non-blocking).
|
List<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, Configuration flinkConfig, CustomCommandLine<?> commandLine)
public void start()
Executor
public Map<String,String> getSessionProperties(SessionContext session) throws SqlExecutionException
Executor
getSessionProperties
in interface Executor
SqlExecutionException
public List<String> listTables(SessionContext session) throws SqlExecutionException
Executor
listTables
in interface Executor
SqlExecutionException
public List<String> listUserDefinedFunctions(SessionContext session) throws SqlExecutionException
Executor
listUserDefinedFunctions
in interface Executor
SqlExecutionException
public TableSchema getTableSchema(SessionContext session, String name) throws SqlExecutionException
Executor
getTableSchema
in interface Executor
SqlExecutionException
public String explainStatement(SessionContext session, String statement) throws SqlExecutionException
Executor
explainStatement
in interface Executor
SqlExecutionException
public List<String> completeStatement(SessionContext session, String statement, int position)
Executor
completeStatement
in interface Executor
public ResultDescriptor executeQuery(SessionContext session, String query) throws SqlExecutionException
Executor
executeQuery
in interface Executor
SqlExecutionException
public TypedResult<List<Tuple2<Boolean,Row>>> retrieveResultChanges(SessionContext session, String resultId) throws SqlExecutionException
Executor
retrieveResultChanges
in interface Executor
SqlExecutionException
public TypedResult<Integer> snapshotResult(SessionContext session, String resultId, int pageSize) throws SqlExecutionException
Executor
snapshotResult
in interface Executor
SqlExecutionException
public List<Row> retrieveResultPage(String resultId, int page) throws SqlExecutionException
Executor
retrieveResultPage
in interface Executor
SqlExecutionException
public void cancelQuery(SessionContext session, String resultId) throws SqlExecutionException
Executor
cancelQuery
in interface Executor
SqlExecutionException
public ProgramTargetDescriptor executeUpdate(SessionContext session, String statement) throws SqlExecutionException
Executor
executeUpdate
in interface Executor
session
- context in with the statement is executedstatement
- SQL update statement (currently only INSERT INTO is supported)SqlExecutionException
public void validateSession(SessionContext session) throws SqlExecutionException
Executor
validateSession
in interface Executor
SqlExecutionException
public void stop(SessionContext session)
Executor
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.