Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Data Transformation

Introduction

The examples package also contains a couple of services that demonstrate how you could transform data using Gloop. These services are stored under the dataTransformation package and are described in the following table:

Service Description
ArrayToSingleObject.gloop Maps an array to a single object.
SingleObjectToArray.gloop Maps a single object to an array.
FileToInputStream.gloop Converts a File to an InputStream.
StringToInputStream.gloop Converts a String to an InputStream.
StringToReader.gloop Converts a String to a Reader.
StringToBlob.gloop Converts a String to a BLOB.
StringToClob.gloop Converts a String to a CLOB.

Like their names imply, these services deal with the conversion of data from one format to another.

Due to the limitations in HSQL, the following services could only work with specific SQL sources:

  • StringToBlob.gloop
  • StringToClob.gloop

Related articles

Please see the following articles for more information:

Try It!

Under the Coder Navigator, expand the examples package entry and navigate to the code folder. Afterwards, look for the dataTransformation package. This package contains the files and/or directories shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
examples
├── ...
└── code
    └── ...
    └── dataTransformation
        ├── conf
        │   └── CreateSqlDatabase.gloop
        ├── sql
        │   ├── InsertBlob.gloop
        │   ├── InsertClob.gloop
        │   ├── SelectAllBlob.gloop
        │   ├── SelectBlob.gloop
        │   └── SelectClob.gloop
        ├── ArrayToSingleObject.gloop
        ├── DatabaseRecordToCSV.gloop
        ├── FileToInputStream.gloop
        ├── SingleObjectToArray.gloop
        ├── StringToBlob.gloop
        ├── StringToClob.gloop
        ├── StringToInputStream.gloop
        └── StringToReader.gloop

The primary services are located directly under the dataTransformation package. These are the services that you should open up or run to see data transformation examples.

Particularly for StringToBlob.gloop and StringToClob.gloop, you'll have to run CreateSqlDatabase.gloop first, found under dataTransformation.conf, to setup the required database and tables.

Meanwhile, the dataTransformation.sql package contains Gloop SQL services used by some of the example services.

How It Works...

Simple transformations can be done simply by creating map lines between properties using the Mapper View. However, for more complex tasks, a custom strategy might be needed; typically, this would involve method calls.