Install Hpl/sql under Linux

Source: Internet
Author: User

Environmental requirements:
Java version 1.6 and above
Hadoop 1.x or 2.x version

This example environment information:
Linux Version:centos Release 6.8 (Final)
Hadoop VERSION:HDP 2.4.0.0-169
Java version:jre-1.8.0-openjdk.x86_64

Download Hpl/sql installation package
: Http://www.hplsql.org/download
Upload to Linux platform when download is complete
Unzip the installation package and install to/OPT:
TAR-ZVXF hplsql-0.3.31.tar.gz-c/opt
Ln-s/opt/hplsql-0.3.31/opt/hplsql

Include the following files after decompression
? Hplsql
? Hplsql.cmd
? Hplsql-x.x.x.jar
? Hplsql-site.xml
? Antlr-runtime-4.5.jar

Modify Permissions:
Chmod +x/opt/hplsql

Configure Classpath
Cd/opt/hplsql
Vi Hplsql

If Hadoop is the CDH
Delete all the export "hadoop_classpath= ..." in the Hplsql file
Add Export "hadoop_classpath=/opt/cloudera/parcels/cdh/jars/*"

If Hadoop is the HDP
Check the/usr/hdp/x.x.x.x-x directory and modify all the export "hadoop_classpath= ..." Paths in the Hplsql file to the/usr/hdp/x.x.x.x-x corresponding path.

For other versions of Hadoop, check the/usr/lib for Hadoop jars and make the corresponding changes in the Phlsql file.

Test whether the installation was successful
/opt/hplsql–version

Cd/opt/hplsql
./hplsql–version

If the above command can return Hplsql version information, the installation is successful.

Add Hplsql to PATH variable
Export path= $PATH:/opt/hplsql

After you set the path, you can call Hpl/sql directly from the Hplsql command.
Hplsql <option>

Configuration
Cd/opt/hplsql
Vi Hplsql-site.xml
Modify
<property>
<name>hplsql.conn.init.hive2conn</name>
<value></value>
</property>

For:
<property>
<name>hplsql.conn.init.hive2conn</name>
<value>
Set Mapred.job.queue.name=dev;
Set HIVE.EXECUTION.ENGINE=MR;
Use sales_db;
</value>
</property>

Run Hpl/sql
Hplsql-e "Current_date+1"
HPLSQL-E "SELECT * from src LIMIT 1"
Hplsql-f Script.SQL

Using Hpl/sql in shell scripts
Get a value from the Hpl/sql script
mdate=$ (hplsql-e "NVL (min_partition_date (sales,local_dt,code= ' A '), ' 1970-01-01 ')")
start=$ (HPLSQL-E ' current_date–1 ')

Install Hpl/sql under Linux

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.