Dataphin allows you to run paged queries for audience group IDs and tag values through batch query interfaces. You first export audience group and tag data to an Elasticsearch data source, and then call the provided API to page through the exported group IDs and tag values.
Prerequisites
-
You have selected the required audience groups from the audience group asset market and obtained usage permissions for the application that hosts the service. For more information, see requesting audience group permissions.
-
You have created an application for the paged query service. For more information, see create application.
-
You have configured the Elasticsearch data source that provides the query service. For more information, see creating an Elasticsearch data source.
Considerations
-
When the paged query service starts, the system deletes existing data in the target index before writing new data. During this process, paged query results are empty.
-
If a tag used in the paged query is removed, the query returns an empty value. To replace a tag, keep the original tag, add the new tag, and remove the old tag only after updating the consuming application.
-
Behavior preference tags cannot be exported.
Create paged query service for audience groups
-
On the Dataphin home page, navigate to the top menu bar and select Tag > Tag Application.
-
In the left-side navigation pane, choose Service Management > Paged Group Query.
-
On the Paged Group Query page, Create Query Service.
-
On the Create Query Service page, configure the following parameters.
Parameter
Description
Basic Information
Task Name
Enter a name for the task.
It must start with a lowercase letter and contain only lowercase letters, numbers, and underscores (_). The length can be up to 64 characters.
Application Selection
Select the application associated with the project.
Note-
Only applications associated with a project can create offline services.
-
Only applications with permissions are supported.
Owner
Select the owner of the offline service. You can search by keyword.
Schedule Type
Supports recurring schedule and manual schedule task types.
-
Manual Schedule: One-time integration. After the task is published, you can select manual execution on the task list page.
-
Recurring Schedule: Scheduled execution based on the configured cycle.
Description
Enter a brief description. The length can be up to 1000 characters.
Field Mapping
Group Selection
Select the audience group for paged query.
Is Tag Sync Required
The default is No, which syncs only the entity ID of the audience group. If you select Yes, you can choose tags to sync in Input Tag.
Target Data Source
Select an Elasticsearch data source instance.
Index
Select the index of the target Elasticsearch data source. If no matching index exists, select the input tag first, then click Create Index to create one in the Create Index dialog box.
-
In the Create Index dialog box, configure the index information.
-
Index Name: Enter the index name.
-
Cannot start with a hyphen (-), underscore (_), or plus sign (+).
-
Does not support Chinese characters, uppercase letters, forward slashes (/), backslashes (\), vertical lines (|), asterisks (*), half-width question marks (?), half-width colons (:), half-width periods (.), half-width quotation marks ("), hash signs (#), angle brackets (<>), or spaces.
-
The length can be up to 255 characters.
-
-
Mapping Field: Enter the field name and select the field type. You can add multiple fields.
-
Field Name: Must start with a lowercase letter and contain only lowercase letters, numbers, and underscores (_). The length can be up to 64 characters.
-
Field Type: Select the field type for the corresponding field.
NoteIf the tag has a lookup table, the system automatically creates the code name of the tag.
-
-
-
Click OK.
Loading Policy
The default is Overwrite Policy, and it cannot be modified.
Input Tag
Select the tags to be mapped and click the
button to configure the field mapping relationship.Note-
This item only needs to be configured if Tag Sync Required is selected.
-
Only supports tags related to the entity ID of the audience group that the application has obtained permission for.
Mapping Relationship
Displays the selected tags and their mapping field relationships. Select the mapping field for each output tag.
-
Same Name Mapping: Click Same Name Mapping to associate tags and their mapping fields with the same name.
-
Purge: Click the
icon to purge the mapped relationship. -
Output Content: Select the output content of the tag with the configured lookup table. You can choose Tag Value and Code Name. By default, all tag values are selected. You can select Tag Value and Code Name below the output tag list for full selection (all pages).
NoteThis item only needs to be configured if Tag Sync Required is selected.
Operations Configuration
Schedule Cycle
The scheduling interval for the task. Supports daily scheduling. The offline tag task runs daily at the configured time.
ImportantAfter the task starts, existing data in the index is deleted. Until new data is written, paged query results are empty and the service is inactive. Schedule the task during off-peak hours or notify users of the expected downtime.
-
-
Publish to finalize the creation of the paged query service for audience groups.
Manage paged query for audience groups
-
The paged query page displays task name, owner, application name, audience group name, entity, entity ID, task status, execution status, schedule type, and available operations.
-
(Optional) You can apply filters by selecting Only My Tasks, entering the task name, or using the Filter option based on Application Name, Entity-Entity ID, Target Source Type, Task Status, Execution Status, Schedule Type.
-
In the Actions column, you can perform the following operations.
Operation Item
Description
Edit
When the Task Status is not Publishing or Unpublishing, click the
icon to edit the service on the Edit Offline Service page and republish. The task name, schedule type, and loading policy cannot be modified.Details
Click the
icon to view the details of the current offline service on the View Offline Service page. When the task status is Editing, Publish Failed, Published, or Unpublished, you can click Edit at the bottom of the page to modify the service.View Instance
Click the
icon to view the execution instances of this paged query service.Unpublish
When the Task Status is Published or Unpublish Failed, you can click the
icon to unpublish the service.NoteUnpublishing the service does not delete the target table or intermediate temporary table in the target data source.
Data Backfill
When the Execution Status is Running, click the
icon to perform data backfill. By default, the backfill covers the previous day's data (T-1).Run
For tasks with the Manual Schedule type, click the
icon and select a Data Timestamp in the Run dialog box to manually run the task.View Invocation Code
View the request path and invocation code of the paged query service.
Delete
When the Task Status is Unpublished or Publish Failed, click the
icon to delete the service.