hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AnilKumar B <>
Subject hive plan generation
Date Fri, 11 Jul 2014 16:25:14 GMT

I am trying to generate hive plan as below. But  even after creating the
"src" table, I am facing, Table not found Exception due to MetaStore issue.
Can any one help me in resolving this?

private Driver createDriver() {
HiveConf conf = new HiveConf(Driver.class);
conf.set("hive.metastore.warehouse.dir", "file:///tmp/warehouse");
Driver driver = new Driver(conf);
return driver;

    Driver driver = createDriver();
driver.compile("create table src (c1 string, c2 string)");
int rc = driver.compile("EXPLAIN LOGICAL SELECT key, count(1) FROM (SELECT
key, value FROM src) subq1 GROUP BY key");

if (rc != 0) {

QueryPlan plan = driver.getPlan();
org.apache.hadoop.hive.ql.exec.Task<? extends Serializable> task = plan
ExplainWork work = (ExplainWork) task.getWork();

Thanks & Regards,
B Anil Kumar.

View raw message