Connect beeline
beeline is a client for running Spark SQL queries on a Thrift Server via the command line with a JDBC connection.
- Tunnel into your VPC with a VPN or bastion host
- Download the beeline client included in the Spark 3.5.2 (with Hadoop3) distribution
- Find your SQL Cluster endpoint on the Cluster details page in the Onehouse console
- Use the beeline CLI for interactive queries with the following command (make sure to specify a database):
Here are some sample commands with the beeline CLI:
$ beeline -u jdbc:hive2://<SQL-CLUSTER-ENDPOINT>:10000/<DATABASE-NAME>
- Find an existing table in the Onehouse console or with SQL:
$ show databases;
$ use <database>;
$ show tables; - Query the existing table with beeline
$ select * from <database>.<table>;
- Find an existing table in the Onehouse console or with SQL:
- Use beeline to execute queries from a local file using the following command (make sure to specify a database):
Note: For best performance, run beeline in interactive mode (step 4) to avoid new session startup time with each query.
$ beeline -u jdbc:hive2://<SQL-CLUSTER-ENDPOINT>:10000/<DATABASE-NAME> -f <SQL-FILEPATH-TO-EXECUTE>