Connect to Thrift
Learn about the DNAnexus Thrift server, a service that allows JDBC and ODBC clients to run Spark SQL queries.
A license is required to access Spark functionality on the DNAnexus Platform. Contact DNAnexus Sales for more information.
About the DNAnexus Thrift Server
The DNAnexus Thrift server connects to a high availability Apache Spark cluster integrated with the platform. It leverages the same security, permissions, and sharing features built into DNAnexus.
Connecting to Thrift Server
In order to connect to the Thrift server, we need the following:
The JDBC url:
Note: Azure UK South (OFH) region does not support access to Thrift.
We support the following format of the username:
TOKEN__PROJECTID : TOKEN is DNAnexus user generated token and PROJECTID is a DNAnexus project ID used as the project context (when you create databases). Note the double underscore between the token and the project ID.
Additionally, both the Thrift server that the user wants to connect to and the project must be from the same region.
Generate a DNAnexus Platform Authentication Token
See the Authentication tokens page.
Getting the Project ID
Navigate to https://platform.dnanexus.com and login using your username and password.
Go to Projects -> your project -> Settings -> Project ID and click on Copy to Clipboard.
Using Beeline
Beeline is a JDBC client bundled with Apache Spark that can be used to run interactive queries on the command line.
Installing Apache Spark
You can download Apache Spark 3.2.3 for Hadoop 3.x from here.
You need to have Java installed in your system PATH, or the JAVA_HOME
environment variable pointing to a Java installation.
Single Command Connection
If you already have beeline installed and all of the credentials, you can quickly connect with the following command:
In the following AWS example, note that some characters are escaped (;
with \
)
Note that the command for connecting to Thrift is different for Azure, as seen below:
Running Beeline Guided Connection
The beeline client is located under $SPARK_HOME/bin/
.
Connect to beeline using the JDBC URL:
Once successfully connected, you should see the message:
Querying in Beeline
You are now connected to the Thrift server using your credentials and will be able to see all databases to which you have access to within your current region.
You can query using the unique database name including the downcased database ID, for example database_fjf3y28066y5jxj2b0gz4g85__metabric_data.
If the database is within the same username and project you used to connect to the Thrift server, you can query using only the database name, for example metabric_data
. If the database is located outside the project, you will need to use the unique database name.
You may also find databases stored in other projects if you specify the project context in the LIKE
option of SHOW DATABASES
using the format '<project-id>:<database pattern>'
like so:
Now you can run SQL queries.
Last updated