This topic describes the data types and parameters supported by SAP HANA Reader and how to configure it by using the codeless user interface (UI) or code editor. Before you create a Data Integration node, you can refer to this topic to understand the data types and parameters that you must configure for SAP HANA Reader to extract data from data sources.

Background information

SAP HANA Reader connects to a remote SAP HANA database by using JDBC, generates an SQL statement based on your configurations, and sends the statement to the database. The database runs the SQL statement and returns the result. Then, SAP HANA Reader assembles the returned data to abstract datasets of custom data types that are supported by Data Integration, and passes the datasets to a writer.

Data types

SAP HANA Reader converts the data types of SAP HANA:
Data type The data type of SAP HANA
Integer INT, TINYINT, SMALLINT, MEDIUMINT, and BIGINT
Floating point FLOAT, DOUBLE, and DECIMAL
String VARCHAR, CHAR, TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT
Date and time DATE, DATETIME, TIMESTAMP, TIME, and YEAR
Boolean BIT and BOOL
Binary TINYBLOB, MEDIUMBLOB, BLOB, LONGBLOB, and VARBINARY
Notice
  • SAP HANA Reader supports only the data types that are described in the preceding table.
  • SAP HANA Reader classifies tinyint(1) as the integer type.

Parameters

Parameter Description
username The username that you can use to connect to SAP HANA.
password The password that you can use to connect to SAP HANA.
column The columns to be synchronized. Set this parameter to an asterisk (*) if all the columns in the source table need to be synchronized.
table The name of the table to be synchronized.
jdbcUrl The Java Database Connectivity (JDBC) URL of SAP HANA. Example: jdbc:sap://127.0.0.1:30215? currentschema=TEST.
splitPk The field that is used for data sharding when SAP HANA Reader extracts data. If you specify the splitPk parameter, the table is sharded based on the shard key that is specified by this parameter. Data Integration then runs concurrent threads to synchronize data.

The splitPk parameter supports data sharding only for integers. If no integer fields exist, do not specify this parameter.

Configure SAP HANA Reader by using the codeless UI

  1. Configure a data source.

    Configure a data source for Source.

    sap source
    Parameter Description
    Data source The datasource parameter in the preceding parameter description. Select the name of the data source that you have configured.
    Table The table parameter in the preceding parameter description.
    Filter The condition for filtering the data that you want to synchronize. SAP HANA Reader cannot filter data based on the limit keyword. The SQL syntax is determined by the selected data source.
    Shard Key The shard key. You can specify a column in the source table as the shard key. We recommend that you use the primary key or an indexed column as the shard key. Only integer fields are supported.
    If data sharding is performed based on the configured shard key, data can be read concurrently to improve data synchronization efficiency.
    Note The Shard Key parameter is displayed only when you configure the source connection for a sync node.

Configure SAP HANA Reader by using the code editor

The following examples show how to configure a sync node to read data from a database or table that is not sharded and a sync node to read data from a database or table that is sharded.
  • Configure a sync node to read data from a database or table that is not sharded
    {
        "type":"job",
        "version":"2.0",// The version number.
        "steps":[
            {
                "stepType":"stream",// The reader type.
                "parameter":{
                    "column":[// The columns to be synchronized.
                        "id"
                    ],
                    "connection":[
                        {   "querySql":["select a,b from join1 c join join2 d on c.id = d.id;"],// Specify the querySql parameter in the connection parameter as a string.
                            "datasource":"",// The name of the data source.
                            "table":[// The name of the source table. The table name must be enclosed in brackets [], even if you want to synchronize data from only one table.
                                "xxx"
                            ]
                        }
                    ],
                    "where":"",// The WHERE clause.
                    "splitPk":"",// The shard key.
                    "encoding":"UTF-8"// The encoding format.
                },
                "name":"Reader",
                "category":"reader"
            },
            {
                "stepType":"stream",
                "parameter":{},
                "name":"Writer",
                "category":"writer"
            }
        ],
        "setting":{
            "errorLimit":{
                "record":"0"// The number of dirty data records.
            },
            "speed":{
                "throttle":false,// A value of false indicates that the bandwidth is not throttled. A value of true indicates that the bandwidth is throttled. The maximum transmission rate takes effect only if you set this parameter to true.
                "concurrent":1, // The number of concurrent threads.
            }
        },
        "order":{
            "hops":[
                {
                    "from":"Reader",
                    "to":"Writer"
                }
            ]
        }
    }
  • Configure a sync node to read data from a sharded database or table.
    Note When you configure a sync node to read data from a sharded database or table, you can select multiple SAP HANA tables. The table structure on the reader and writer sides are consistent.
    {
        "type": "job",
        "version": "1.0",
        "configuration": {
            "reader": {
                "plugin": "saphana",
                "parameter": {
                    "connection": [
                        {
                            "table": [
                                "tbl1",
                                "tbl2",
                                "tbl3"
                            ],
                            "datasource": "datasourceName1"
                        },
                        {
                            "table": [
                                "tbl4",
                                "tbl5",
                                "tbl6"
                            ],
                            "datasource": "datasourceName2"
                        }
                    ],
                    "singleOrMulti": "multi",
                    "splitPk": "db_id",
                    "column": [
                        "id", "name", "age"
                    ],
                    "where": "1 < id and id < 100"
                }
            },
            "writer": {            
            }
        }
    }