Starburst SAP HANA connector#

The SAP HANA connector allows querying and creating tables in an external database. Connectors let Presto join data provided by different databases, like SAP HANA and Hive, or different database instances.

Note

The connector requires a valid Starburst Enterprise Presto license.

Configuration#

  • Get the JDBC driver for SAP HANA from SAP

  • Add the JDBC driver JAR file to the Presto plugin/sap-hana directory on all the nodes

  • Restart Presto on every node

To configure the SAP HANA connector as the myhanadb catalog, create a file named myhanadb.properties in etc/catalog:

connector.name=sap-hana
connection-url=jdbc:sap://Hostname:Port/?optionalparameters
connection-user=USERNAME
connection-password=PASSWORD

Refer to the SAP HANA for more information about format and parameters of the JDBC URL supported by the SAP HANA JDBC driver.

SAP HANA to Presto read type mapping#

The following read type mapping applies when data is read from existing tables in SAP HANA, or inserted into existing tables in SAP HANA from Presto.

SAP HANA to Presto type mapping#

SAP HANA database type

Presto type

Notes

BOOLEAN

BOOLEAN

TINYINT

TINYINT

SMALLINT

SMALLINT

INTEGER

INTEGER

BIGINT

BIGINT

REAL

REAL

DOUBLE

DOUBLE

FLOAT(p)

REAL for p <= 24, DOUBLE otherwise

DECIMAL(p, s)

DECIMAL(p, s)

DECIMAL

DOUBLE

SAP HANA’s DECIMAL with precision and scale not specified represents a floating-point decimal number

SMALLDECIMAL

DOUBLE

SAP HANA’s DECIMAL with precision and scale not specified represents a floating-point decimal number

NCHAR

CHAR

VARCHAR(n)

VARCHAR(n)

NVARCHAR(n)

VARCHAR(n)

ALPHANUM(n)

VARCHAR(n)

SHORTTEXT(n)

VARCHAR(n)

CLOB

VARCHAR (unbounded)

NCLOB

VARCHAR (unbounded)

TEXT

VARCHAR (unbounded)

BINTEXT

VARCHAR (unbounded)

VARBINARY(n)

VARBINARY

BLOB

VARBINARY

DATE

DATE

TIME

TIME(0)

SECONDDATE

TIMESTAMP(0)

TIMESTAMP

TIMESTAMP(7)

All other types aren’t supported.

Presto to SAP HANA write type mapping#

The following write type mapping applies when tables are created in SAP HANA from Presto.

Presto to SAP HANA type mapping#

Presto type

SAP HANA database type

Notes

BOOLEAN

BOOLEAN

TINYINT

TINYINT

SMALLINT

SMALLINT

INTEGER

INTEGER

BIGINT

BIGINT

REAL

REAL

DOUBLE

DOUBLE

DECIMAL(p, s)

DECIMAL(p, s)

CHAR

CHAR or NCLOB

VARCHAR

NVARCHAR or CLOB

VARBINARY

BLOB

DATE

DATE

TIME(p)

TIME

TIMESTAMP(p)

SECONDDATE for p = 0, TIMESTAMP otherwise

All other types aren’t supported.

Performance#

The connector includes a number of performance improvements, detailed in the following sections.

Table statistics#

The SAP HANA connector supports table and column statistics to improve query processing performance based on the actual data in the data source.

The statistics are collected by SAP HANA and retrieved by the connector.

You have to use the CREATE STATISTICS command in SAP HANA to initiate creation and ongoing collection and update of the relevant statistics. You can find more information about statistics collection in the SAP HANA documentation.

The connector and Presto support the statistic types HISTOGRAM, SIMPLE, and TOPK.

Note

The collection in SAP HANA can take considerable time and depends on the data size. You can use the MERGE DELTA command to affect availability of the statistics.

Pushdown#

The connector supports pushdown for LIMIT clauses of a SELECT statement.

The connector supports pushdown for the following aggregate functions:

Additionally, for the aggregate functions below, pushdown is only supported for DOUBLE type columns:

Dynamic filtering#

Dynamic filtering is enabled by default. It causes the connector to wait for dynamic filtering to complete before starting a JDBC query.

You can disable dynamic filtering by setting the property dynamic-filtering.enabled in your catalog properties file to false.

JDBC connection pooling#

You can improve performance by enabling JDBC connection pooling, which is disabled by default.

Security#

The connector includes a number of security-related features, detailed in the following sections.

Password credential passthrough#

The connector supports password credential passthrough. This means that the data Presto accesses is the same as the data available to a user who has direct access to the data source.

To enable it, edit the catalog properties file to include the authentication type:

sap-hana.authentication.type=PASSWORD_PASS_THROUGH

For more information about configurations and limitations, see Password credential passthrough.