tMapROjaiOutput
Inserts, replaces or deletes documents in a MapR-DB database to be used as document
database, based on the incoming flow from the preceding component in the Job.
You must have properly installed and configured your MapR Client before using this component. A optmaprconfmapr-clusters.conf file is automatically generated out of the Client configuration process to store the connection information to your MapR cluster and your MapR-DB database. At runtime, this OJAI component reads this connection information by itself to connect to the MapR-DB database to be used.
For further information about how to install and configure your MapR client, see Setting up the Client from the MapR documentation.
tMapROjaiOutput Standard properties
These properties are used to configure tMapROjaiOutput running in the Standard Job framework.
The Standard
tMapROjaiOutput component belongs to the Databases NoSQL family.
The component in this framework is available in all Talend products with Big Data
and in Talend Data Fabric.
Basic settings
Distribution and Version |
Select the version of your MapR cluster. This cluster must host the MapR-DB database to be used. |
||||
Schema and Edit schema |
A schema is a row description. It defines the number of fields
Click Edit
schema to make changes to the schema. Note: If you
make changes, the schema automatically becomes built-in.
This component supports the Document type. If a field is for entire Click Sync |
||||
Use kerberos authentication |
If you are accessing a MapR-DB as-OJAI database Every time when you launch your Job, the
|
||||
Use a keytab to authenticate |
Select the Use a keytab to authenticate Note that the user that executes a keytab-enabled Job is not necessarily |
||||
Table |
Enter the name of the table to be processed. |
||||
Action on table |
Select an operation to be performed on the table defined.
|
||||
Action on data |
Select an action to be performed on data of the table defined.
|
||||
Bulk write |
Select this check box to insert, update or remove data in bulk. In the Bulk write size field, enter the size |
||||
Mapping |
Each column of the schema defined for this component represents a field of the documents For example, in the document reading as
follows
The first and the last fields have person as their parent node but the _id field does not have any parent node. So once completed, this Mapping table should read as follows:
|
||||
Die on error |
This check box is cleared by default, meaning to skip the row on error |
Advanced settings
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the Job level |
Global Variables
Global Variables |
ERROR_MESSAGE: the error message generated by the
NB_LINE: the number of rows read by an input component or
NB_LINE_REJECTED: the number of rows rejected. This is an A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
tMapROjaiOutput |
Writing candidate data in a MapR-DB OJAI database
This scenario applies only to Talend products with Big Data.
-
tFixedFlowInput: it provides the sample data to be written in the database.
-
tMapROjaiOutput: it writes the sample data to the database.
Reading the sample candidate data
- Ensure that the MapR client has been properly installed and configured in the machine in which the current Job runs.
- Drop tFixedFlowInput and tMapROjaiOutput onto the workspace.
- Connect tFixedFlowInput to tMapROjaiOutput using a Row > Main link and accept the propagation of the schema from tMapROjaiOutput.
-
Double-click tFixedFlowInput to open its Component view.
-
Click the […] button to open the schema editor.
- The _id column exists already because this
column was retrieved from tMapROjaiOutput in
the previous steps to provide the technical IDs of the documents to
be stored in a MapR Ojai database. This column is required by
tMapROjaiOutput. - Click the [+] button to add the other columns
and rename them to firstname,
lastname, sex,
married, age and
salary, respectively. The type of the
married column should be
Boolean, the type of the
age column Integer and
the salary column
Float.
- The _id column exists already because this
-
Click OK to close the schema editor and accept the
propagation of the schema. -
In the Mode area, select the Use Inline
table radio button to display the table in which you add the sample
data. -
Click the [+] button to add four rows and enter the
sample data as is displayed in the image above.This sample data is used for demonstration purposes only.
The data of the String type should be put in double
quotation marks and the data of the three other types should be put without any
quotation marks.
Writing the sample data to the MapR OJAI database
-
Double-click tMapROjaiOutput to open
its Component view. - In the Table field, enter the name of the table to be used in your MapR OJAI database.
-
From the DB Version list, select the
MapR OJAI database version you are using.At runtime, tMapROjaiOutput automatically reads the connection information to the database from the optmaprconfmapr-clusters.conf file of your MapR client.
In this example, the content of this file reads as follows:1mapr521 mapr521:7222 - From the Action on table drop-down list, select Drop table if exists and create and then from the Action on data drop-down list, select Insert.
-
In the Mapping table, the columns from the schema has
automatically appears in the Column column. In the
Parent field path column, enter
Name within double quotation marks in the
firstname row and the lastname row
and enter Status within double quotation marks in the
sex row, the married row and the
age row.This configuration groups the candidates’ first names and last names in the Name field and their sexes, marriage status and ages in the Status field in the outputted data flow.
- Press F6 to run the Job.