The Rubiscape process for analyzing data is - read the data, process it based on the algorithms selected, and display the result. In this process, Rubiscape stores your data only in the temporary cache. After the result is displayed, the resultant data is cleared, and you cannot access it later.
However, Rubiscape provides an option to save the resultant data to a file or a table. This is achieved using the Writer functionality of rubiscape. The data can be written to a table or a file and can be reused later. This table or file created is the target table dataset or the target file dataset.


Writing to Template File

You can store the result of algorithm flow or the Reader into a CSV dataset. You can use the TemplateFile node to create target file datasets within the application. These target files are stored in CSV format and can be reused as CSV dataset within the same workspace.

(info) Note:This function can be used in Workbook as well as Workflow. This description assumes the function is being used in Workbook. However, you can also use it in a Workflow.

To write the output data to a template file, follow the steps given below.

  1. Build your algorithm flow. Refer to Building Algorithm Flow in a Workbook Canvas.
  2. Run your algorithm flow. Refer to Running a Workbook.
  3. Use the drag-and-drop method to insert the TemplateFile node from the Task Pane into the canvas.
    Figure: TemplateFile Node under rubistudio
  4. Connect the node whose resultant data you want to write to a file to the TemplateFile node.
    Figure: TemplateFile Node Added to Canvas
    In the image above, the node Sorting is connected to the TemplateFile node. The result of Sorting will be written to TemplateFile.
  5. From the Properties pane, select the configuration settings for the TemplateFile.

    Figure: Properties of TemplateFile

    The table given below describes different fields in the properties of TemplateFile.

    Table: Description of Fields Present on Properties of TemplateFile

    Field

    Description

    Remark

    Task Name

    It displays the name of the selected task.

    You can click the text field to edit or modify the name of the task as required.

    OVERWRITE DATASET IF PRESENT

    It allows you to overwrite an existing file.

    APPEND DATASET IF PRESENT

    It allows you to append to the existing file.

    Select Delimiter

    It allows you to select the delimiter to use in the CSV file.

    The available options are -

    • Comma (,)
    • Pipe (|)
    • Tab
    • Space

    Dataset Name

    It allows you to enter the name for your template file.

    • If a file with the specified name already exists, the data is either overwritten or appended, based on the selection.
    • In the above example, the name is CarboFitness_SortedData.

    If a file with the specified name already exists, you can either overwrite it or append it.

  6. Select OVERWRITE DATASET IF PRESENT to overwrite the dataset
    OR
    Select APPEND DATASET IF PRESENT to append to the existing dataset.

    (info) Note:

    These options are not applicable if the file is being created newly.

  7. From the Select Delimiter drop-down, select the delimiter used in your source file.
  8. Enter the Dataset Name for the newly created dataset.
  9. To run the TemplateFile node, click the ellipsis on the TemplateFile node, and then click Run.
    After a successful run, the data is written to the file specified by Dataset Name. It is available to be used as a dataset under Reader in rubistudio.
    Figure: Newly Created Template File Under Reader
    You can make use of this newly created dataset to build your future algorithm flows.


Writing to Template Table

You can store the result of algorithm flow or the Reader to a dataset table.

(info) Note:You can write to an RDBMS or ODBC (SQL, MySQL, PostgreSQL, or Oracle) datasets only.

To write the output data to a template table, follow the steps given below.

  1. Build your algorithm flow. Refer to Building Algorithm Flow in a Workbook Canvas.
  2. Run your algorithm flow. Refer to Running a Workbook.
  3. Use the drag-and-drop method to insert the TemplateTable node from the Task Pane into the canvas.
    Figure: TemplateTable Node
  4. Connect the source node (node whose data you want to write to a table) to the TemplateTable node.
    Figure: TemplateTable Node Added to Canvas

    In the image above, the node Sorting is connected to the TemplateTable node. The result of Sorting will be written to TemplateTable.

  5. From the Properties pane, select the configuration settings for the TemplateTable.

    Figure: Properties of TemplateTable

    The table given below describes different fields present in the properties of TemplateFile.

    Table: Properties of TemplateFile

    Field

    Description

    Remark

    Task Name

    It displays the name of the selected task.

    You can click the text field to edit or modify the name of the task as required.

    Drop and Create

    It allows you to determine whether to drop an existing table.

    If selected, the existing table schema is dropped, and a new table schema is created.

    Select Dataset

    It allows you to select the dataset in which you want to create the table.

    You can select RDBMS or  ODBC datasets that are available at the Workspace level.

    Table Name

    It allows you to enter the name of the table you want to create.

    If a table with the same name exists, then either data is added to it, or a new table is created.

    Select Strategy

    It allows you to select the operation you want to perform on the table.

    The available options are –

    • Insert – Insert data into the table.
    • Update – Update existing data.
    • Delete – Delete data from the table.

    Select Key Columns

    It allows you to select the primary key of the table.

    It is applicable only to Update and Delete operations, not applicable to Insert operation.

  6. If you want to create a new table, select the Drop and Create checkbox, else clear it.
  7. From the Select Dataset drop-down, select the name of the dataset in which you want to create the table.
  8. Enter Table Name. If a table by this name exists in the dataset, then based on the option selected in step 6, either data is added to the existing table, or a new table is created.
  9. From the Select Strategy drop-down, select the operation you want to perform. The options are – Insert, Update, and Delete.
  10. If you select Update or Delete option in step 9, select the primary key from the Select Key Columns drop-down.

    (info) Note:You can select more than one column if the combination of these columns forms a Primary Key at the table level.
  11. To run the TemplateTable node, click the ellipsis on the TemplateTable node, and then click Run.
    After a successful run, a table with Table Name is created (or updated, based on the operation selected by you) in the dataset specified by Dataset Name.

    (info) Notes:
    • If you created a new table in the database, you need to edit the dataset and add the newly created table to it so that the newly created table is added to the dataset.
    • Suppose you updated a table which was existing in the database but was not a part of the dataset. In that case, you need to add the edited table to the dataset so that the changes to the table are reflected in the dataset.
    • If you updated a table already included in the dataset, then the changes made to the table are automatically reflected in the dataset.




Table of Contents