Using Beeline
DataStax Enterprise supports the HiveServer2 Beeline command shell, a JDBC client. After starting HiveServer2, open another terminal window, start Beeline, connect to HiveServer2, and run Hive queries.
DataStax Enterprise supports the HiveServer2 Beeline command shell, a JDBC client. HiveServer2, an improved Hive
server, uses Beeline as the command-line interface. After starting HiveServer2, open another
terminal window, start Beeline, connect to HiveServer2, and run Hive queries.
- In a terminal window, start HiveServer2:
- Installer-Services and Package installations:
$ dse hive --service hiveserver2
- Installer-No Services and Tarball installations:
$ install_location/bin/dse hive --service hiveserver2
- Installer-Services and Package installations:
- In another terminal window, start Beeline. On Linux, for
example:
$ install_directory/bin/dse beeline
The beeline prompt appears.
2014-06-19 06:37:22.758 java[46121:1a03] Unable to load realm info from SCDynamicStore Beeline version 0.12.0.3-SNAPSHOT by Apache Hive beeline>
- Connect to the server. For example, on a single-node, development
cluster:
beeline> !connect jdbc:hive2://localhost:10000?cassandra.username=cassandra;cassandra.password=cassandra
The HiveServer2 prompt appears.scan complete in 24ms Connecting to jdbc:hive2://localhost Enter username for jdbc:hive2://localhost:10000?cassandra.username=cassandra;cassandra.password=cassandra
- Enter the DataStax Enterprise user name.The password prompt appears.
Enter password for jdbc:hive2://localhost:10000?cassandra.username=cassandra;cassandra.password=cassandra
- Enter the password.The hive2 prompt appears.
Connected to: Hive (version 0.12.0.3-SNAPSHOT) Driver: Hive (version 0.12.0.3-SNAPSHOT) Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2://localhost>
- Run Hive queries.
Note: The dse password is not checked by the Hive Thrift server in the
default configuration. To authenticate with the Cassandra user and password, use JDBC
parameters:
$ dse -u username -p password beeline
!connect jdbc:hive2://localhost:10000?cassandra.username=username;cassandra.password=password