From dd8d1270679ce6cc99c217eca7e5ecba463fd7ab Mon Sep 17 00:00:00 2001 From: Josh Rosen Date: Tue, 17 Sep 2024 09:17:45 +0200 Subject: [PATCH] [SPARK-49650][SQL][DOCS] Updates references to deprecated Hive JDBC client params in tests and docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### 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 / https://github.com/apache/hive/commit/07082e8a851cb44a95dcae50bc84fb43cb1e84c6 , 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://:/dbName;transportMode= 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://:/dbName;httpPath= ``` ### 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 Co-authored-by: Josh Rosen Signed-off-by: Max Gekk --- docs/sql-distributed-sql-engine.md | 4 ++-- .../sql/hive/thriftserver/HiveThriftServer2Suites.scala | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sql-distributed-sql-engine.md b/docs/sql-distributed-sql-engine.md index 734723f8c6235..ae8fd9c7211bd 100644 --- a/docs/sql-distributed-sql-engine.md +++ b/docs/sql-distributed-sql-engine.md @@ -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://:/?hive.server2.transport.mode=http;hive.server2.thrift.http.path= + beeline> !connect jdbc:hive2://:/;transportMode=http;httpPath= 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). @@ -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) \ No newline at end of file +For details, please refer to [Spark SQL CLI](sql-distributed-sql-engine-spark-sql-cli.html) diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala index 3ccbd23b71c98..4575549005f33 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala @@ -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 {