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.
  1. 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
  2. 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>
  3. Connect to the server. On a single-node, development cluster for example:
    beeline> !connect jdbc:hive2://localhost
    The HiveServer2 prompt appears.
    scan complete in 24ms
    Connecting to jdbc:hive2://localhost
    Enter username for jdbc:hive2://localhost:
  4. Enter the DataStax Enterprise user name.
    The password prompt appears.
    Enter password for jdbc:hive2://localhost:
  5. 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>
  6. Run Hive queries.