A single physical table service unit is used for metadata configuration of a single physical table in a business data source. You can then develop an API to access the data of the physical table based on this service unit. This topic describes how to create a single physical table service unit.
Prerequisites
The service unit group has been successfully created. For detailed instructions, see Create a service project group.
When the data source type is HBase 0.9.4, 1.1.x, 1.2.1, 2.x, ElasticSearch, or MongoDB, you must complete metadata creation. For specific instructions, see Create metadata.
Limits
Metadata configuration can be performed on a single physical table through the data source. For supported data sources, see DataService Studio Supported Data Sources.
Permission policies
Both project administrators and developer users can create service units.
Step 1: select the service unit type
On the Dataphin home page, select Service > Development from the top menu bar.
In the upper left corner, select the project, click the left-side navigation pane Service Unit, on the Service Unit page, click + New Service Unit.
In the Service Unit Type Selection dialog box, select Single Physical Table Service Unit and then click OK.
Step 2: configure the single physical table service unit parameters
On the New Service Unit page, configure the basic information and unit fields of the service unit.
Service unit basic information configuration
Parameter
Description
Service Unit Name
The name of the service unit. The naming convention is as follows:
Can only contain letters, numbers, and underscores (_).
Starts with a letter.
Length is between 4 and 64 characters.
Service Unit Group
Select an already created service unit group.
Mode
The mode is used to define whether the data read by the service unit comes from the development data source or the production data source. The modes include Basic and Dev-Prod modes:
Basic: After selecting the Basic mode, you can only select the production data source when the service unit reads data.
Dev-Prod: After selecting the Dev-Prod mode, you can select both development data source and production data source when the service unit reads data.
You can view whether your data source is a production data source or a development data source on the data source page.
Physical Data Table
You can filter physical tables based on the data source type and data source. You can also click Add Data Source to introduce a new business data source to create a service unit based on the new business data source. For supported data sources, see DataService Studio supported data sources.
Service Unit Description
Provide a brief description of the service unit. No more than 128 characters.
Max Return Count
The default maximum return count in Dataphin is 1000. The maximum limit is 10000.
It is used to define the number of records returned when querying data through the API to avoid excessive data in a single query causing Dataphin system memory overflow. If you need to query more data, you can modify the PageSize parameter value in the SDK of Invoke API to return more data when querying the API.
If a similar service unit already exists, Dataphin will automatically display its name. You can view the detailed information of the service unit in the service unit list. To continue creating a new service unit, click Continue To Create to proceed to the Configure Service Unit Fields page.
Configure service unit fields.
Parameter
Description
Service Unit Field Type
The supported field types include Double, Float, String, Date, Boolean, Int, Long, Short, Byte, BigDecimal, and Binary. You need to select the corresponding parameter type based on the field type in the business data table.
If the field type of the business data table is not within the range of selectable parameter types, it is recommended to choose String.
Service Unit Field
Support custom selection of some source table fields as service unit fields. New fields in the source table can also be added and selected during editing.
Configure the mapping of fields in the data source to field names in the service unit. You can customize the field names according to the business situation. The naming convention is as follows:
Can only contain letters, numbers, and underscores (_).
Starts with a letter.
Length is between 4 and 64 characters.
When editing a single physical table service unit, if the system determines that the source table field has been deleted, it supports deleting the service unit field. After submitting the configuration, when creating a new API referencing the service unit, the field will not be present, avoiding failure when invoking the API due to the absence of the source table field.
Service Unit Field Description
Provide a brief description of the service unit field.
After configuring the service unit fields, click Data Preview at the bottom to view the business data corresponding to the fields. Up to 1000 records can be returned.
Click Submit to complete the creation of the single physical table service unit.
What to do next
On the service unit page, click the Actions column
icon and select Publish to submit the single physical table service unit to the production environment. You can then create an API based on this single physical table service unit. For more information, see Create API.
Once the physical table service unit is created, you can edit, publish, or delete it on the service unit page. For details, see Manage Service Units.