Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling Hive

  1. Download the Hive installation package.
    1
    wget https://github.com/apache/hive/archive/rel/release-3.0.0.tar.gz
    
  2. 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
    
  3. Switch to the directory where the source package is decompressed.
    1
    cd hive-rel-release-3.0.0
    
  4. Modify the pom.xml file.
    1. Open the file.
      1
      vi pom.xml
      
    2. 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>
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Modify the jdbc/pom.xml file.
    1. Open the file.
      1
      vi jdbc/pom.xml
      
    2. 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>
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Modify the druid-handler/pom.xml file.
    1. Open the file.
      1
      vi druid-handler/pom.xml
      
    2. 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>
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  7. Optional: Configure the local repository path of Protobuf.
    1. Run the following command to check the Protobuf location:
      which protoc 

      The path is displayed in the command output.

      /usr/local/bin/protoc
    2. 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
  8. Perform the compilation.
    1
    mvn 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.

  9. 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.