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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to pass tJavaRow output (i.e.sql queries) as a batch to tHiveInput or tHiveRow

Hi, 

 

I have a job design as below. 

 

tFileInputDelimited -> tFlowtoIterate -> tJavaFlex ->(Iterate) tFileInputDelimited -> tJavaRow 

I am preparing the SQL queries dynamically from a file using the above flow and the till here the flow is working fine. Now, I want to pass the output from tJavaRow as batch(i.e. all the list of queries) to tHiveInput or tHiveRow. 

 

I tried.. 

..-> tJavaRow -> tForEach -> (OnComponentOk) -> tHiveConnection -> tHiveRow. 

The above flow is not working for me. I am sure, I am doing something wrong here. Please correct or suggest how to proceed further. 

Labels (3)
21 Replies
fdenis
Master
Master

did you success on your task?
Anonymous
Not applicable
Author

@fdenis

Sorry for the delay in reply. Partially Yes. I was able to pass params from tJavaRow to tHiveRow. Use below syntax..

 

(String)globalMap.get("row4.name")

Passing-a-value-from-a-parent-Job-to-a-child-Job

 

I am trying to send them as a batch (i.e. multiple queries at once). I am working on these and will reply soon. We can close the thread once that is working fine.

 

 

Anonymous
Not applicable
Author

I am able to send a list of queries to tHiveInput. But, as i see the resultset in the tLogRow. tHiveInput returns only first column of the table. I am not seeing complete recordset/row. 

 

Is there any additional component should use (or) Should i use some other hivecomponent instead of tHiveInput ? 

fdenis
Master
Master

warning:
define your globalMap variable into tFlowToIterate then use this variables in THiveInput.
Anonymous
Not applicable
Author

Is it in the "Dynamic Settings" of tFlowtoIterate ? 

Like below.. ?

 

Name  & Code 

final_query   = ((String)globalMap.get("row4.final_query"))
fdenis
Master
Master

not in Dynamic Settings
on Basic setting uncheck use default and add:
key=final_query value=final_query
Anonymous
Not applicable
Author

@fdenis

I did the same as above and also added the value "final_query"  (with & without quotes) in the Query field of tHiveInput. I see an error while running.. 

 

Error Line: 2341
Detail Message: final_query cannot be resolved to a variable

fdenis
Master
Master

use:

(String)globalMap.get("final_query")
Anonymous
Not applicable
Author

@fdenis

This is working, but as i said in my ealier post. I am only getting data of first column in the Result Set but not the entire recordset. 

 

So, I added a new component "tParseRecordSet" and choose "final_query" for Prev.Comp.Column List drop-down.

 

And under Attribute table, i added as below..

 

Column: final_query

Value : "final_query"

 

And i see error as below.. 

Exception in component tParseRecordSet_1

java.lang.ClassCastException: java.lang.String cannot be cast to java.sql.ResultSet

 

The datatype of "final_query" column in tHiveInput is "Object" 

What is the data-type should i mention under tParseRecordSet to convert Object type to ResultSet ? (i.e. to display entire recordset)

 

Anonymous
Not applicable
Author

@fdenis

Please let me know