Read Dataset

Updated at:

The Read Dataset operator reads data from a specified dataset as a data source for offline and real-time workflows. This topic describes how to configure the Read Dataset operator.

Prerequisites

  • To use the workflow feature, you must purchase the or the Unstructured Data - Enterprise Edition for the current instance and bind the current project to a real-time compute engine.

  • You have created an offline workflow or a real-time workflow. For more information, see Create and manage a workflow.

Limitations

The Read Dataset operator is supported only in offline workflows and real-time workflows.

Permissions

In a Basic project, project administrators, developers, analysts, and custom project roles with the Dataset-Use permission can use all datasets in the project as input or output datasets for operators.

Procedure

  1. In the top navigation bar on the Dataphin homepage, choose R&D > Data Development.

  2. In the top navigation bar of the Data Development page, select Project.

  3. In the left-side navigation pane, choose Data Processing > Workflow. In the Workflow list on the left, click the target offline or real-time workflow. The system automatically adds a Read Dataset operator to the canvas and sets it as the root node of the DAG. Click the Read Dataset operator and configure the following parameters in the Read Dataset panel on the right.

    Parameter

    Description

    Step name

    The operator name can contain any characters and be up to 256 characters long.

    Input configuration

    Dataset

    Select the dataset to process. You can only select datasets in the current project that are designated for Offline or Real-time use. You can also select a specific version. By default, the operator uses the latest version of the dataset.

    Data source

    Defines how to retrieve data. You can select one of the following options: Read from File Storage or Read from Metadata Table.

    • Read from File Storage: The system scans the file system based on scanning rules to find matching file storage URLs.

    • Read from Metadata Table: The system retrieves metadata directly from the table without scanning the underlying file storage. This improves processing efficiency.

    Scan scope (Optional)

    This parameter is available when Data source is set to Read from File Storage. By default, all files in the dataset are scanned. You can use a regular expression to limit the scan scope. You can also reference variables, including local and global variables, by using the ${xx} syntax.

    You can add up to 10 rules. The rules are combined using OR logic. To the left of each rule input field, the system displays the dataset's path prefix, which updates based on the selected dataset path. If no path is specified, it shows the root path. This prefix is for display purposes only and is not part of the rule itself. By default, the rule field is empty.

    Example use cases:

    • To specify .txt files: ^.*\.txt$

    • To specify .txt or .csv files: ^.*\.(txt|csv)$

    • To include the 'category/' directory and its subdirectories: ^category/.*$

    • To match a file name prefix (in any directory): ^(?:.*/)?${prefix}[^/]*$

    • To match a file name suffix (in any directory): ^(?:.*/)?[^/]*${suffix}\.[^/.]+$

    If a rule references one or more variables (local and global), the system identifies them when the workflow is run. You can then provide values for these variables in the parameter configuration section of the run dialog box.

    Field information

    This section is displayed when Data source is set to Read from Metadata Table. After you select a dataset and its version, the Field information section displays all fields in the dataset, including the field name, type, and description.

    Output preview

    This section is displayed when Data source is set to Read from File Storage. It shows the list of fields generated after the operator finishes processing. This list is passed as standard output to downstream operators and can be used in subsequent steps. The operator always outputs the following field:

    file_url: The file storage URL.

  4. After you finish the configuration, click Save in the top menu bar of the canvas to save your settings.

    After configuring an operator, you can build the complete workflow by connecting it to upstream or downstream operators.