<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Spark_Thrift_Server</id>
	<title>Spark Thrift Server - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Spark_Thrift_Server"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Spark_Thrift_Server&amp;action=history"/>
	<updated>2026-12-06T00:13:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=Spark_Thrift_Server&amp;diff=201&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@7c9abaa</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Spark_Thrift_Server&amp;diff=201&amp;oldid=prev"/>
		<updated>2026-11-25T00:52:58Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@7c9abaa&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                = Spark Thrift Server&lt;br /&gt;
| developer           = [[Apache Software Foundation]] ([[Apache Spark]] project)&lt;br /&gt;
| initial_release     = Spark 1.1.0 (as the Spark SQL JDBC/ODBC server)&lt;br /&gt;
| latest_release      = Spark 4.3.0&lt;br /&gt;
| latest_release_date = 2026-10-30&lt;br /&gt;
| written_in          = Scala, Java&lt;br /&gt;
| type                = JDBC/ODBC server for Spark SQL (HiveServer2 protocol)&lt;br /&gt;
| license             = Apache License 2.0&lt;br /&gt;
| website             = [https://spark.apache.org/docs/4.3.0/sql-distributed-sql-engine.html Distributed SQL Engine]&lt;br /&gt;
| repo                = [https://github.com/apache/spark/tree/v4.3.0/sql/hive-thriftserver github.com/apache/spark (sql/hive-thriftserver)]&lt;br /&gt;
| related             = [[Spark Connect]], [[Apache Hive]], [[Hive Metastore]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-23|the v4.3.0 tag of apache/spark (docs/sql-distributed-sql-engine.md, docs/sql-migration-guide.md, sbin/start-thriftserver.sh, SQLConf.scala, sql/connect/client/jdbc), the Spark 1.1.0, 4.1.0 and 4.3.0 release notes, SPARK-53484 and the Databricks Connect and Databricks JDBC Driver documentation}}&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Spark Thrift Server&amp;#039;&amp;#039;&amp;#039; is the JDBC/ODBC server of [[Apache Spark]] SQL: a long-running Spark application that implements the HiveServer2 Thrift protocol, so that BI tools, SQL clients and the &amp;lt;code&amp;gt;beeline&amp;lt;/code&amp;gt; shell can run SQL on Spark over standard JDBC or ODBC connections without writing Spark code.&amp;lt;ref name=&amp;quot;dse&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/sql-distributed-sql-engine.html |title=Distributed SQL Engine (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Each client connection gets its own session on a shared Spark application.&amp;lt;ref name=&amp;quot;sqlmig&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/sql-migration-guide.html |title=Migration Guide: SQL, Datasets and DataFrame (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Since Spark 4.1, [[Spark Connect]] also offers a JDBC driver, which gives JDBC clients a second way to reach Spark.&amp;lt;ref name=&amp;quot;r410&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-4.1.0.html |title=Spark Release 4.1.0 |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Is the Spark Thrift Server deprecated? ==&lt;br /&gt;
No. The Spark Thrift Server is not deprecated in Spark 4.3.0. It is documented in the Spark 4.3.0 SQL guide, and the Spark 4.3.0 release notes include changes to it, such as making its JDBC metadata operations aware of DataSource V2 catalogs (SPARK-57518, opt-in with &amp;lt;code&amp;gt;spark.sql.thriftServer.catalogMetadata.enabled&amp;lt;/code&amp;gt;) and disallowing JVM system properties in its sessions (SPARK-57441).&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;r430&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-4-3-0.html |title=Spark Release 4.3.0 |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
Spark 1.1.0 introduced a JDBC/ODBC server for Spark SQL that let many applications connect to Spark SQL and share cached tables.&amp;lt;ref&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-1-1-0.html |title=Spark Release 1.1.0 |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Spark 1.6 made the server multi-session by default.&amp;lt;ref name=&amp;quot;sqlmig&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How does the Spark Thrift Server work? ==&lt;br /&gt;
The Spark Thrift Server corresponds to HiveServer2 in [[Apache Hive]], and clients connect to it with Hive JDBC URLs of the form &amp;lt;code&amp;gt;jdbc:hive2://host:port&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt; The server is a Spark application: &amp;lt;code&amp;gt;sbin/start-thriftserver.sh&amp;lt;/code&amp;gt; submits the class &amp;lt;code&amp;gt;org.apache.spark.sql.hive.thriftserver.HiveThriftServer2&amp;lt;/code&amp;gt; with the application name &amp;quot;Thrift JDBC/ODBC Server&amp;quot;, and it accepts every [[Spark-submit|spark-submit]] option plus &amp;lt;code&amp;gt;--hiveconf&amp;lt;/code&amp;gt; for Hive properties.&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sbin/start-thriftserver.sh |title=sbin/start-thriftserver.sh (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Queries therefore run on the server&amp;#039;s own executors, on whatever cluster manager it was started on.&lt;br /&gt;
&lt;br /&gt;
By default the server listens on &amp;lt;code&amp;gt;localhost:10000&amp;lt;/code&amp;gt;. The port and host can be changed with the environment variables &amp;lt;code&amp;gt;HIVE_SERVER2_THRIFT_PORT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;HIVE_SERVER2_THRIFT_BIND_HOST&amp;lt;/code&amp;gt; or the properties &amp;lt;code&amp;gt;hive.server2.thrift.port&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;hive.server2.thrift.bind.host&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt; Hive configuration comes from &amp;lt;code&amp;gt;hive-site.xml&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;core-site.xml&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;hdfs-site.xml&amp;lt;/code&amp;gt; in Spark&amp;#039;s &amp;lt;code&amp;gt;conf/&amp;lt;/code&amp;gt; directory.&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Start the server on YARN, then connect with beeline&lt;br /&gt;
./sbin/start-thriftserver.sh \&lt;br /&gt;
  --master yarn \&lt;br /&gt;
  --conf spark.sql.shuffle.partitions=64 \&lt;br /&gt;
  --hiveconf hive.server2.thrift.port=10000&lt;br /&gt;
&lt;br /&gt;
./bin/beeline -u jdbc:hive2://localhost:10000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
-- Inside beeline: plain Spark SQL&lt;br /&gt;
SHOW TABLES;&lt;br /&gt;
SET spark.sql.shuffle.partitions=200;   -- affects this session only&lt;br /&gt;
SELECT count(*) FROM sales WHERE region = &amp;#039;EMEA&amp;#039;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server can also carry Thrift RPC over HTTP. Setting &amp;lt;code&amp;gt;hive.server2.transport.mode=http&amp;lt;/code&amp;gt; enables it, by default on port 10001 (&amp;lt;code&amp;gt;hive.server2.thrift.http.port&amp;lt;/code&amp;gt;) at endpoint &amp;lt;code&amp;gt;cliservice&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;hive.server2.http.endpoint&amp;lt;/code&amp;gt;); clients add &amp;lt;code&amp;gt;transportMode=http;httpPath=cliservice&amp;lt;/code&amp;gt; to the JDBC URL.&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt; &amp;lt;code&amp;gt;sbin/stop-thriftserver.sh&amp;lt;/code&amp;gt; stops the server.&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How do sessions work? ==&lt;br /&gt;
Since Spark 1.6 the Spark Thrift Server runs in multi-session mode: each JDBC/ODBC connection has its own copy of the SQL configuration and its own temporary function registry, while cached tables are shared by all connections. Setting &amp;lt;code&amp;gt;spark.sql.hive.thriftServer.singleSession=true&amp;lt;/code&amp;gt; restores the older single-session mode.&amp;lt;ref name=&amp;quot;sqlmig&amp;quot; /&amp;gt; Because all sessions share one Spark application, they share its executors and its Spark core configuration; a &amp;lt;code&amp;gt;SET&amp;lt;/code&amp;gt; in one session changes only runtime SQL configurations for that session (see [[Spark configuration precedence]]).&lt;br /&gt;
&lt;br /&gt;
Several behaviors changed in recent releases:&amp;lt;ref name=&amp;quot;sqlmig&amp;quot; /&amp;gt;&lt;br /&gt;
* Since Spark 3.5, cancelling a running statement interrupts its tasks; &amp;lt;code&amp;gt;spark.sql.thriftServer.interruptOnCancel=false&amp;lt;/code&amp;gt; restores the old behavior.&lt;br /&gt;
* Since Spark 4.1, &amp;lt;code&amp;gt;GetColumns&amp;lt;/code&amp;gt; returns a 1-based &amp;lt;code&amp;gt;ORDINAL_POSITION&amp;lt;/code&amp;gt; instead of the previous 0-based value.&lt;br /&gt;
* Since Spark 4.3, sessions cannot set JVM system properties through the &amp;lt;code&amp;gt;set:system:&amp;lt;/code&amp;gt; configuration overlay, for example in a JDBC connection string; &amp;lt;code&amp;gt;spark.sql.legacy.hive.thriftServer.allowSettingSystemProperties=true&amp;lt;/code&amp;gt; restores the old behavior.&lt;br /&gt;
&lt;br /&gt;
== Spark Thrift Server vs Spark Connect ==&lt;br /&gt;
[[Spark Connect]] is a gRPC protocol through which a thin client sends unresolved DataFrame plans to a Spark server.&amp;lt;ref name=&amp;quot;connect&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/spark-connect-overview.html |title=Spark Connect Overview (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Spark 4.1.0 added a JDBC driver for Spark Connect (SPARK-53484), and Spark 4.3.0 extended it, for example with support for &amp;lt;code&amp;gt;ARRAY&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;MAP&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;STRUCT&amp;lt;/code&amp;gt; results (SPARK-57380).&amp;lt;ref name=&amp;quot;r410&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;r430&amp;quot; /&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-53484 |title=SPARK-53484: SPIP: JDBC Driver for Spark Connect |publisher=Apache Software Foundation JIRA |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; The driver accepts URLs that start with &amp;lt;code&amp;gt;jdbc:sc://&amp;lt;/code&amp;gt;.&amp;lt;ref&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/NonRegisteringSparkConnectDriver.scala |title=NonRegisteringSparkConnectDriver.scala (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! !! Spark Connect !! Spark Thrift Server&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
| gRPC with Protocol Buffers; results as Apache Arrow batches || HiveServer2 Thrift (binary or HTTP)&lt;br /&gt;
|-&lt;br /&gt;
! Clients&lt;br /&gt;
| PySpark, Scala and other Spark Connect clients (DataFrame API and SQL); JDBC driver since Spark 4.1.0 || Any HiveServer2-compatible JDBC/ODBC client, such as &amp;lt;code&amp;gt;beeline&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! JDBC URL&lt;br /&gt;
| &amp;lt;code&amp;gt;jdbc:sc://host:port&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;jdbc:hive2://host:port&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Default port&lt;br /&gt;
| 15002 || 10000 (binary), 10001 (HTTP)&lt;br /&gt;
|-&lt;br /&gt;
! Start script&lt;br /&gt;
| &amp;lt;code&amp;gt;sbin/start-connect-server.sh&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;sbin/start-thriftserver.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Session isolation&lt;br /&gt;
| One session per client; no access to static configuration or the &amp;lt;code&amp;gt;SparkContext&amp;lt;/code&amp;gt; || One session per connection with its own SQL configuration and temporary functions; shared cache&lt;br /&gt;
|}&lt;br /&gt;
Sources: the Spark 4.3.0 Spark Connect and distributed SQL engine guides, the standalone guide, the SQL migration guide and the Spark Connect JDBC driver source.&amp;lt;ref name=&amp;quot;connect&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;dse&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;sqlmig&amp;quot; /&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/spark-standalone.html |title=Spark Standalone Mode (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two servers address different clients: the Thrift Server serves tools built for HiveServer2, while Spark Connect also serves DataFrame programs written against the Spark client libraries. On Databricks, Databricks Connect is an extension of Spark Connect for Databricks Runtime 13.3 LTS and above.&amp;lt;ref&amp;gt;{{Cite web |url=https://docs.databricks.com/aws/en/dev-tools/databricks-connect/ |title=What is Databricks Connect? |publisher=Databricks |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; For SQL tools, Databricks publishes the Databricks JDBC Driver under the Apache 2.0 license; it can run queries either through the Statement Execution API or over Thrift.&amp;lt;ref&amp;gt;{{Cite web |url=https://docs.databricks.com/aws/en/integrations/jdbc-oss/ |title=Databricks JDBC Driver |publisher=Databricks |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Outside the Spark project, Apache Kyuubi describes itself as a multi-tenant Thrift JDBC/ODBC server and a distributed, multi-tenant gateway that provides serverless SQL on lakehouses.&amp;lt;ref&amp;gt;{{Cite web |url=https://kyuubi.apache.org/ |title=Apache Kyuubi |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Spark Connect]]&lt;br /&gt;
* [[Spark configuration precedence]]&lt;br /&gt;
* [[Spark-submit|spark-submit]]&lt;br /&gt;
* [[Apache Hive]]&lt;br /&gt;
* [[Hive Metastore]]&lt;br /&gt;
* [[Hive on Spark]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Apache Spark]]&lt;br /&gt;
[[Category:Query engines]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>