Warning
This component will be available in the Palette of the studio on the condition that you have subscribed to
one of the Talend solutions with Big
Data.
Component family |
Big Data / Couchbase |
|
Function |
tCouchbaseInput allows you to |
|
Purpose |
This component allows you to query the documents from the |
|
Basic settings |
Schema and Edit |
A schema is a row description. It defines the number of fields to be processed and passed on Since version 5.6, both the Built-In mode and the Repository mode are Click Edit schema to make changes to the schema. If the
|
Use existing connection |
Select this check box and in the Component List click the |
|
|
DB Version |
List of database versions. |
|
Data Bucket |
Name of the data bucket in the Couchbase database. |
|
Username and Password |
Authentication credentials for a data bucket, instead of those for To enter the password, click the […] button next to the |
|
URIs |
URIs of server nodes in the Couchbase cluster, in the form of |
View |
Key (not in the Query by |
IDs of the documents stored in the Couchbase database, in the form |
Query by view |
Query by view |
Select this check box to view the document information according NoteWhen this check box is selected, the schema has three Where, Id holds the |
|
Design document |
Name of the design document in the Query by Note
|
Doc action |
Actions below are available: None: no action is taken on the Create: create the document Drop and Create: drop and then |
|
View |
Name of the view for extracting the document information. |
|
View action |
Actions below are available: Create: create the view specified |
|
Map |
Type in the code for the Map function. Available when Create is selected |
|
Reduce |
Type in the code for the Reduce function. Available when Create is selected |
|
Startkey |
Type in the startkey of a key range. |
|
Endkey |
Type in the endkey of a key range. |
|
Startkey docid |
Type in the start document ID of a docid range. |
|
Endkey docid |
Type in the end document ID of a docid range. |
|
Use complex key |
Select this check box to show the Complexkey field, where you can type in the complex Note that here the keys refer to the values of the key defined in |
|
Key (in the Query by |
The values of the key defined in the Map function. Not available when Use complex |
|
Include docs |
Select this check box to include the document specified by the Key Note that the JSONDoc field |
|
Inclusive end |
Select this check box to include the specified end key in the |
|
Descending |
Returns the documents in descending order, by key. |
|
Stale |
Allows the results from a Stale view to be used. false: forces a view update ok: allows stale views. update_after: allows stale view |
|
Limit |
Limits the number of the returned documents to the specified |
|
Skip |
Skips this number of records before starting to return the |
|
JSON Configuration |
Extract JSON field |
Select this check box to extract data from a JSON field. |
JSON field |
List of JSON fields for data extraction. |
|
|
Loop XPath query |
XPath query to specify the loop node of the JSON data. |
|
Mapping |
Schema output column: output
XPath Query: specifies the JSON
Get nodes: select this check box to |
Die on error |
This check box is cleared by default, meaning to skip the row on |
|
Advanced settings |
Debug |
Outputs the debug information. Available in the Query by view |
tStatCatcher Statistics |
Select this check box to collect the log data at the component |
|
Global Variables |
NB_LINE: the number of rows read by an input component or ERROR_MESSAGE: the error message generated by the 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 Talend Studio |
|
Usage |
As a start component, tCouchbaseInput reads the documents from the |
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|
Limitation |
n/a |
This scenario queries the JSON documents in the Couchbase database by unique document
IDs. Specifically, we use the document IDs as the key to query the documents, whose
contents are JSON data. The documents in the Couchbase database are shown below:
For how to write such documents to the database, see Scenario: Inserting documents to a data bucket in the Couchbase database.
-
Drop tCouchbaseConnection, tCouchbaseInput, tCouchbaseClose and tLogRow
onto the workspace. -
Link tCouchbaseConnection to tCouchbaseInput using the OnSubjobOk trigger.
-
Link tCouchbaseInput to tLogRow using a Row > Main
connection. -
Link tCouchbaseInput to tCouchbaseClose using the OnSubjobOk trigger.
-
Double-click tCouchbaseConnection to open
its Basic settings view. -
In the Data Bucket field, enter the name
of the data bucket in the Couchbase database. -
In the Password field, enter the password
for access to the data bucket. -
In the URIs table, click the [+] button to add lines as needed, where you can
enter the URIs of the Couchbase server nodes. -
Double-click tCouchbaseInput to open its
Basic settings view. -
Select the Use existing connection check
box to reuse the connection. -
In the Key field, enter the document IDs,
for example “ELT Overview”, “Integration at any
scale”. -
Click the Edit schema button to open the
schema editor. The schema contains two pre-defined fields, Key and Value. -
Double-click tLogRow to open its
Basic settings view. -
Select Table (print values in cells of a
table for a better display of the results.
This scenario queries the JSON documents through view queries. Specifically, we
combine the View queries and some other filters to retrieve the document information.
For the View part, we define the map function where the Key is specified as the
id field of the documents while the Value is
specified as the title and contents fields. The documents in the Couchbase database are shown
below:
For how to write such documents to the database, see Scenario: Inserting documents to a data bucket in the Couchbase database.
-
Drop tCouchbaseConnection, tCouchbaseInput, tCouchbaseClose and tLogRow
onto the workspace. -
Link tCouchbaseConnection to tCouchbaseInput using the OnSubjobOk trigger.
-
Link tCouchbaseInput to tLogRow using a Row > Main
connection. -
Link tCouchbaseInput to tCouchbaseClose using the OnSubjobOk trigger.
-
Double-click tCouchbaseConnection to open
its Basic settings view. -
In the Data Bucket field, enter the name
of the data bucket in the Couchbase database. -
In the Password field, enter the password
for access to the data bucket. -
In the URIs table, click the [+] button to add lines as needed, where you can
enter the URIs of the Couchbase server nodes. -
Double-click tCouchbaseInput to open its
Basic settings view. -
Select the Use existing connection check
box to reuse the connection. -
Select the Query by view check box to
define the View functions and other filters. -
In the Design document field, enter the
design document name of the View.In the Doc action list, select Drop create to remove an existing design document
and create it again.In the View field, enter the name of the
View.In the View action list, select Create to create the View.
-
In the Map box, enter Map
function:1"function (doc, meta) {emit(doc.id, [doc.title,doc.contents]);}"Where, the Key is
doc.id
, namely the id field of the JSON documents and the Value is
[doc.title,doc.contents]
, namely the title and contents fields of the JSON documents. -
Click the Edit schema button to open the
schema editor. The schema contains four pre-defined fields, Id, Key,
Value and jsonDoc.In this scenario, Id holds the document
ID, Key holds the id field of the JSON documents, Value holds the title and
contents fields of the JSON documents
and jsonDoc holds the entire JSON
documents. -
Select the Include docs check box to
retrieve the entire documents. -
Double-click tLogRow to open its
Basic settings view. -
Select Table (print values in cells of a
table for a better display of the results.