Spark SQL supports most commonly used features of HiveQL. However, different HiveQL statements are executed in different manners:

1.

   DDL statements (e.g. |CREATE TABLE|, |DROP TABLE|, etc.) and
   commands (e.g. |SET <key> = <value>|, |ADD FILE|, |ADD JAR|, etc.)

   In most cases, Spark SQL simply delegates these statements to Hive,
   as they don’t need to issue any distributed jobs and don’t rely on
   the computation engine (Spark, MR, or Tez).

2.

   |SELECT| queries, |CREATE TABLE ... AS SELECT ...| statements and
   insertions

   These statements are executed using Spark as the execution engine.

The Hive classes packaged in the assembly jar are used to provide entry points to Hive features, for example:

1. HiveQL parser
2. Talking to Hive metastore to execute DDL statements
3. Accessing UDF/UDAF/UDTF

As for the differences between Hive on Spark and Spark SQL’s Hive support, please refer to this article by Reynold: https://databricks.com/blog/2014/07/01/shark-spark-sql-hive-on-spark-and-the-future-of-sql-on-spark.html

Cheng

On 3/14/15 10:53 AM, bit1...@163.com wrote:

Thanks Daoyuan.
What do you mean by running some native command, I never thought that hive will run without an computing engine like Hadoop MR or spark. Thanks.

------------------------------------------------------------------------
bit1...@163.com

    *From:* Wang, Daoyuan <mailto:daoyuan.w...@intel.com>
    *Date:* 2015-03-13 16:39
    *To:* bit1...@163.com <mailto:bit1...@163.com>; user
    <mailto:user@spark.apache.org>
    *Subject:* RE: Explanation on the Hive in the Spark assembly

    Hi bit1129,

    1, hive in spark assembly removed most dependencies of hive on
    Hadoop to avoid conflicts.

    2, this hive is used to run some native command, which does not
    rely on spark or mapreduce.

    Thanks,

    Daoyuan

    *From:*bit1...@163.com [mailto:bit1...@163.com]
    *Sent:* Friday, March 13, 2015 4:24 PM
    *To:* user
    *Subject:* Explanation on the Hive in the Spark assembly

    Hi, sparkers,

    I am kind of confused about hive in the spark assembly.  I think
    hive in the spark assembly is not the same thing as Hive On
    Spark(Hive On Spark,  is meant to run hive using spark execution
    engine).

    So, my question is:

    1. What is the difference between Hive in the spark assembly and
    Hive on Hadoop?

    2. Does Hive in the spark assembly use Spark execution engine or
    Hadoop MR engine?

    Thanks.

    ------------------------------------------------------------------------

    bit1...@163.com <mailto:bit1...@163.com>

Reply via email to