How to set the schema correctly based on the query text when using tMDMRestInput - 7.3

MDM data processing

author
Talend Documentation Team
EnrichVersion
Cloud
7.3
EnrichProdName
Talend Data Fabric
Talend MDM Platform
task
Data Governance > Third-party systems > MDM components > MDM data processing components
Data Quality and Preparation > Third-party systems > MDM components > MDM data processing components
Design and Development > Third-party systems > MDM components > MDM data processing components
EnrichPlatform
Talend MDM Server
Talend MDM Web UI
Talend Studio

When using the component tMDMRestInput, you can use the query language to narrow down the data records to be retrieved. Based on the query, you need to set the schema correctly for the retrieved data.

For more information about the MDM query language and REST data access, see https://help.talend.com/access/sources/content/topic?pageid=mdm_query_language_and_rest_data_access&EnrichVersion=7.3&afs:lang=en.

Query cases

  • When a query only counts how many results are returned by the query, you need to define one and only one column count in the schema.

  • When a query gets a metadata field, you need to define a column the same name as the metadata field in the schema.

  • When a query gets one or more fields, you need to define one or more columns whose names are the same as the returned fields in the schema.

  • When a query uses an alias, you need to define a column the same name as the alias field in the schema.

For example, if a query text gets the following fields, you need to define columns in the schema correspondingly: id, price, timestamp, taskid and productname.


 "{
  'select': {
        'from': ['Product'],
        'fields': [
               {'field': 'Product/Id'},
               {'field': 'Product/Price'},
               {'metadata': 'timestamp'},
               {'metadata': 'task_id'},
               {'alias' : [{'name' : 'ProductName'}, {'field': 'Product/Name'}]}
                  ]
             }
}"