Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

tMap Join problems

Hi,
Am very new to TOS and hope you have an answer to my question. I am trying to do a JOIN in tMap using 2 table schema's (both tPostgresqlInput components). I am getting the following error:
Exception in component tMap_1
java.lang.NullPointerException
at advice_now.tranformlinklibrary.TranformLinkLibrary.tPostgresqlInput_1Process(TranformLinkLibrary.java:468)
at advice_now.tranformlinklibrary.TranformLinkLibrary.runJob(TranformLinkLibrary.java:1567)
at advice_now.tranformlinklibrary.TranformLinkLibrary.main(TranformLinkLibrary.java:1500)
An example of my generated Java code is below and the error is referring to this line:
tHash_Lookup_row2.get(row2HashKey);

				java.util.List<row2Struct> listFromLookup_row2 = null;
row2Struct row2ObjectFromLookup = null;
if (!rejectedInnerJoin_tMap_1) { // G 20
row2HashKey.hashCodeDirty = true;
tHash_Lookup_row2.get(row2HashKey);
if (tHash_Lookup_row2.hasResult()) { // G 90
if (tHash_Lookup_row2.resultIsObject()) { // G 49
row2ObjectFromLookup = (row2Struct) tHash_Lookup_row2
.getResultObject();
sizeResultsFromLookup_row2 = row2ObjectFromLookup != null ? 1
: -1;
} else { // G 49
listFromLookup_row2 = (java.util.List<row2Struct>) tHash_Lookup_row2
.getResultList();
sizeResultsFromLookup_row2 = listFromLookup_row2 != null ? listFromLookup_row2
.size()
: -1;
}
} // G 90
else { // G 91
rejectedInnerJoin_tMap_1 = true;
forceLooprow2 = true;
} // G 91
} // G 20
else { // G 21
forceLooprow2 = true;
} // G 21

Does anyone know what is happening here? Your help would be much appreciated.
Regards,
Harin
Labels (3)
7 Replies
Anonymous
Not applicable

Hi
Which version of TOS did you use?
Can you upload some screenshots of your job and tMap?
Best regards

shong
Anonymous
Not applicable

Hi,
I have uploaded images below of the following:
1. Job
2. tMap
3. library(input) properties
4. libraryData(input) properties
5 output properties
Regards,
Harin
Also i am using version:
Version: 2.2.4
Build id: r7943-20080107-1407
amaumont
Contributor III
Contributor III

I can't reproduce your error, I used same type of inputs and outputs, set same lookup configuration with ALL MATCHES mode and INNER JOIN lookup.
Can you post your entirely code job ?
Thank you.
Anonymous
Not applicable

Job code below. Sorry code tags didnt work for this for some reason.

// ============================================================================
//
// Copyright (c) 2005-2007, Talend Inc.
//
// This source code has been automatically generated by Talend Open Studio
// / JobDesigner (CodeGenerator version 2.2.4.r7943).
// You can find more information about Talend products at www.talend.com.
// You may distribute this code under the terms of the GNU LGPL license
// ( http://www.gnu.org/licenses/lgpl.html).
//
// ============================================================================
package advice_now.tranformlinklibrary;
import routines.DataOperation;
import routines.Mathematical;
import routines.Numeric; import routines.Relational; import routines.StringHandling;

To see the whole post, download it here
OriginalPost.pdf
amaumont
Contributor III
Contributor III

I think I found the origin of error, it seems you have a filter set in your lookup such as :
row1.library_type == 3

The problem is that "library_type" is an Integer object type and the value 3 is a primitive value.
When java compare library_type and 3 when library_type is null, java throws a NullPointerException.
To get round this problem you can use one of these syntaxes:
row1.library_type != null && row1.library_type == 3

or
new Integer(3).equals(row1.library_type)

I hope this is the solution, I didn't see other explanation to the problem.
Anonymous
Not applicable

Thank you very much amaumont, that was the issue that was causing it to fail. Very impressed with this software so far....its making my life a great deal easier!
amaumont
Contributor III
Contributor III

Good news !
this is a common problem encountered with Java and its Autoboxing mode (automatic conversion between primitive and Object).