Skip to content

Commit

Permalink
[SPARK-49650][SQL][DOCS] Updates references to deprecated Hive JDBC c…
Browse files Browse the repository at this point in the history
…lient params in tests and docs

### What changes were proposed in this pull request?

This PR updates unit tests and docs to update references to long-deprecated Hive JDBC client connection string parameters.

The current docs and some test code are using parameters that have been deprecated for nearly a decade since https://issues.apache.org/jira/browse/HIVE-6972 / apache/hive@07082e8 , so I think it's safe to clean up the usages now.

### Why are the changes needed?

While looking at some hive-thriftserver unit tests logs, I saw repeated spam of
```
20/06/05 06:35:55.442 pool-1-thread-1 WARN Utils: ***** JDBC param deprecation *****
20/06/05 06:35:55.442 pool-1-thread-1 WARN Utils: The use of hive.server2.transport.mode is deprecated.
20/06/05 06:35:55.442 pool-1-thread-1 WARN Utils: Please use transportMode like so: jdbc:hive2://<host>:<port>/dbName;transportMode=<transport_mode_value>
20/06/05 06:35:55.442 pool-1-thread-1 WARN Utils: ***** JDBC param deprecation *****
20/06/05 06:35:55.442 pool-1-thread-1 WARN Utils: The use of hive.server2.thrift.http.path is deprecated.
20/06/05 06:35:55.442 pool-1-thread-1 WARN Utils: Please use httpPath like so: jdbc:hive2://<host>:<port>/dbName;httpPath=<http_path_value>
```

### Does this PR introduce _any_ user-facing change?

No, it's just a test + documentation change, recommending syntax which has been long-supported (some tests were [already using the new parameters](https://github.com/apache/spark/blob/d3eb99f79e508d62fdb7e9bc595f0240ac021df5/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SharedThriftServer.scala#L81-L85)).

### How was this patch tested?

Existing tests (let's wait to confirm that they pass in CI).

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #48114 from JoshRosen/avoid-using-deprecated-hive-params.

Lead-authored-by: Josh Rosen <[email protected]>
Co-authored-by: Josh Rosen <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
  • Loading branch information
2 people authored and MaxGekk committed Sep 17, 2024
1 parent db84681 commit dd8d127
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/sql-distributed-sql-engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Use the following setting to enable HTTP mode as system property or in `hive-sit

To test, use beeline to connect to the JDBC/ODBC server in http mode with:

beeline> !connect jdbc:hive2://<host>:<port>/<database>?hive.server2.transport.mode=http;hive.server2.thrift.http.path=<http_endpoint>
beeline> !connect jdbc:hive2://<host>:<port>/<database>;transportMode=http;httpPath=<http_endpoint>

If you closed a session and do CTAS, you must set `fs.%s.impl.disable.cache` to true in `hive-site.xml`.
See more details in [[SPARK-21067]](https://issues.apache.org/jira/browse/SPARK-21067).
Expand All @@ -94,4 +94,4 @@ To use the Spark SQL command line interface (CLI) from the shell:

./bin/spark-sql

For details, please refer to [Spark SQL CLI](sql-distributed-sql-engine-spark-sql-cli.html)
For details, please refer to [Spark SQL CLI](sql-distributed-sql-engine-spark-sql-cli.html)
Original file line number Diff line number Diff line change
Expand Up @@ -1430,9 +1430,9 @@ abstract class HiveThriftServer2TestBase extends SparkFunSuite with BeforeAndAft

protected def jdbcUri(database: String = "default"): String = if (mode == ServerMode.http) {
s"""jdbc:hive2://$localhost:$serverPort/
|$database?
|hive.server2.transport.mode=http;
|hive.server2.thrift.http.path=cliservice;
|$database;
|transportMode=http;
|httpPath=cliservice;?
|${hiveConfList}#${hiveVarList}
""".stripMargin.split("\n").mkString.trim
} else {
Expand Down

0 comments on commit dd8d127

Please sign in to comment.