Spark Thrift Server Clients

With Spark Thrift server, you can use JDBC and ODBC connection interfaces that enable a variety of external tools to access Spark and run SQL queries.
  • The ODBC interface is used by BI tools (often produced by MapR partners such as Tableau or Microstrategy).
  • The JDBC interface is used by clients such as SQuirrel SQL or the Beeline simple SQL shell.
MapR Hive JDBC clients that connect to HiveServer2 can also connect to Spark Thrift server without additional configuration. For details about clients, see HiveServer2 Clients and Connecting to HiveServer2.
Important: Starting in the MEP 4.0 release, if you start and stop the Spark Thrift server using Warden, the connection port number is 2304. If you start and stop by running the /opt/mapr/spark/<spark-version/sbin/{start,stop}-thriftserver.sh scripts, the port number is 10000. Beginning with MEP 6.3.0, the connection port number is 2304 for both start/stop methods (using Warden and using thriftserver.sh scripts).

MapR-SASL JDBC Connection String Format

If you start and stop the Spark Thrift server through Warden, starting in MEP 4.0, then the JDBC connection string format for MapR-SASL environments is:

jdbc:hive2://<hostname>:2304/default;auth=maprsasl
Otherwise, the port you use depends on the MEP version:
MEP 4.0 through 6.2.x
jdbc:hive2://<hostname>:10000/default;auth=maprsasl
MEP 6.3.0 and later
jdbc:hive2://<hostname>:2304/default;auth=maprsasl

Kerberos JDBC Connection String Format

If you start and stop the Spark Thrift server through Warden, starting in MEP 4.0, then the JDBC connection string format for clusters secured with Kerberos is:
jdbc:hive2://<hostname>:2304/default;principal=mapr/<FQDN@REALM>
Otherwise, the port you use depends on the MEP version:
MEP 4.0 through 6.2.x
jdbc:hive2://<hostname>:10000/default;principal=mapr/<FQDN@REALM>
MEP 6.3.0 and later
jdbc:hive2://<hostname>:2304/default;principal=mapr/<FQDN@REALM>

Starting the Thrift Server on a Custom Port

To start the Spark Thrift Server on a custom port, use the hive.server2.thrift.port option. For example, you can specify the following in the /opt/mapr/spark/spark-2.4.4/conf/hive-site.xml file:
<property>
<name>hive.server2.thrift.port</name>
<value>34512</value>
</property>

For more information, see the Apache HiveServer2 documentation.