Programming Interfaces

You can connect to Impala daemons through the impala-shell or through a JDBC or ODBC client. You can use the impala-shell to query data from a Linux environment. In a non-Linux environment, you can query data using JDBC and ODBC applications.

Impala Shell

The Impala-shell is a command line tool that you can use for setting up databases and tables, inserting data, and issuing queries using SQL statements and some shell commands. The impala-shell can reside on any client machine.

You can connect to the same node and issue all SQL statements through that particular node to avoid issuing the REFRESH statement frequently. For load balancing, you can connect to different nodes for each impala-shell session. When you connect to different Impala nodes, you may need to issue the REFRESH and INVALIDATE METADATA statements to update table data and metadata.

When you run commands from within the impala-shell, use a semi-colon to terminate commands. Each command can span multiple lines. Refer to Impala-Shell Commands and Command Line Options for a list of commands and options that you can issue from within the impala-shell.

Connecting to impalad from impala-shell

You can connect to any node running the Impala daemon process from the impala-shell using the CONNECT command. Once connected, you can send queries to the Impala node from the command line.

To connect to impalad, complete the following steps:

  1. Issue the following command to start the impala-shell without a connection:
    $ impala-shell
  2. Issue the CONNECT command to connect to an instance of Impala, replacing impalad-host with the hostname of the node that you want to connect to.
    [Not connected] > connect impalad-host
    [impalad-host:21000] >

JDBC and ODBC Clients

You can use a JDBC or ODBC client to connect to Impala and run queries against data stored in MapR Filesystem and MapR Database. The client or application issues a query to an Impala daemon through an ODBC or JDBC connection. The ODBC and JDBC driver submits the query to Impala in the form of a SQL statement.

Install a JDBC or ODBC driver on the client machine and then configure the driver to enable communication between the client and Impala. For driver download, installation, and connection information, refer to the following documentation: