Skip to content

Commit

Permalink
Support setting kyuubi hive jdbc client protocol version
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyifan279 committed Oct 30, 2023
1 parent ed4c29f commit 61b8038
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
8 changes: 4 additions & 4 deletions docs/client/jdbc/kyuubi_jdbc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ HiveServer2 Compatibility

JDBC Drivers need to negotiate a protocol version with Kyuubi Server/HiveServer2 when connecting.

In order to support most HiveServer2 versions (since Hive 0.13.0),
Kyuubi Hive JDBC Driver offers protocol version v6 (`clientProtocolVersion=5`) to server by default.
Kyuubi Hive JDBC Driver offers protocol version v10 (`clientProtocolVersion=9`, supported since Hive 2.3.0)
to server by default.

If you need to connect to HiveServer2 before 0.13.0,
If you need to connect to HiveServer2 before 2.3.0,
please set client property `clientProtocolVersion` to a lower number.

.. code-block:: jdbc
jdbc:subprotocol://host:port[/catalog]/[schema];clientProtocolVersion=5;
jdbc:subprotocol://host:port[/catalog]/[schema];clientProtocolVersion=9;
.. tip::
Expand Down
4 changes: 0 additions & 4 deletions docs/deployment/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
* Since Kyuubi 1.8, PROMETHEUS is changed as the default metrics reporter. To restore previous behavior,
set `kyuubi.metrics.reporters=JSON`.

* Since Kyuubi 1.8, Kyuubi Hive JDBC Driver offers protocol version v6 to server by default.
To restore previous behavior, add `clientProtocolVersion=9;` to JDBC URL client properties section:
`jdbc:kyuubi://<host>:<port>[/catalog]/[schema];clientProtocolVersion=9;`

## Upgrading from Kyuubi 1.7.1 to 1.7.2

* Since Kyuubi 1.7.2, for Kyuubi BeeLine, please use `--python-mode` option to run python code or script.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,7 @@ SSLConnectionSocketFactory getTwoWaySSLSocketFactory() throws SQLException {
}

private void openSession() throws SQLException {
// Server responses are the same if TProtocolVersion >= HIVE_CLI_SERVICE_PROTOCOL_V6
// So we set it to HIVE_CLI_SERVICE_PROTOCOL_V6 to support HiveServer2 early versions.
TOpenSessionReq openReq = new TOpenSessionReq(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6);
TOpenSessionReq openReq = new TOpenSessionReq();

Map<String, String> openConf = new HashMap<>();
// for remote JDBC client, try to set the conf var using 'set foo=bar'
Expand Down

0 comments on commit 61b8038

Please sign in to comment.