...
There're Session
s and Operation
s in SqlGateway
. SqlGateway
will open a Session
for each external connection FlinkConnection
, and then do multiple Operation
s in one Session
. When users create a FlinkSession
by FlinkConnection
by FlinkDriver
with SqlGateway
, it will open an exist or a new Session
. Any time users want to issue SQL statements to the database, they require a FlinkStatement
instance from FlinkConnection
. Once users have a FlinkStatement
, they can use issue a query. This will return a FlinkResultSet
instance, which contains the entire result. Each operation such as the execution query(Flink job), fetching results in FlinkResultSet
will be an Operation
in the Session
of SqlGateway
.
...
When an error occurs, Flink Jdbc Driver mainly throws the following exceptions
SQLState Class | SQLState SubClass | Reason | Exception | Operations |
---|---|---|---|---|
22 | 000 to 02H according to different errors | Description of data conversion error | SQLDataException | Get data error from ResultSet in methods getXXX |
0A | 000 | Specific feature is not supported | SQLFeatureNotSupportedException | All unimplemented methods will throw this exception |
58 | 004 | The exception or error message from Gateway | SQLNonTransientException | Gateway throws an exception or returns an error message when executing the query |
08 | 006 | The session is not exist in Gateway and client need to create new connection to it | SQLNonTransientConnectionException | Gateway is restarted and the client need to create new connection |
We can continue to subdivide and throw different exceptions according to the error information returned by the Gateway in Flink Jdbc Driver in the future
...