Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Sanjay5
Contributor III
Contributor III

tCouchbaseInput in Talend Bigdata 7.0.1

Hi, 

 

tCouchbaseInput component has predefined schema and data comes in the field "content" (See attached screenshot for the screenshot)

 

Does anyone have any idea on how to get into individual fields inside the "content".

 

My requirement is to perform some transformation on few of the fields of couchbase records.

I tried to put the content field using tFileOutputJSON component but it does not seem to create the correct JSON document.

Labels (3)
1 Solution

Accepted Solutions
Sanjay5
Contributor III
Contributor III
Author

Attached is the code routine to convert JSON String to Java Object.

It has two parts:

1. JSONData  - Define the JSON structure of your data.

2. JSONParser  - Fetch the data

 

Individual fields can be fetched using get methods in tMap (E.g.)

(JSONParser.convertJsonToJava(valid.content, JSONData.class)).getName() 


JSON String to Java Object.zip

View solution in original post

10 Replies
Anonymous
Not applicable

Hello,

You can create the jsonDoc manually by using the tWriteJSONField component.

Best regards

Sabrina

Sanjay5
Contributor III
Contributor III
Author

Hi Sabrina,

 

I believe tWriteJSONField works with the case where we have individual fields as input, However  tCouchbaseInput component does not fetch the fields from Couchbase Document, it gets entire JSON String. (See my original Screen Shot). Due to this reason i was not able to build JSON using tWriteJSONField.

 

Solution:

I have created a custom code routine using Jackson jar to parse the individual fields from JSON String.

 

Thanks,

Sanjay

Anonymous
Not applicable

Hello Sanjay,

Thanks for your feedback.

Would you mind sharing your custom code routine using Jackson jar with us? We will appreciate it.

Best regards

Sabrina

 

Sanjay5
Contributor III
Contributor III
Author

Attached is the code routine to convert JSON String to Java Object.

It has two parts:

1. JSONData  - Define the JSON structure of your data.

2. JSONParser  - Fetch the data

 

Individual fields can be fetched using get methods in tMap (E.g.)

(JSONParser.convertJsonToJava(valid.content, JSONData.class)).getName() 


JSON String to Java Object.zip
Anonymous
Not applicable

Hello,

Many thanks for your feedback and contribution to the Community!

Best regards

Sabrina

Anonymous
Not applicable

I am not able to connect to my couchbase 6.0 with tCouchbaseInput in Talend Bigdata 7.0.1.

Can you please show me how to configure the component with an example please. 

I would like to query and insert data in and from a couchbase.

Thank you

Sanjay5
Contributor III
Contributor III
Author

Please find the screenshot on how I setup the component in Talend 7.0.1

0683p000009M1wT.jpg

 

Anonymous
Not applicable

Hello @manon

 

Couchbase 6.0 is not list on the supported database table by talend component.

For more information, please refer to this online installation guide about:TalendHelpCenter: Supported Third-Party System/Database/Business Application Versions

Best regards

Sabrina

Anonymous
Not applicable

Hello @stamrake

Are you using couchbase 6.0 in talend bigdata v 7.0.1? What's the error message are you getting when connect to couchbase?

Here is online installation guide about:TalendHelpCenter: Supported systems, databases and business applications by Talend components

In the documentation we provide a list of databases that are supported, in the sense that we do provide an SLA and technical support for them. This doesn't mean other (non-listed) databases will not work but simply we won't necessarily be equipped to help you with any issue you may face with them.
Best regards

Sabrina