diff --git a/docs/src/main/sphinx/connector/phoenix.md b/docs/src/main/sphinx/connector/phoenix.md index 38c8e2c5c9ab..5fde1a4d5681 100644 --- a/docs/src/main/sphinx/connector/phoenix.md +++ b/docs/src/main/sphinx/connector/phoenix.md @@ -47,11 +47,34 @@ The following Phoenix-specific configuration properties are available: | Property name | Required | Description | |------------------------------------| -------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `phoenix.connection-url` | Yes | `jdbc:phoenix[:zk_quorum][:zk_port][:zk_hbase_path]`. The `zk_quorum` is a comma separated list of ZooKeeper servers. The `zk_port` is the ZooKeeper port. The `zk_hbase_path` is the HBase root znode path, that is configurable using `hbase-site.xml`. By default the location is `/hbase` | +| `phoenix.connection-url` | Yes | See [](phoenix-connection-url). | | `phoenix.config.resources` | No | Comma-separated list of configuration files (e.g. `hbase-site.xml`) to use for connection properties. These files must exist on the machines running Trino. | | `phoenix.max-scans-per-split` | No | Maximum number of HBase scans that will be performed in a single split. Default is 20. Lower values will lead to more splits in Trino. Can also be set via session propery `max_scans_per_split`. For details see: [https://phoenix.apache.org/update_statistics.html](https://phoenix.apache.org/update_statistics.html). (This setting has no effect when guideposts are disabled in Phoenix.) | | `phoenix.server-scan-page-timeout` | No | The time limit on the amount of work single RPC request can do before it times out. Type: [](prop-type-duration). | +(phoenix-connection-url)= +### Connection URL + +The connection URL for Phoenix set with `phoenix.connection-url` supports multiple formats: + +* `jdbc:phoenix[:zk_quorum][:zk_port][:zk_hbase_path][:principal][:keytab][;options]`: + Connection uses the HBase Zookeeper Registry. `zk_quorum` is a comma-separated + list of ZooKeeper servers. `zk_port` is the ZooKeeper port. + `zk_hbase_path` is the HBase root znode path, that is configurable using + `hbase-site.xml`. By default the location is `/hbase`. Principal, Keytab and + Options are optional. +* `jdbc:phoenix+zk[:host1\:port1][,:host2\:port2]...[,:hostN\:portN][:zk_hbase_path][:principal][:keytab][;options]`: + Uses the same connection as the preceding example with `host:port` pairs as a comma-separated list. +* `jdbc:phoenix+rpc[:host1\:port1][,:host2\:port2]...[,:hostN\:portN][::principal][:keytab][;options]`: + Connection uses the HBase RPC Registry. Recommended for HBase 3+ + versions. `host:port` pairs are comma-separated. + Host names refer to HMaster server names, port refers to HMaster ports. + Principal, Keytab and Options are optional. +* `jdbc:phoenix+master[:host1\:port1][,:host2\:port2]...[,:hostN\:portN][::principal][:keytab][;options]`: + Connection uses the HBase Master Registry. `host:port` pairs are comma-separated. + Host names refers to HMaster server names, port refers to HMaster ports. + Principal, Keytab and Options are optional. + ```{include} jdbc-common-configurations.fragment ``` diff --git a/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java b/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java index 0fb1dd163b91..d6e56f1456b2 100644 --- a/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java +++ b/plugin/trino-phoenix5/src/test/java/io/trino/plugin/phoenix5/TestingPhoenixServer.java @@ -116,6 +116,7 @@ public void close() public String getJdbcUrl() { - return format("jdbc:phoenix:localhost:%d:/hbase;phoenix.schema.isNamespaceMappingEnabled=true", port); + // Alternative: "jdbc:phoenix+rpc:localhost\\:%d;phoenix.schema.isNamespaceMappingEnabled=true" where %d = master's port + return format("jdbc:phoenix+zk:localhost\\:%d:/hbase;phoenix.schema.isNamespaceMappingEnabled=true", port); } }