Spark-sql (Spark SQL CLI) client integrated hive

Source: Internet
Author: User

1. Install Hadoop cluster
Reference: http://www.cnblogs.com/wcwen1990/p/6739151.html

2. Installing hive
Reference: http://www.cnblogs.com/wcwen1990/p/6757240.html

3. Installation configuration Spark
Compiling spark:http://www.cnblogs.com/wcwen1990/p/7688027.html
Deployment reference: Http://www.cnblogs.com/wcwen1990/p/6889521.html

4. Spark-sql Integrated Hive

Copy the Hdfs-site.xml, hive-site.xml configuration file to the Spark conf/directory:

$ cp/opt/cdh-5.3.6/hive-0.13.1-cdh5.3.6/conf/hive-site.xml.
$ cp/opt/cdh-5.3.6/hadoop-2.5.0-cdh5.3.6/etc/hadoop/hdfs-site.xml.

5. Start Spark-sql

$ bin/spark-sql--master local[2]

After launch, the hive database can be accessed interactively by the shell client hql.

6. Test:

Spark-sql (default) > show databases;
... ...
Result
Chavin
Default
... ...

Spark-sql (default) > select * from Chavin.dept;
... ...
Deptno Dname Loc
Ten ACCOUNTING NEW YORK
DALLAS
SALES CHICAGO
OPERATIONS BOSTON
Time taken:0.378 seconds, fetched 4 row (s)
... ...

Spark-sql (Spark SQL CLI) client integrated hive

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.