HANA Connector

The HANA connector allows querying and creating tables in an external HANA database. This can be used to join data between different systems like HANA and Hive, or between two different HANA instances.

Configuration

To configure the HANA connector, create a catalog properties file in etc/catalog named, for example, hana.properties, to mount the HANA connector as the hana catalog.

Create the file with the following contents, replacing the connection properties as appropriate for your setup:

  1. connector.name=hana
  2. connection-url=jdbc:sap://[serverName[\instanceName][:portNumber]]
  3. connection-user=root
  4. connection-password=secret

Multiple HANA Databases or Servers

The HANA connector can only access a single database within a HANA server. If you have multiple HANA databases, or want to connect to multiple HANA instances, you must configure multiple catalogs, one for each instance.

To add another catalog, add another properties file to etc/catalog with a different name (making sure it ends in .properties). For example, if you name the property file sales.properties, Presto will create a catalog named sales using the configured connector.

General Configuration Properties

Property Name

Description

Default

user-credential-name

Name of the extraCredentials property whose value is the JDBC driver’s user name. See extraCredentials in Parameter Reference.

password-credential-name

Name of the extraCredentials property whose value is the JDBC driver’s user password. See extraCredentials in Parameter Reference.

case-insensitive-name-matching

Match dataset and table names case-insensitively.

false

case-insensitive-name-matching.cache-ttl

Duration for which remote dataset and table names will be cached. Set to 0ms to disable the cache.

1m

Querying HANA

The HANA connector provides access to all schemas visible to the specified user in the configured database. For the following examples, assume the HANA catalog is hana.

You can see the available schemas by running SHOW SCHEMAS:

  1. SHOW SCHEMAS FROM hana;

If you have a schema named web, you can view the tables in this schema by running SHOW TABLES:

  1. SHOW TABLES FROM hana.web;

You can see a list of the columns in the clicks table in the web database using either of the following:

  1. DESCRIBE hana.web.clicks;
  2. SHOW COLUMNS FROM hana.web.clicks;

Finally, you can query the clicks table in the web schema:

  1. SELECT * FROM hana.web.clicks;

If you used a different name for your catalog properties file, use that catalog name instead of hana in the above examples.

HANA Connector Limitations

The following SQL statements are not supported: