Vertica is a column-oriented database using the Massively Parallel Processing (MPP) architecture. Vertica Reader allows you to read data from Vertica. This topic describes how Vertica Reader works, the supported parameter, and how to configure it by using the code editor.

Vertica Reader connects to a remote Vertica database through Java Database Connectivity (JDBC) and runs a SELECT statement to select and read data from the database.

How it works

Vertica Reader connects to a remote Vertica database through JDBC, generates a SELECT statement based on your configurations, and then sends the statement to the database. The Vertica database runs the statement and returns the result. Then, Vertica Reader assembles the returned data to abstract datasets in custom data types supported by Data Integration, and sends the datasets to a writer.

  • Vertica Reader generates the SELECT statement based on the table, column, and where parameters that you have configured, and sends the generated SELECT statement to the Vertica database.
  • If you specify the querySql parameter, Vertica Reader directly sends the value of this parameter to the Vertica database.

Vertica Reader accesses a Vertica database through the Vertica database driver. Confirm the compatibility between the driver version and your Vertica database. Vertica Reader uses the following version of the Vertica database driver:

<dependency>
    <groupId>com.vertica</groupId>
    <artifactId>vertica-jdbc</artifactId>
    <version>7.1.2</version>
</dependency>

Parameters

Parameter Description Required Default value
datasource The connection name. It must be identical to the name of the added connection. You can add connections in the code editor. Yes None
jdbcUrl The JDBC URL for connecting to the Vertica database. You can specify multiple JDBC URLs for a database. The JDBC URLs are described in a JSON array.

If you specify multiple JDBC URLs, Vertica Reader verifies the connectivity of the URLs in sequence to find a valid URL. If no URL is valid, Vertica Reader returns an error.

Note The jdbcUrl parameter must be included in the connection parameter.

The value of the jdbcUrl parameter must be in compliance with the standard format supported by Vertica. You can also specify the information of the attachment facility. Example: jdbc:vertica://1**.0.0.1:3306/database.

No None
username The username for connecting to the Vertica database. No None
table The name of the table to be synchronized. Yes None
password The password for connecting to the Vertica database. No None
table The name of the table to be synchronized. Vertica Reader can read data from multiple tables. The tables are described in a JSON array.

If you specify multiple tables, make sure that the tables have the same schema. Vertica Reader does not check whether the tables have the same schema.

Note The table parameter must be included in the connection parameter.
Yes None
column The columns to be synchronized from the source table. The columns are described in a JSON array. The default value is [ * ], which indicates all columns.
  • Column pruning is supported. You can select and export specific columns.
  • Change of the column order is supported. You can export the columns in an order different from that specified in the schema of the table.
  • Constants are supported.
  • The column parameter must explicitly specify a set of columns to be synchronized. The parameter cannot be left empty.
Yes None
splitPk The field used for data sharding when Vertica Reader extracts data. If you specify the splitPk parameter, the table is sharded based on the shard key specified by this parameter. Data Integration then runs concurrent threads to synchronize data. This improves efficiency.
  • We recommend that you set the splitPk parameter to the primary key of the table. Based on the primary key, data can be well distributed to different shards, but not intensively distributed to certain shards.
  • Currently, the splitPk parameter supports data sharding only for integers but not for other data types such as string, floating point, and date. If you set this parameter to a column of an unsupported type, Vertica Reader returns an error.
  • If you leave the splitPk parameter empty, Vertica Reader extracts the data in the source table through a single thread.
No None
where The WHERE clause. Vertica Reader generates a SELECT statement based on the column, table, and where parameters that you have configured, and uses the generated SELECT statement to select and read data.

For example, you can specify the where parameter during testing. To synchronize data generated on the current day, set the where parameter to gmt_create > $bizdate.

  • You can use the WHERE clause to synchronize incremental data.
  • If you do not specify the where parameter or leave it empty, all data is synchronized.
No None
querySql The SELECT statement used for refined data filtering. If you specify this parameter, Data Integration directly filters data based on this parameter.

If you specify the querySql parameter, Vertica Reader ignores the table, column, and where parameters that you have configured.

No None
fetchSize The number of data records to read at a time. This parameter determines the number of interactions between Data Integration and the database and affects reading efficiency.
Note A value greater than 2048 may lead to out of memory (OOM) during the data synchronization process.
No 1024

Configure Vertica Reader by using the codeless UI

Currently, the codeless user interface (UI) is not supported for Vertica Reader.

Configure Vertica Reader by using the code editor

In the following code, a node is configured to read data from a Vertica database.

{
    "type": "job",
    "steps": [
        {
            "stepType":"vertica",// The reader type.
             "parameter": {
                "datasource": "", // The connection name.
                 "username": "",
                "password": "",
                "where": "",
                "column":[// The columns to be synchronized.
                     "id",
                    "name"
                ],
                "splitPk": "id",
                "connection": [
                    {
                        "table": [ // The name of the table to be synchronized.
                             "table"
                        ],
                        "jdbcUrl": [
                            "jdbc:vertica://host:port/database"
                        ]
                    }
                ]
            },
            "name": "Reader",
            "category": "reader"
        },
        {
            "stepType": "stream",
            "parameter": {
                "print": false,
                "fieldDelimiter": ","
            },
            "name": "Writer",
            "category": "writer"
        }
    ],
    "version": "2.0",
    "order": {
        "hops": [
            {
                "from": "Reader",
                "to": "Writer"
            }
        ]
    },
    "setting": {
        "errorLimit": {
            "record":"0"// The maximum number of dirty data records allowed.
         },
        "speed": {
            "throttle": false,// Specifies whether to enable bandwidth throttling. 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 maximum number of concurrent threads.
         }
    }
}