Return results from HIVE query (not select statements)

Four Stars 122
Four Stars

Return results from HIVE query (not select statements)

Hello,

 

I'm using the tHiveRow component to execute a simple HIVE query to show the list of tables within a HIVE database. How would I return the query result that I would normally be able to see in the HIVE CLI so I can use it with other component.

 

Thanks

Moderator

Re: Return results from HIVE query (not select statements)

Hello,

When you use tHiveRow or t<DB>Row, you'd better create job as follows.

tHiveRow-->tParseRecordSet-->tLogRow

Add a column in tHiveRow and select "Object" data type.
Check Advanced settings-> "Propagate QUERY's recordset" and select the object column.
Retrieve state and name in tParseRecordSet(Set "state" and "name" in Value).

Let us know if it works for you.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Return results from HIVE query (not select statements)

@xdshi

I am working on a similar problem. And i didnt understand, the below line

Retrieve state and name in tParseRecordSet(Set "state" and "name" in Value).

 

Could you please explain (or) give an example on how to set the values in tParseRecordSet. 

 

So, I added a new component "tParseRecordSet" and choose "final_query" (i.e. this is the column, which has has a list of list of queries, i.e. which was an output from tJavaRow) for Prev.Comp.Column List drop-down.

 

And under Attribute table, i added as below..

 

Column: col_1

Value : "col_1_value"

 

And i see error as below.. 

Exception in component tParseRecordSet_1

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

 

Could you please let me know, how to fix this. 

Six Stars

Re: Return results from HIVE query (not select statements)

@xdshi

Please let me know