Skip to main content
Pentaho Documentation

Annotate Stream (step)

Overview

The Annotation Stream step helps you refine your data table for the Streamlined Data Refinery by creating measures, link dimensions, or attributes on column(s) that you specify. 

The Annotation Stream step helps you refine your data for the Streamlined Data Refinery by creating measures, link dimensions, or attributes on column(s) that you specify. 

If you want, you can create multiple annotations on the same field; for example, you might want to create an average measure and a sum measure on the same field. You can also create multiple Annotation Streams to modify the same data model.

The Annotate Stream modifies the default model produced from the Build Model job entry.

SDRBasicWorkflow.png

After you are done annotating your data model, you are ready to publish it.

Using the Annotate Stream Step

These sections describe the different ways that you can create annotations. The annotation type that you create determines which properties are shown in the dialog box to complete that annotation.  

AnnotateStreamIcon.png

  1. Locate the Annotate Stream step from the Design pane in PDI.
  2. Drag and drop the Annotate Stream icon onto the transformation canvas.
    You can also double-click on icons in the Design pane to add them to the canvas.
  3. Double-click the Annotate Stream icon to open the dialog box.
    You can also double-click on icons in the Design pane to add them to the canvas.
  4. Fill out the information in the dialog box:
    1. Step Name - type a name for your entry in this field.
    2. Local or Shared - choose if you want to save your step locally or share it.
    3. Select Fields - click this button to select from a list of available fields for annotation.
    4. Model Action - select an annotation type: Create Measure, Create Attribute, or Create Link Dimension.
  5. Click OK to continue or Cancel to close the dialog box.
  6. If you make a change to an annotation, click Apply to save them or Cancel to close the dialog box.

This is an example of the Annotate Stream dialog box, along with a table that has more details about each field.

AnnotateStreamStep.png

Options Description
Step Name Displays the name of the step.
Local Choose Local if you want to save the annotations locally into the transformation.
Shared Choose Shared to select, create, or rename a shared group for use by PDI users.
Description Use this space to enter a description for local annotations or shared group.
Annotations Displays a list of fields and annotations.
-Edit Use to edit a field that you have highlighted from the Field list.
-Delete Use to delete a field that you have highlighted from the Field list.
-Field Lists the names of the fields selected for annotation.
-Model Action Specifies which model action is being taken: Create Measure, Create Attribute, Link Dimension.
-Summary Displays a summary of that specific annotation.
Select Fields Displays a list of fields to be be annotated or linked to a shared dimension.
Apply Applies changes to the annotation.
Help Provides a link to the Help documentation.
OK Click OK to save.
Cancel Click Cancel to close the window.

Creating Annotation Groups

Annotation groups are useful when data sources, such as a weblog table, are reused in many transformations. Whenever this table is used, you can link to the shared annotation group to get model information on each table field.  If the table were to ever change, then the annotations would only need to be updated in one place.

You can create multiple annotations based on the same annotation group by copying the group, and then saving it with a different name. You can do this as many times as you need to make a series of related annotation groups, such as annotations for time dimensions.

You can either save the group locally, or you can share it in the metastore for use later in creating PDI jobs.

  1. Open PDI and create a new transformation.
  2. Drag and drop the Annotate Stream icon onto the transformation canvas.
  3. Open the Annotate Stream step by double-clicking the icon.

    AnnotationGroupExample.png

  4. Enter a name in the Step Name field.
  5. Select the Shared radio button, then click on the Add Annotation Group icon
  6. Enter a name for your annotation group and click Select Fields to begin creating annotations to populate the group.
  7. When you are done, click Apply.

There are two different options for saving your annotation group: locally or sharing it to the metastore for use by others.

Saving the Annotation Group Locally

If you want to keep your new annotation group only on your local machine, select the Local radio button and click Apply again.

If you later decide that you want to share the annotation group, you can re-open it and select the Shared radio button, then click Apply. The group will then be shared to the metastore and be available to other users.

Sharing the Annotation Group with Other Users

If you want to share your annotation group with other users, leave the Shared button selected, make sure that the new annotation group has a unique name, and click Apply. The group will then be available to other users for creating PDI jobs, by selecting from the Shared menu in the Annotate Stream step.

If you later decide that you don’t want to share the annotation group, you can re-open it and select Local, then click Apply. The group will be removed from the metastore and saved on your local machine for use.