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.

Pushdown#

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

Dynamic filtering#

The connector supports dynamic filtering. It is enabled by default , and you can disable it with wait-for-dynamic-filters property in your catalog properties file:

wait-for-dynamic-filters=false

You can use the wait_for_dynamic_filters catalog session property in a specific session:

SET SESSION mycatalog.wait_for_dynamic_filters = true;

Security#

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

Password credential passthrough#

The SAP HANA connector supports password credential passthrough. To enable it, edit the catalog properties file, and replace both connection-user and connection-password properties with sap-hana.authentication.type=PASSWORD_PASS_THROUGH:

connector.name=sap-hana
connection-url=jdbc:sap://sap-hana:39017
sap-hana.authentication.type=PASSWORD_PASS_THROUGH