Accessing SQLLine from COD

SQLLine is a command-line utility included with Cloudera Operational Database (COD) that enables you to connect and execute SQL commands using Phoenix from an edge node.

  1. Download the client JAR files for your thick or thin clients using this URL syntax.

    You can get the [***Phoenix Maven URL***], [***Phoenix_(Thin)_Client_Version***], and the [***Phoenix_(Thick)_Client_Version***] information from the Database connectivity page. The URL is in the following format:

    URL for the Phoenix thick client in Cloudera Runtime 7.2.9 (environment) and higher:

    [***Phoenix MAVEN URL***]/org/apache/phoenix/phoenix-client-hbase-2.2/
     [***Phoenix THICK CLIENT VERSION***]/phoenix-client-hbase-2.2-[***Phoenix THICK CLIENT VERSION***].jar

    URL for the Phoenix thick client in Cloudera Runtime 7.2.8 (environment) and lower:

    [***Phoenix MAVEN URL***]/org/apache/phoenix/phoenix-client/
     [***Phoenix THICK CLIENT VERSION***]/phoenix-client-[***Phoenix THICK CLIENT VERSION***].jar

    For the Phoenix thin client:

    [***Phoenix MAVEN URL***]/org/apache/phoenix/phoenix-queryserver-client/
    [***Phoenix THIN CLIENT VERSION***]/phoenix-queryserver-client-[***Phoenix THIN CLIENT VERSION***].jar

    You can use Maven to download the Phoenix client JAR files. If you only need the JAR files for SQLLine connection, you can use the curl tool to download the JAR files using the following command:

    curl -L -f -o "phoenix-client.jar" "[***PHOENIX CLIENT JAR FILE URL***]"
  2. From the Databases page, download HBase client configuration Zip file using the client configuration URL .
  3. From the Databases page, copy the JDBC connection URL for the Phoenix (Thick) or Phoenix (Thin) client to use in the next step.
  4. Run this command from your CLI:
    java $PHOENIX_OPTS -cp "[***HBase-CONFIGURATION***]:[***PHOENIX-CLIENT-JAR**]]" 
    sqlline.SqlLine -d org.apache.phoenix.jdbc.PhoenixDriver -u 
    [***JDBC-CONNECTION-URL***] -n none -p none --color=true --fastConnect=false 
    --verbose=true --incremental=false --isolation=TRANSACTION_READ_COMMITTED