Setting up the Job - Cloud - 8.0

CosmosDB

Version
Cloud
8.0
Language
English (United States)
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Database components (Integration) > CosmosDB components
Data Quality and Preparation > Third-party systems > Database components (Integration) > CosmosDB components
Design and Development > Third-party systems > Database components (Integration) > CosmosDB components

Procedure

  1. Double-click tCosmosDBConnection_1 to open its Basic settings view and enter all the information that is needed to establish the CosmosDB connection.
  2. Double-click tFixedFlowInput_1 to open its Basic settings view and do the following.
    1. Click [...] next to Edit schema and add these columns to the schema: _id, type String; name, type String; address, type String; age, type Integer; and birth, type Date and date pattern "yyyy-MM-dd".
    2. Select Use Inline Table and enter the following in the Inline Table field.
      "101" "name1" "beijing" 21 2017-01-11
      "102" "name2" "shanghai" 22 2017-01-12
    3. Leave other options as they are.
    This component defines the record fields and defines two records for the scenario.
  3. Double-click tCosmosDBOutput_1 to open its Basic settings view and do the following.
    1. Select Use existing connection and select tCosmosDBConnection_1 from the Component List drop-down list.
    2. Enter the name of the collection (TDI44990_1 in this scenario) to write the records in in the Collection field.
    3. Select Insert from the Action on data drop-down list.
    4. Click the Sync columns button to make sure the schema of this component has the same columns as those of the tFixedFlowInput component.
      Check that the Mapping table has the same columns as those of the tFixedFlowInput component.
    5. Leave other options as they are.
    This component inserts the records to the collection named TDI44990_1.
  4. Double-click tCosmosDBInput_2 to open its Basic settings view and do the following.
    1. Select Use existing connection and select tCosmosDBConnection_1 from the Connection drop-down list.
    2. Enter the name of the collection (TDI44990_1 in this scenario) to retrieve the records from in the Collection field.
    3. Click [...] next to Edit schema to open the schema editor and add a column with the column name of doc, DB Column of *, and Type of String.
    4. Enter "{name:/^name1/}" in the Query field.
    5. Leave other options as they are.
    This component retrieves the record with the name field being name1 as a string from the TDI44990_1 collection.
  5. Double-click tLogRow_4 to open its Basic settings view and do the following.
    1. Click the Sync column button and then check that the component has the same column in the schema as that of the tCosmosDBInput_2 component.
    2. Select the Table (print values in cells of a table) option.
    Note: All the tLogRow components in this scenario take the same configuration.
  6. Double-click tCosmosDBOutput_2 to open its Basic settings view and do the following.
    1. Select Use existing connection and select tCosmosDBConnection_1 from the Connection drop-down list.
    2. Enter the name of the collection (TDI44990_2 in this scenario) to write the records in in the Collection field.
    3. Select Insert from the Action on data drop-down list.
    4. Click the Sync columns button to make sure the schema of this component has the same columns as those of the tLogRow_4 component.
      Check that the Mapping table has the same columns as that of the tLogRow_4 component.
    5. Leave other options as they are.
    This component inserts the record retrieved by the tCosmosDBInput_2 component to the collection named TDI44990_2. Because the schema of this component has only one column named doc and the DB Column and Type of the column are * and String, this component writes the record to the collection as a string using a dynamic schema.
  7. Double-click tCosmosDBInput_3 to open its Basic settings view and do the following.
    1. Select Use existing connection and select tCosmosDBConnection_1 from the Connection drop-down list.
    2. Enter the name of the collection (TDI44990_1 in this scenario) to retrieve the records from in the Collection field.
    3. Click [...] next to Edit schema to open the schema editor and add a column with the column name of doc, DB Column of *, and Type of Object.
    4. Enter "{name:/^name2/}" in the Query field.
    5. Leave other options as they are.
    This component retrieves the record with the name field being name2 as an object from the TDI44990_1 collection.
  8. Double-click tCosmosDBOutput_3 to open its Basic settings view and do the following.
    1. Select Use existing connection and select tCosmosDBConnection_1 from the Connection drop-down list.
    2. Enter the name of the collection (TDI44990_2 in this scenario) to write the records in in the Collection field.
    3. Select Insert from the Action on data drop-down list.
    4. Click the Sync columns button to make sure the schema of this component has the same column as that of the tLogRow_5 component.
      Check that the Mapping table has the same columns as that of the tLogRow_5 component.
    5. Leave other options as they are.
    This component inserts the record retrieved by the tCosmosDBInput_3 component to the collection named TDI44990_2. Because the schema of this component has only one column named doc and the DB Column and Type of the column are * and Object, this component writes the record to the collection as an object using a dynamic schema.
  9. Double-click tCosmosDBInput_4 to open its Basic settings view and do the following.
    1. Select Use existing connection and select tCosmosDBConnection_1 from the Connection drop-down list.
    2. Enter the name of the collection (TDI44990_2 in this scenario) to retrieve the records from in the Collection field.
    3. Click [...] next to Edit schema and add these columns to the schema: _id, type String; name, type String; address, type String, age, type Integer, and birth, type Date and date pattern "yyyy-MM-dd".
    4. Enter "{}" in the Query field.
      A string of "{}" queries all the records in the collection.
    5. Leave other options as they are.
    This component verifies the data written by tCosmosDBOutput_2 and tCosmosDBOutput_3 by retrieving and outputting all the records in the collection named TDI44990_2.