title: executing Hive queries from Spark
body: <p>I'm trying to execute this code in spark-shell:</p>
  
  <pre><code>val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
  sqlContext.sql("show tables")
  </code></pre>
  
  <p>After executing the second line, I'm getting an exception:</p>
  
  <blockquote>
    <p>java.lang.NoSuchMethodError:
    org.apache.hadoop.hive.ql.Driver.getResults(Ljava/util/ArrayList;)Z
            at org.apache.spark.sql.hive.HiveContext.runHive(HiveContext.scala:305)
            at org.apache.spark.sql.hive.HiveContext.runSqlHive(HiveContext.scala:272)
            at org.apache.spark.sql.hive.execution.NativeCommand.sideEffectResult$lzycompute(NativeCommand.scala:35)
            at org.apache.spark.sql.hive.execution.NativeCommand.sideEffectResult(NativeCommand.scala:35)
            at org.apache.spark.sql.hive.execution.NativeCommand.execute(NativeCommand.scala:38)
            at org.apache.spark.sql.hive.HiveContext$QueryExecution.toRdd$lzycompute(HiveContext.scala:360)
            at org.apache.spark.sql.hive.HiveContext$QueryExecution.toRdd(HiveContext.scala:360)
            at org.apache.spark.sql.SchemaRDDLike$class.$init$(SchemaRDDLike.scala:58)
            at org.apache.spark.sql.SchemaRDD.(SchemaRDD.scala:103)
            at org.apache.spark.sql.hive.HiveContext.sql(HiveContext.scala:98)
            at $iwC$$iwC$$iwC$$iwC.(:14) ...</p>
  </blockquote>
  
  <p>Please, help me resolve this.</p>