Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

More than one tneo4jrow in subjob

 

Hi!

I have a problem when I want to use two tneo4jRow in the same subjob. When I try to run this job, it gives me an error saying that "nbRelationshipDeleted_tNeo4jRow_2 cannot be resolved to a variable". So, my question is: Is it possible to do this?. I am using Talend for Big data 7 and Neo4j 3.2.x driver.

 

The reason I want to use two tneo4jRow is because I want to create different type of nodes (category, nominee, ceremony, etc...) in my graph database. The JSON file I receive is a list of nominees of each category of the Oscars award.

 

 

0683p000009M6hQ.pngMy subjob with two tneo4jrow

 

0683p000009M6ha.pngThe error I get when I run my project

 

 

0683p000009M2bd.pngThe error I get when I try to run the project

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Actually, I have a better solution. Take a look at the screenshot below. This layout will work....

 

0683p000009M6LP.png

View solution in original post

12 Replies
Anonymous
Not applicable
Author

These are compilation errors. Can you click on the "code" tab (bottom left of the design window) and when it opens look for red rectangles on the right of the window. Click on each of the red rectangles (if more than one) and take a screenshot of the code that is shown. This will show us the errors. This looks like the components are not configured correctly. We should be able to identify what is wrong from the generated code.

Anonymous
Not applicable
Author

This is the error in the code. If I change the order of the links, I get the same errors but with tneo4jrow_1.

0683p000009M6NW.pngError

 

Anonymous
Not applicable
Author

I'm making a few assumptions here, but I take it that there is no issue with tNeo4jRow_1? Can you show us a screenshot of the tNeo4jRow_2 configuration? 

 

Having two of the same component should not cause an issue. It is highly likely that this is simply a component config issue. 

Anonymous
Not applicable
Author

These are my configuration of tneo4jRow_1 and tneo4jRow_2. The query is just for testing, it is not important.

If I change the order of the links, I will have problems with tneo4jRow_1 like I described above.

0683p000009M6hf.png

 

0683p000009M6Kh.png

 

Anonymous
Not applicable
Author

You should have some code in your job's code that looks like this for both tNeo4jRow_1 and 2

 

long counter_tNeo4jRow_2 = 0;
long nbNodeInserted_tNeo4jRow_2 = 0;
long nbRelationshipInserted_tNeo4jRow_2 = 0;
long nbPropertiesUpdated_tNeo4jRow_2 = 0;
long nbNodeDeleted_tNeo4jRow_2 = 0;
long nbRelationshipDeleted_tNeo4jRow_2 = 0;

Your screenshot of your code makes it look like your variables are not being initialised.

The reason I asked to see your component config is to check that everything looked ok there. You can often get Java errors due to missing quotes and silly things like that. Your components look like they are configured OK. 

Sometimes (rarely these days) a job can become corrupt and you get weird issues like this. Have you tried recreating a new job?

Anonymous
Not applicable
Author

I have declared those variables. The code is generated automatically. I didn't modified it.

Is it possible to do what I want to do with the tneo4jRow? if so, is there any talend + neo4j tutorial?

 

0683p000009M6Ux.png

 

Anonymous
Not applicable
Author

Unfortunately it is really difficult to identify an issue like this without actually having access to the job. What you are seeing are compilation issues. This *could* be a bug you have found, but I cannot identify this without having access to the job. Would it be possible for you to export your job into a zip file and post it here so that I can take a look on my Studio?

Anonymous
Not applicable
Author

I really think that is it a bug. If so, How can I do what I want to do? Is there another way to do it in Talend?

I attach my project so you can try it in your Studio.


TALENDTESTPROJECT.zip
Anonymous
Not applicable
Author

Thanks @matias. I had to download a new Studio to test this, so it took some time. I believe you may have found a bug. I have raised this. However this doesn't solve your problem.

 

I'm afraid that the only way I can think to potentially solve this is to use Child Jobs. Create a job which simply uses the tNeo4jRow component to do what you are doing with each of your tNeo4jRow components. Then use that Child Job (using a tRunJob component) to run that code in isolation. Essentially your job layout would be two tRunJob components after your tMap. Your tRunJob components would trigger jobs which simply run your tNeo4jRow components.

 

I know this is a pain, but it appears that something weird occurs with the code generated when using more than 1 tNeo4jRow components. This has been raised as a bug.