Vidhi Rathore
Vidhi Rathore

Reputation: 75

How can I run Hive Explain command from java code?

I want to run Hive and Impala Explain and compute stats command from java code. So that I can use the collected information for my analysis purpose. If any one have any idea please help

Upvotes: 1

Views: 272

Answers (1)

techuser soma
techuser soma

Reputation: 4877

You can run it as any other jdbc query against impala.

The compute stats query for a table called temp would be "compute stats temp" and you can pass this as an argument for the jdbc statement.execute

Similarly, to explain a query, say "select count( * ) from temp" the query to pass as an argument for statement.execute is "explain select count(*) from temp".

Upvotes: 2

Related Questions