Compiling Hive
- Download the Hive installation package.
1wget https://github.com/apache/hive/archive/rel/release-3.0.0.tar.gz - Decompress the installation package.
1 2
mv release-3.0.0.tar.gz hive-rel-release-3.0.0.tar.gz tar -zxf hive-rel-release-3.0.0.tar.gz
- Switch to the directory where the source package is decompressed.
1cd hive-rel-release-3.0.0
- Modify the pom.xml file.
- Open the file.
1vi pom.xml - Press i to enter the insert mode and add the Kunpeng Maven repository to the first line of the repositories tag.
1 2 3 4 5
<repository> <id>kunpengmaven</id> <name>kunpeng maven</name> <url>https://mirrors.huaweicloud.com/kunpeng/maven</url> </repository>
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Modify the jdbc/pom.xml file.
- Open the file.
1vi jdbc/pom.xml - Press i to enter the insert mode and add the Kunpeng Maven repository.
1 2 3 4 5 6 7
<repositories> <repository> <id>kunpengmaven</id> <name>kunpeng maven</name> <url>https://mirrors.huaweicloud.com/kunpeng/maven</url> </repository> </repositories>
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Modify the druid-handler/pom.xml file.
- Open the file.
1vi druid-handler/pom.xml - Press i to enter the insert mode and add the Kunpeng Maven repository.
1 2 3 4 5 6 7
<repositories> <repository> <id>kunpengmaven</id> <name>kunpeng maven</name> <url>https://mirrors.huaweicloud.com/kunpeng/maven</url> </repository> </repositories>
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Optional: Configure the local repository path of Protobuf.
- Run the following command to check the Protobuf location:
which protoc
The path is displayed in the command output.
/usr/local/bin/protoc
- Run the mvn install:install-file command to add Protobuf to the local repository.
mvn install:install-file\ -Dgroupld=com.google.protobuf\ -Dartifactld=protoc\ -Dversion=2.5.0\ -Dclassifier=linux-aarch_64\ -Dpackaging=exe\ -Dfile=/usr/local/bin/protoc
- Run the following command to check the Protobuf location:
- Perform the compilation.
1mvn clean install -Pdist -DskipTests
After the compilation is successful, the tar.gz package for Hive is generated in the packaging/target directory of the source code.
- Use the Kunpeng Porting Advisor to scan the TAR package generated after the compilation and ensure that the TAR package does not contain .so files or JAR packages of the x86 architecture.
- The compiled Hive package must be scanned by using the Kunpeng Porting Advisor to ensure that no .so files or JAR packages of the x86 architecture are contained. If the compiled package contains x86 SO or JAR packages, the component functions may be affected.
- For details about how to use the Kunpeng Porting Advisor, see Kunpeng Porting Advisor Case Study.
Parent topic: Porting Guide (CentOS & openEuler)