- In the Enterprise Designer Stages Palette, expand Primary StagesDeployed StagesContext Graph, and drag the Query Model stages to the canvas.
- Connect the input port to a stage that defines input fields.
- Right-click the Query Model stage and click Options.
- Create your query on the Query tab.
Note: This step can be completed before or after the Fields tab is complete.
- Click the Fields tab.
- Click Add to open the Add Input Field dialog box.
- 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 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.
- Click Close when you're done adding input fields.
- Click Add to open the Add Output Field dialog box.
- Select the type of output field you want to add from the Type
drop-down box.
For information about supported data types, see Output field data types (Query Model).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 Model will auto-populate the schema for you. This would result in you building up the fields' child rows and assigning data as you go.
- Specify a name for the output field you want to add in the Name field.
- Click the List check box if you created a custom data type in the form of a list.
- When you are done adding output fields, click Close.
- Click OK.