The simple use of Spark learning spark-sql.sh

Source: Internet
Author: User

Start Hadoop and start Spark.

Build a simple test data customers.txt, for convenience, I put it in the Spark/bin directory:

John Smith, Austin, TX, 78727200, Joe Johnson, Dallas, TX, 75201300, Bob Jones, Houston, TX, 77028400, Andy Davis, Sa n Antonio, TX, 78227500, James Williams, Austin, TX, 78727

Start Spark-sql:

./spark-sql.sh

  

Map data into a database table:


Load data:

Load data local inpath './customers.txt ' overwrite into table Customer;

Query data:

SELECT * from Customer;

  

Finish!

The simple use of Spark learning spark-sql.sh

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.