Table Input

Overview

Table Input operator converts specified columns in a relational database table into input fields of the same quantity.

Input and Output

Parameter Description

Table 1 Operator parameters description

Parameter

Description

Type

Mandatory

Default Value

Input fields

Information about relational database input fields:

  • position: position of input fields
  • field name: input field name
  • type: field type
  • length: Field value length. If the actual field value is excessively long, the value is cut based on the configured length. When type is set to CHAR, spaces are added to the field value for supplement if the actual field value length is less than the configured length. When type is set to VARCHAR, no space is added to the field value for supplement if the actual field value length is less than the configured length.

map

Yes

None

Data Processing Rule

Example

Use SQL Server 2014 as an example. Run the following command to create a test table:

create table test (id int, name text, value text);

Insert three data lines to the test table:

insert into test values (1,'zhangshan','zhang');

insert into test values (2,'lisi','li');

insert into test values (3,'wangwu','wang');

Query the table:

Configure the Table Input operator to generate the following fields:

After the data connector is set, click Automatic Identification. The system will automatically read fields in the database and select required fields for adding. You only need to optimize or modify the fields manually based on service scenarios.

Performing this operation will overwrite existing data in the table.

Configure the output operator to output data to HDFS/OBS. The result is as follows: