All Products
Search
Document Center

Dataphin:Configure the ClickHouse output component

Last Updated:Mar 05, 2026

The ClickHouse output component writes data to a ClickHouse data source. When synchronizing data from other data sources to ClickHouse, you need to configure the target data source for the ClickHouse output component after configuring the source data information. This topic describes how to configure the ClickHouse output component.

Prerequisites

You have created a ClickHouse data source and data table:

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Development > Data Integration.

  2. In the top navigation bar of the Integration page, select a project (In Dev-Prod mode, you need to select an environment).

  3. In the navigation pane on the left, click Batch Pipeline. In the Batch Pipeline list, click the offline pipeline that you want to develop to open its configuration page.

  4. Click Component Library in the upper-right corner of the page to open the Component Library panel.

  5. In the navigation pane on the left of the Component Library panel, select Outputs. Find the ClickHouse component in the output component list on the right, and drag it to the canvas.

  6. Click and drag the image icon of the target input, transform, or flow component to connect it to the current ClickHouse output component.

  7. Click the image icon on the ClickHouse output component to open the ClickHouse Output Configuration dialog box.image

  8. In the ClickHouse Output Configuration dialog box, configure the parameters.

    Parameter

    Description

    Basic Configuration

    Step Name

    The name of the ClickHouse output component. Dataphin automatically generates a step name, which you can modify based on your business scenario. The name must meet the following requirements:

    • It can contain only Chinese characters, letters, underscores (_), and digits.

    • It cannot exceed 64 characters in length.

    Datasource

    The data source dropdown list displays all ClickHouse data sources in Dataphin, including those for which you have write-through permission and those for which you do not. Click the image icon to copy the name of the currently selected table.

    • For data sources for which you do not have write-through permission, you can click Request next to the data source to request write-through permission. For more information, see Request data source permissions.

    • If you do not have a ClickHouse data source, click Create Data Source to create one. For more information, see Create a ClickHouse data source.

    Table

    Select the target table for output data. You can enter a keyword to search for tables or enter the exact table name and click Exact Match. After you select a table, the system automatically checks the table status. Click the image icon to copy the name of the currently selected table.

    Loading Policy

    Select the policy for writing data to the target table. Currently, only Append Data is supported. Append Data means that data is appended to the existing data in the target table without modifying the historical data.

    Batch Write Size (optional)

    The size of data to be written at once. You can also set Batch Write Records. When writing data, the system will write based on whichever limit is reached first. The default is 32M.

    Batch Write Records (optional)

    The default is 2048 records. When synchronizing data, a batch write strategy is used, with parameters including Batch Write Records and Batch Write Size.

    • When the accumulated data reaches either of the set limits (i.e., the batch write size or record count limit), the system considers a batch of data to be full and immediately writes this batch of data to the destination in one operation.

    • It is recommended to set the batch write size to 32MB. For the batch insert record limit, you can adjust it flexibly based on the actual size of a single record, usually setting it to a large value to fully utilize the advantages of batch writing. For example, if a single record is about 1KB in size, you can set the batch insert byte size to 16MB, and considering this condition, set the batch insert record count to greater than the result of 16MB divided by the single record size of 1KB (i.e., greater than 16384 records), assuming here it's set to 20000 records. With this configuration, the system will trigger batch writes based on the batch insert byte size, executing a write operation whenever the accumulated data reaches 16MB.

    Prepare Statement (optional)

    The SQL script to be executed on the database before data import.

    For example, to ensure continuous service availability, before the current step writes data, it first creates a target table Target_A, executes writing to Target_A, and after the current step completes writing data, it renames the continuously serving table Service_B to Temp_C, then renames table Target_A to Service_B, and finally deletes Temp_C.

    Post Statement (optional)

    The SQL script to be executed on the database after data import.

    Field Mapping

    Input Fields

    Displays the input fields based on the output of the upstream component.

    Output Fields

    Displays the output fields. You can perform the following operations:

    • Field Management: Click Field Management to select output fields.

      image

      • Click the gaagag icon to move Selected Input Fields to Unselected Input Fields.

      • Click the agfag icon to move Unselected Input Fields to Selected Input Fields.

    • Batch Add: Click Batch Add to configure in JSON, TEXT, or DDL format.

      • Batch configuration in JSON format, for example:

        // Example:
        [{
          "name": "user_id",
          "type": "String"
         },
         {
          "name": "user_name",
          "type": "String"
         }]
        Note

        name specifies the name of the field to import. type specifies the data type of the field after it is imported. For example, "name":"user_id","type":"String" imports the field named user_id and sets its data type to String.

      • Batch configuration in TEXT format, for example:

        // Example:
        user_id,String
        user_name,String
        • The row delimiter is used to separate the information of each field, with the default being a line feed (\n). It supports line feed (\n), semicolon (;), and period (.).

        • The column delimiter is used to separate the field name and field type, with the default being a comma (,).

      • Batch configuration in DDL format, for example:

        CREATE TABLE tablename (
            id INT PRIMARY KEY,
            name VARCHAR(50),
            age INT
        );
    • Create new output field: Click +Create New Output Field, fill in the Column and select the Type as prompted. After completing the configuration for the current row, click the image icon to save.

    Mapping

    Based on the upstream input and the target table fields, you can manually select field mappings. Quick Mapping includes Same Row Mapping and Same Name Mapping.

    • Same Name Mapping: Maps fields with the same name.

    • Same Row Mapping: When the field names in the source and target tables are inconsistent, but the data in corresponding rows needs to be mapped. Only maps fields in the same row.

  9. Click OK to complete the configuration of the ClickHouse output component.