Skip to main content

SAP HANA JDBC Catalog

The Doris JDBC Catalog supports connecting to the SAP HANA database through the standard JDBC interface. This document describes how to configure the SAP HANA database connection.

For an overview of the JDBC Catalog, please refer to: JDBC Catalog Overview

Usage Notes​

To connect to the SAP HANA database, you need

  • SAP HANA 2.0 or higher.

  • The JDBC driver for the SAP HANA database, which you can download from the Maven Repository. It is recommended to use version ngdbc 2.4.51 or above.

  • Network connection between each Doris FE and BE node and the SAP HANA server, with the default port being 30015.

Connecting to SAP HANA​

CREATE CATALOG saphana_catalog PROPERTIES (
'type' = 'jdbc',
'user' = 'username',
'password' = 'pwd',
'jdbc_url' = 'jdbc:sap://Hostname:Port/?optionalparameters',
'driver_url' = 'ngdbc-2.4.51.jar',
'driver_class' = 'com.sap.db.jdbc.Driver'
)

For more information on the JDBC URL format and parameters supported by the SAP HANA JDBC driver, please refer to SAP HANA.

Hierarchical Mapping​

When mapping SAP HANA, the Database in Doris corresponds to a Schema under the specified DataBase in SAP HANA (the "DATABASE" in the jdbc_url parameter). The Table under the Database in Doris corresponds to the Tables under the Schema in SAP HANA. The mapping relationship is as follows:

DorisSAP HANA
CatalogDatabase
DatabaseSchema
TableTable

Column Type Mapping​

SAP HANA TypeDoris TypeComment
booleanboolean
tinyinttinyint
smallingsmalling
integerint
bigintbigint
smalldecimal(P, S)decimal(P, S) or double or stringIf precision is not specified, the double type is used. If the precision exceeds the maximum precision supported by Doris, the string type is used.
decimal(P, S)decimal(P, S) or double or stringSame as above.
realfloat
doubledouble
datedate
timestring
timestamp(S)datetime(S)
seconddatedatetime(S)
varcharstring
nvarcharstring
alphanumstring
shorttextstring
char(N)char(N)
nchar(N)char(N)
otherUNSUPPORTED