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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get MAX(ID) from tMysqlInput - job error

Hi all,

I am trying to get the maximum value of a column which contains INT values.

For that, I am using the following mysql query:

"SELECT COALESCE(MAX(id_partner),0) as id_partner FROM BI_DWH_dimension_partner"



When I launch the job, it raise an error NullPointerException.

You can check that error in the screenshot below.

I also added a screenshot of the table dimension_partner to show that there is data inside so I should'nt get any NullPointerException error.

Thank you for your advice.


0683p000009MH5x.png

0683p000009MH62.png

0683p000009MH67.png

0683p000009MH0e.png

0683p000009MH6C.png


0683p000009MH6H.png

Labels (2)
3 Replies
_AnonymousUser
Specialist III
Specialist III

Have you tried your Query directly against the database using mysql workbench or squirrel or whatever ??
if you look for the queries which are made by quess query, the all have `backticks` as they are always used in mysql.
But your query hasn´t  `backticks`
That might be the problem
HTH
DJ
Anonymous
Not applicable
Author

Hi djdeejay_offline,

Thank you for your reply.

I added the backticks but it didn't change anything.

0683p000009MH6M.png
Anonymous
Not applicable
Author

The NullPointerException appears if you are trying to assign a nullable number to a none-nullable number in the tMap.
I suggest you let the job run again and after take the last line before the Exception in the stack trace ->points to the line where the NullPointerException will be thrown and switch to the Code view. Now click right on the far left side and activate the line numbers.
With the line numbers in the code and the line number where the NullPointerException happens you will see the problem line.
I bet it is a assignment like
row2.partner_id.intValue() + 1


I suggest you do this instead:
(row2.partner_id != null ? row2.partner_id.intValue() + 1 : 1)

  The output flow NEW get the values from the inner join reject -> it is quit reasonable the partner_id can be null here.