Special Character Removal
The special character removal operator removes special content from text, such as URLs, invisible characters, and emoji. This topic explains how to configure the operator.
Prerequisites
To use the workflow feature, you must first purchase the unstructured data feature for your instance.
An existing workflow is required. For more information, see Create and manage workflows.
Permissions
In a Basic project, project administrators, developers, analysts, and custom project roles with the Dataset-Use permission can use all datasets within the project for the operator's input and output.
Supported file formats
The special character removal operator can process files in the following formats: .txt, .md, .csv, .json, .xml, and .html.
Procedure
In the top navigation bar of the Dataphin homepage, choose Develop > Data Development.
On the Develop page, select a project from the top navigation bar.
In the left-side navigation pane, choose Data Processing > Workflow. In the Workflow list, click the target workflow to open its canvas. From the Operator Library on the left, drag the Special Character Removal operator to the canvas. In the Special Character Removal panel on the right, configure the following parameters.
Parameter
Description
Step name
Enter a name for the current operator. The name can contain any characters and must not exceed 256 characters.
Input configuration
Dataset
Select the dataset to process. You can choose a mixed dataset or a table dataset. After you select a dataset, you must also select a version. By default, the system selects the earliest version of the dataset.
When this operator is downstream of another operator, the dataset selected here is typically the same as the output dataset of the upstream operator.
Input field
Select a field from the metadata table of the input dataset. The system automatically determines how to process the object based on its field type:
If the field is a URL type, the system automatically fetches the resource at the link and parses its structured or semi-structured content. Supported file formats include .txt, .md, .csv, .json, .xml, and .html.
For non-URL fields, the system treats the value as plain text and performs no additional parsing.
Filter condition (Optional)
Use SQL syntax. Enter only the condition that follows the
WHEREclause. System global variables, such as ${bizdate}, are supported.Operator configuration
Characters to remove
Select the types of special characters to remove from the text. You can choose Invisible Characters, URL, Emoji, and IP Address.
Invisible Characters: Includes various Unicode whitespace characters, such as full-width space (\u3000), non-breaking space (\u00A0), narrow non-breaking space (\u202F), and hair space (\u200A).
URL:
Full URL: Links that start with
http://,https://, orftp://.Bare Domain URL: Text that matches a URL pattern but does not have a scheme, such as
www.example.com/path?query=1.File Path URL: For example,
file:///C:/Users/...or//server/share/....Data URI: For example,
data:image/png;base64,iVBOR..., which is common in HTML exports.
Output configuration
Dataset
You can select the Source Dataset or Other Datasets. If the metadata table of the source dataset does not have a primary key, the output dataset defaults to Other Datasets.
When you select Other Datasets, you must also specify a dataset and its version as the output dataset based on the input field type. By default, the system selects the earliest version.
If the input field is a URL type, which generates a file after processing, you can only select a mixed dataset as the output dataset.
If the input field is not a URL type, which does not generate a file after processing, you can select either a mixed dataset or a table dataset as the output dataset.
If you select Source Dataset, the operator writes the generated metadata to the metadata table of the same source dataset version.
File output path
Enter the output path for the file. This parameter is available only when the input field is a URL type.
Loading policy
If the metadata table of the selected output dataset contains a primary key, update on primary key conflict is selected by default. If no primary key exists, append data is selected by default.
Append data: Adds new data to the target table. An error occurs if the system detects a primary key or constraint conflict.
Update on primary key conflict: If a primary key or constraint conflict occurs, the system deletes the existing row with the duplicate primary key before inserting the new data.
Overwrite: Deletes all data from the target table before writing new data.
NoteWhen you set the output dataset to Source Dataset, only the update on primary key conflict loading policy is available.
Field mapping
If the input field is a URL field, the operator outputs a fixed
markdown_urlfield, which is the storage URL of the output file. If the input field is not a URL field, the operator outputs a fixedprocessed_textfield, which contains the extracted text content.By default, the operator maps its output fields to fields with the same names in the output dataset. You can also manually map them to different target fields. Additionally, you can map pass-through fields from the source dataset to the target dataset. You can manage field mappings in the following ways:
Add output field: Click to add a new, empty field mapping row. This feature is available only when you select Other Datasets as the output.
Batch mapping: Click to choose between batch manual mapping, mapping by name, or mapping by row index. This feature is available only when you select Other Datasets as the output.
Delete mapping: Click the Delete icon to delete the field mapping for the corresponding row, but mappings for the fixed output fields of an operator cannot be deleted.
After you complete the configuration, click Save in the top menu bar of the canvas.
After you configure an operator, you can connect it to upstream or downstream operators to build a complete workflow.