Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Preparing Environment

Updated on 2024-12-19 GMT+08:00

Before interconnecting open source component Spark with LakeFormation, complete the following operations:

  1. Prepare an available open source Spark environment and Hive environment. Install the Git environment.

    Currently, only Spark 3.1.1 and Spark 3.3.1 are supported. The Hive kernel version is 2.3.

  2. Prepare a LakeFormation instance. For details, see Creating an Instance.
  3. Create a LakeFormation access client in the same VPC and subnet as Spark. For details, see Managing Clients.
  4. Prepare the development environment. For details, see the part "Preparing the Environment" inPreparing the Development Environment. You can choose whether to install and configure IntelliJ IDEA.
  5. Download the LakeFormation client.

    • Method 1: downloading the release version

      Download link: https://gitee.com/HuaweiCloudDeveloper/huaweicloud-lake-formation-lakecat-sdk-java/releases

      Download the corresponding client based on the Spark and Hive versions. For example, if the versions of Spark and Hive are 3.1.1 and 2.3.7, download lakeformation-lakecat-client-hive2.3-v1.0.0.rar.

      Verify the compressed package. After downloading the package, run the certutil -hashfile <Compressed package > sha256 command in the Windows environment to check whether the command output is consistent with the content of the corresponding sha256 file.

    • Method 2: compiling the client locally
      1. Obtain the client code.

        Download link: https://gitee.com/HuaweiCloudDeveloper/huaweicloud-lake-formation-lakecat-sdk-java

      2. Run the following command in Git to switch the branch to master_dev:

        git checkout master_dev

      3. Configure the Maven source. For details, see Obtaining the SDK and Configuring Maven.
      4. Obtain the following JAR package and corresponding POM file and save the file to the local Maven repository.
        For example, if the local repository directory is D:\maven\repository, save the file in the D:\maven\repository\com\huaweicloud\hadoop-huaweicloud\3.1.1-hw-53.8 path.
      5. Package and upload the client code.
      6. Go to the client project directory and run the following command to package the client code:
        mvn clean install -DskipTests=true -P"${SPARK_PROFILE}" -P"${HIVE_PROFILE}"
        • SPARK_PROFILE: Enter spark-3.1 or spark-3.3 based on the Spark version.
        • HIVE_PROFILE: Enter hive-2.3.
      7. After the packaging is complete, obtain the lakeformation-lakecat-client-1.0.0.jar package from the target directory of lakeformation-lakecat-client.

  6. Prepare and replace JAR packages required by the Hive kernel.

    NOTE:

    If only SparkCatalogPlugin is used for interconnection (MetastoreClient is not used), skip this step.

    • Method 1: downloading the JAR packages needed for Hive pre-building.

      Download link: https://gitee.com/HuaweiCloudDeveloper/huaweicloud-lake-formation-lakecat-sdk-java/releases

      Download the corresponding client based on the Spark and Hive versions. For example, if the versions of Spark and Hive are 3.1.1 and 2.3.7, download hive-exec-2.3.7-core.jar and hive-common-2.3.7.jar.

    • Method 2: modifying Hive-related JAR packages locally

      If the connected environment is Spark 3.1.1, use Hive 2.3.7. If the interconnected environment is Spark 3.3.1, use Hive 2.3.9.

      In Windows, you need to perform Maven operations in the WSL development environment.

      1. Download the Hive source code based on the Hive version.

        For example, if the Hive kernel version is 2.3.9, the download link is https://github.com/apache/hive/tree/rel/release-2.3.9.

      2. Apply the patch in the LakeFormation client code to the Hive source code.
        1. Switch the Hive source code branch as required. For example, if the Hive kernel version is 2.3.9, run the following command:

          git checkout rel/release-2.3.9

        2. Run the following command to apply the patch file to the Hive source code project after the branch is switched:

          mvn patch:apply -DpatchFile=${your patch file location}

          In the command, your patch file location indicates the storage path of the hive-2_3_for_lakeformation.patch file. The patch file can be obtained from the client project, as shown in the following figure.

        3. Run the following command to recompile the Hive kernel source code:

          mvn clean install -DskipTests=true

  7. Add the JAR packages required by the Spark environment.

    Obtain the JAR packages listed in the following table and supplement or replace them in the jars directory in Spark.

    Table 1 JAR packages required

    No.

    JAR Package

    How to Obtain

    1

    spring-web-5.3.24.jar

    https://repo1.maven.org/maven2/org/springframework/spring-web/5.3.24/spring-web-5.3.24.jar

    2

    spring-core-5.3.24.jar

    https://repo1.maven.org/maven2/org/springframework/spring-core/5.3.24/spring-core-5.3.24.jar

    3

    spring-context-5.3.24.jar

    https://repo1.maven.org/maven2/org/springframework/spring-context/5.3.24/spring-context-5.3.24.jar

    4

    spring-beans-5.3.24.jar

    https://repo1.maven.org/maven2/org/springframework/spring-beans/5.3.24/spring-beans-5.3.24.jar

    5

    caffeine-2.9.3.jar

    https://repo1.maven.org/maven2/com/github/ben-manes/caffeine/caffeine/2.9.3/caffeine-2.9.3.jar

    6

    mapstruct-1.5.3.Final.jar

    https://repo1.maven.org/maven2/org/mapstruct/mapstruct/1.5.3.Final/mapstruct-1.5.3.Final.jar

    7

    log4j-api-2.19.0.jar (not required for Spark 3.3)

    https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar

    8

    java-sdk-core-3.2.4.jar

    (If only Custom Authentication Information Obtaining Class is used for token authentication, this JAR package is not required.)

    Contact O&M personnel.

    9

    bcprov-jdk15to18-1.70.jar

    https://mirrors.huaweicloud.com/repository/maven/org/bouncycastle/bcprov-jdk15to18/1.70/bcprov-jdk15to18-1.70.jar

    10

    jca-1.0.4.jar

    https://repo1.maven.org/maven2/org/openeuler/jca/1.0.4/jca-1.0.4.jar

    11

    hadoop-huaweicloud-3.1.1-hw-53.8.jar

    https://github.com/huaweicloud/obsa-hdfs/blob/master/release/hadoop-huaweicloud-3.1.1-hw-53.8.jar

    12

    lakeformation-lakecat-client-1.0.0.jar

    Obtain the package by referring to the operation in 5.

    13

    hive-exec-${version}-core.jar

    Obtain the package by referring to the operation in 6.

    14

    hive-common-${version}.jar

    Obtain the package by referring to the operation in 6.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback