The Fields Tab

The Fields tab allows you to designate fields to be returned and put into the output of your dataflow. If you are building a custom script, you may add, modify, or remove fields. If you are using the query builder the fields are populated for you, but you can change the name and properties of the entities and relationships that were auto-populated.
  1. Create your query on the Query tab.
    Note: This step can be completed before or after the Fields tab is complete.
  2. Click the Fields tab.
  3. Click Add to open the Add Input Field dialog box.
  4. Use the Fields drop-down and the Add button to select the fields you want to query in the model. The fields available for selection depend on the fields assigned in the dataflow's input stage. Spectrum supports both simple and complex data types; you can use fields deep within the hierarchical structure of your input file in your query.
  5. Click Close when you're done adding input fields.
  6. Click Add to open the Add Output Field dialog box.
  7. Select the type of output field you want to add from the Type drop-down box. The following data types are supported:
    Data Type Description
    boolean A logical type with two values: true and false.
    double

    A numeric data type that contains both negative and positive double precision numbers between 2-1074 and (2-2-52)×21023. In E notation, the range of values is 4.9E-324 to 1.7976931348623157E308. For information on E notation, see:

    http://en.wikipedia.org/wiki/Scientific_notation#E_notation

    relationships
    The links between entities; the factor they share with other entities. If you choose this type of output field, you can change field names and determine which relationships to include upon output. You will need to include in your Gremlin script a command to retrieve a list of relationships and assign them to that data type, as shown in this example:
    data["Variants"]=g.idx('entities')[['Name':name]].bothE
    Note: If you create an output field this way, Query Hub will auto-populate the schema for you.
    float

    A numeric data type that contains both negative and positive single precision numbers between 2-149 and (2-223)×2127. In E notation, the range of values is 1.4E-45 to 3.4028235E38. For information on E notation, see:

    http://en.wikipedia.org/wiki/Scientific_notation#E_notation

    integer A numeric data type that contains both negative and positive whole numbers between -231 (-2,147,483,648) and 231-1 (2,147,483,647).
    long A numeric data type that contains both negative and positive whole numbers between -263 (-9,223,372,036,854,775,808) and 263-1 (9,223,372,036,854,775,807)
    entities
    The individual entities that have the relationships you are identifying. If you choose this type of output field, you can change field names and determine which entities to include upon output. You will need to include in your Gremlin script a command to retrieve a list of entities (a.k.a. vertices) and assign them to that data type, as shown in this example:
    data["Variants"]=g.idx('entities')[['Name':name]].both
    Note: If you create an output field this way, Query Hub will auto-populate the schema for you.
    string A sequence of characters.
    You can also add a new, user-defined, custom data type if necessary. Among other types of data, a new type can be a list of any defined data type (though for string, double, integer, long, float, or Boolean types you would select that type from the drop-down options and click the List check box). You can also select an output field based on entities and relationships in your model. If you create an output field this way, Query Hub will auto-populate the schema for you. Additionally, you would need to retrieve the entities and/or relationships from Gremlin and then iterate over them, creating a loop. This would result in you building up the fields' child rows and assigning data as you go.

  8. Specify a name for the output field you want to add in the Name field.
  9. Click the List check box if you created a custom data type in the form of a list.
  10. When you are done adding output fields, click Close.
  11. Click OK.