Skip to main content Skip to complementary content

Setting up subJob 2

Procedure

  1. Double-click tFixedFlowInput_1 to open its Basic settings view and do the following:
    1. Open the schema editor by clicking the [...] button next to Edit schema and add two columns in the schema editor: name, type String; gender, type String.
    2. Enter 5 in the Number of rows field.
    3. Select Use Inline Content(delimited file) and enter the following in the Content field.
      Jane;f
      John;m
      Marry;
    4. Leave the other options as they are.

    This component generates 15 records. Each of the record has two fields: name and gender (optional).

  2. Double-click tMap_1 to open its map editor and do the following:
    1. Add three rows in the out1 table with the Column of seq, lastname, and age; and Type of Integer, String, and Integer.
      You can add a row in the table by clicking the plus button under the table.
    2. Map the name column in the row1 section to the name column in the out1 section.
      You can map a column by dragging and dropping the source column in the row1 section to the Expression field of the target column in the out1 section.
    3. Map the gender column in the row1 section to the gender column in the out1 section.
    4. Enter Numeric.sequence("s1",0,1) in the Expression field of the seq column.
    5. Enter TalendDataGenerator.getLastName() in the Expression field of the lastname column.
    6. Enter Numeric.random(25,99) in the Expression field of the age column.
    7. Click OK to close map editor.

    This component receives name and gender information from the tFixedFlowInput_1 component and adds extra information for creating nodes in the Neo4jv4 database, including sequence number, lastname, and age.

  3. Double-click tNeo4jv4Output_1 to open its Basic settings view and do the following:
    1. Select the Use an existing connection option and select tNeo4jv4Connection_1 from the Component List drop-down list.
    2. Click the Sync column button to make sure the component has the same columns as the output of tMap_1.
    3. Select Send data as list and enter rows in the Data list name.
      This step specifies to treat the input data as a list and assign a name to the list (that is, rows), so that the list can be referenced.
    4. Enter the following clauses in the Query field.
      UNWIND $rows as row
      MERGE (p:Person:UpdateMe {id: row.seq} )
      SET p.name = row.name, p.lastName = row.lastname, p.age = row.age, p.gender = row.gender
    5. Leave the other options as they are.

    This component creates nodes and sets properties for the nodes using the data received. For more information about the UNWIND clause, see UNWIND; for more information about the MERGE clause, see MERGE.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!