Data Point To Schema Operator Sample

About The Sample

In this sample, the Spotfire Streaming Data Point To Schema Operator demonstrates converting name-value string fields to StreamBase tuples.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top-level menu, select File>Import Samples and Community Content.

  • Enter datap to narrow the list of options.

  • Select Convert Name Value String Fields from the Data Constructs and Operators category.

  • Click Import Now.

StreamBase Studio creates a single project containing the sample files.

Running The Data Point To Schema Operator Samples

Data Point To Schema

In this sample, the Spotfire Streaming Data Point To Schema is configured to convert input value name tuples to StreamBase named schema tuples. This sample has an example of a single data point as well as multiple data points per input tuple.

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

  2. Open the src/main/eventflow/packageName folder.

  3. Double-click to open the DataPoint.sbapp module. Make sure the module is the currently active tab in the EventFlow Editor.

  4. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

  5. In the Manual Input view, select the SingleValueIn Stream, then enter:

    • intValue into the name field.

    • 123 into the value field.

  6. Click Send Data to send the tuple.

  7. In the Manual Input view, select the MultiValueIn Stream. Next:

    • click the Plus button to add a new row to the names elements, then enter intValue into the new row.

    • click the Plus button to add a new row to the names elements, then enter doubleValue into the new row.

    • click the Plus button to add a new row to the values elements, then enter 123 into the new row.

    • click the Plus button to add a new row to the values elements, then enter 123.45 into the new row.

  8. In the Output Streams view, observe tuples emitted on the SingleValueOut and MultiValueOut output streams.

  9. Press F9 or click the Stop Running Application button.

Sample Location

When you load the sample into StreamBase® Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.

Important

Load this sample in StreamBase® Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.

Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:

studio-workspace/sample_datapointtoschema

See Default Installation Directories for the default location of studio-workspace on your system.