@PublicEvolving
public interface SqlGatewayService
| Modifier and Type | Method and Description |
|---|---|
void |
cancelOperation(SessionHandle sessionHandle,
OperationHandle operationHandle)
Cancel the operation when it is not in terminal status.
|
void |
closeOperation(SessionHandle sessionHandle,
OperationHandle operationHandle)
Close the operation and release all used resource by the operation.
|
void |
closeSession(SessionHandle sessionHandle)
Close the
Session. |
List<String> |
completeStatement(SessionHandle sessionHandle,
String statement,
int position)
Returns a list of completion hints for the given statement at the given position.
|
void |
configureSession(SessionHandle sessionHandle,
String statement,
long executionTimeoutMs)
Using the statement to initialize the Session.
|
OperationHandle |
executeStatement(SessionHandle sessionHandle,
String statement,
long executionTimeoutMs,
org.apache.flink.configuration.Configuration executionConfig)
Execute the submitted statement.
|
ResultSet |
fetchResults(SessionHandle sessionHandle,
OperationHandle operationHandle,
FetchOrientation orientation,
int maxRows)
Fetch the results from the operation.
|
ResultSet |
fetchResults(SessionHandle sessionHandle,
OperationHandle operationHandle,
long token,
int maxRows)
Fetch the results from the operation.
|
String |
getCurrentCatalog(SessionHandle sessionHandle)
Return current catalog name.
|
org.apache.flink.table.functions.FunctionDefinition |
getFunctionDefinition(SessionHandle sessionHandle,
org.apache.flink.table.catalog.UnresolvedIdentifier functionIdentifier)
Get the specific definition of the function.
|
GatewayInfo |
getGatewayInfo()
Get the info about the
SqlGatewayService. |
OperationInfo |
getOperationInfo(SessionHandle sessionHandle,
OperationHandle operationHandle)
Get the
OperationInfo of the operation. |
org.apache.flink.table.catalog.ResolvedSchema |
getOperationResultSchema(SessionHandle sessionHandle,
OperationHandle operationHandle)
Get the result schema for the specified Operation.
|
Map<String,String> |
getSessionConfig(SessionHandle sessionHandle)
Get the current configuration of the
Session. |
EndpointVersion |
getSessionEndpointVersion(SessionHandle sessionHandle)
Get endpoint version that is negotiated in the openSession.
|
org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> |
getTable(SessionHandle sessionHandle,
org.apache.flink.table.catalog.ObjectIdentifier tableIdentifier)
Return table of the given fully qualified name.
|
Set<String> |
listCatalogs(SessionHandle sessionHandle)
Return all available catalogs in the current session.
|
Set<String> |
listDatabases(SessionHandle sessionHandle,
String catalogName)
Return all available schemas in the given catalog.
|
Set<FunctionInfo> |
listSystemFunctions(SessionHandle sessionHandle)
List all available system functions.
|
Set<TableInfo> |
listTables(SessionHandle sessionHandle,
String catalogName,
String databaseName,
Set<org.apache.flink.table.catalog.CatalogBaseTable.TableKind> tableKinds)
Return all available tables/views in the given catalog and database.
|
Set<FunctionInfo> |
listUserDefinedFunctions(SessionHandle sessionHandle,
String catalogName,
String databaseName)
List all user defined functions.
|
SessionHandle |
openSession(SessionEnvironment environment)
Open the
Session. |
OperationHandle |
submitOperation(SessionHandle sessionHandle,
Callable<ResultSet> executor)
Submit an operation and execute.
|
SessionHandle openSession(SessionEnvironment environment) throws SqlGatewayException
Session.environment - Environment to initialize the Session.SqlGatewayExceptionvoid closeSession(SessionHandle sessionHandle) throws SqlGatewayException
Session.sessionHandle - handle to identify the Session needs to be closed.SqlGatewayExceptionvoid configureSession(SessionHandle sessionHandle, String statement, long executionTimeoutMs) throws SqlGatewayException
It returns until the execution finishes.
sessionHandle - handle to identify the session.statement - the statement used to configure the session.executionTimeoutMs - the execution timeout. Please use non-positive value to forbid the
timeout mechanism.SqlGatewayExceptionMap<String,String> getSessionConfig(SessionHandle sessionHandle) throws SqlGatewayException
Session.sessionHandle - handle to identify the session.SqlGatewayExceptionEndpointVersion getSessionEndpointVersion(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle - handle to identify the session.SqlGatewayExceptionOperationHandle submitOperation(SessionHandle sessionHandle, Callable<ResultSet> executor) throws SqlGatewayException
SqlGatewayService will take care of the
execution and assign the OperationHandle for later to retrieve the results.sessionHandle - handle to identify the session.executor - the main logic to get the execution results.SqlGatewayExceptionvoid cancelOperation(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
It can't cancel an Operation if it is terminated.
sessionHandle - handle to identify the session.operationHandle - handle to identify the operation.JarURLConnectionSqlGatewayExceptionvoid closeOperation(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
sessionHandle - handle to identify the session.operationHandle - handle to identify the operation.SqlGatewayExceptionOperationInfo getOperationInfo(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
OperationInfo of the operation.sessionHandle - handle to identify the session.operationHandle - handle to identify the operation.SqlGatewayExceptionorg.apache.flink.table.catalog.ResolvedSchema getOperationResultSchema(SessionHandle sessionHandle, OperationHandle operationHandle) throws SqlGatewayException
Note: The result schema is available when the Operation is in the OperationStatus.FINISHED.
sessionHandle - handle to identify the session.operationHandle - handle to identify the operation.SqlGatewayExceptionOperationHandle executeStatement(SessionHandle sessionHandle, String statement, long executionTimeoutMs, org.apache.flink.configuration.Configuration executionConfig) throws SqlGatewayException
sessionHandle - handle to identify the session.statement - the SQL to execute.executionTimeoutMs - the execution timeout. Please use non-positive value to forbid the
timeout mechanism.executionConfig - execution config for the statement.SqlGatewayExceptionResultSet fetchResults(SessionHandle sessionHandle, OperationHandle operationHandle, long token, int maxRows) throws SqlGatewayException
sessionHandle - handle to identify the session.operationHandle - handle to identify the operation.token - token to identify results.maxRows - max number of rows to fetch.SqlGatewayExceptionResultSet fetchResults(SessionHandle sessionHandle, OperationHandle operationHandle, FetchOrientation orientation, int maxRows) throws SqlGatewayException
sessionHandle - handle to identify the session.operationHandle - handle to identify the operation.orientation - orientation to fetch the results.maxRows - max number of rows to fetch.SqlGatewayExceptionString getCurrentCatalog(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle - handle to identify the session.SqlGatewayExceptionSet<String> listCatalogs(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle - handle to identify the session.SqlGatewayExceptionSet<String> listDatabases(SessionHandle sessionHandle, String catalogName) throws SqlGatewayException
sessionHandle - handle to identify the session.catalogName - name string of the given catalog.SqlGatewayExceptionSet<TableInfo> listTables(SessionHandle sessionHandle, String catalogName, String databaseName, Set<org.apache.flink.table.catalog.CatalogBaseTable.TableKind> tableKinds) throws SqlGatewayException
sessionHandle - handle to identify the session.catalogName - name of the given catalog.databaseName - name of the given database.tableKinds - used to specify the type of return values.SqlGatewayExceptionorg.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> getTable(SessionHandle sessionHandle, org.apache.flink.table.catalog.ObjectIdentifier tableIdentifier) throws SqlGatewayException
sessionHandle - handle to identify the session.tableIdentifier - fully qualified name of the table.SqlGatewayExceptionSet<FunctionInfo> listUserDefinedFunctions(SessionHandle sessionHandle, String catalogName, String databaseName) throws SqlGatewayException
sessionHandle - handle to identify the session.catalogName - name string of the given catalog.databaseName - name string of the given database.SqlGatewayExceptionSet<FunctionInfo> listSystemFunctions(SessionHandle sessionHandle) throws SqlGatewayException
sessionHandle - handle to identify the session.SqlGatewayExceptionorg.apache.flink.table.functions.FunctionDefinition getFunctionDefinition(SessionHandle sessionHandle, org.apache.flink.table.catalog.UnresolvedIdentifier functionIdentifier) throws SqlGatewayException
sessionHandle - handle to identify the session.functionIdentifier - identifier of the function.SqlGatewayExceptionGatewayInfo getGatewayInfo()
SqlGatewayService.List<String> completeStatement(SessionHandle sessionHandle, String statement, int position) throws SqlGatewayException
sessionHandle - handle to identify the session.statement - sql statement to be completed.position - position of where need completion hints.SqlGatewayExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.