Hello Du,

Can you check if there is a dir "metastore" in the place you launching your
program. If so, can you delete it and try again?

Also, can you try HiveContext? LocalHiveContext is deprecated.

Thanks,

Yin


On Mon, Aug 25, 2014 at 6:33 PM, Du Li <l...@yahoo-inc.com.invalid> wrote:

>  Hi,
>
>  I created an instance of LocalHiveContext and attempted to create a
> database. However, it failed with message
> "org.apache.spark.sql.execution.QueryExecutionException: FAILED: Execution
> Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
> java.lang.RuntimeException: Unable to instantiate
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient”.
>
>  My code is as follows. Similar code worked on spark-shell and also
> bin/run-example org.apache.spark.examples.sql.hive.HiveFromSpark.
>
>  import org.apache.spark.{SparkContext, SparkConf}
> import org.apache.spark.SparkContext._
> import org.apache.spark.sql.hive.LocalHiveContext
>
>  val conf = new SparkConf(false).setMaster("local").setAppName("test data
> exchange with Hive")
> conf.set("spark.driver.host", "localhost")
> val sc = new SparkContext(conf)
>  val hc = new LocalHiveContext(sc)
> hc.hql(“create database if not exists testdb")
>
>  The exception was thrown out of the hql call. Did I miss any
> configuration?
>
>  Thanks,
> Du
>

Reply via email to