El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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

Configuring and Importing the JDBC/HCatalog Sample Project

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

Scenario

To run the JDBC API example codes of the Hive component of MRS, perform the following operations.

NOTE:
  • The following uses the development of an application for connecting the Hive service in JDBC/HCatalog mode on Windows as an example.
  • The HCatalog sample can run only on Linux nodes.

Procedure

  1. Obtain the sample project folder hive-jdbc-example or hcatalog-example in the src\hive-examples directory where the sample code is decompressed. For details, see Obtaining the MRS Application Development Sample Project.
  2. For the hive-jdbc-example sample project, place the following files in the hive-jdbc-example\src\main\resources directory:

  3. Go to the client decompression path FusionInsight_Cluster_1_Services_ClientConfig_ConfigFiles\Hive\config and manually import the core-site.xml and hiveclient.properties files to the hive-jdbc-example\src\main\resources directory of the sample project.
  4. Import the example project to the IntelliJ IDEA development environment.

    1. On the IntelliJ IDEA menu bar, choose File>Open.... The Open File or Project window is displayed.
    2. In the displayed window, select the folder hive-jdbc-example, and click OK. On Windows, the path cannot contain any space.

  5. Set the IntelliJ IDEA text file coding format to prevent garbled characters.

    1. On the IntelliJ IDEA menu bar, choose File>Settings.

      The Settings window is displayed.

    2. In the navigating tree on the left, choose Editor>File Encodings. In theProject Encoding area and Global Encodingarea, set the value toUTF-8, and clickApplyandOK, as shown inFigure 1.
    Figure 1 Setting the IntelliJ IDEA coding format

  6. Set the JDK of the project.

    1. On the IntelliJ IDEA menu bar, choose File>Settings.... The Settings window is displayed.
    2. Choose Build, Execution, Deployment > Compiler > Java Compiler, select 8 from the Project bytecode version drop-down list box. Change the value of Target bytecode version to 8 for hive-jdbc-example.

    3. ClickApplyandOK.
    4. On the IntelliJ IDEA menu bar, choose File>Project Structure.... The Project Structure window is displayed.
    5. Select SDKs, click the plus sign (+), and select JDK.

    6. On the Select Home Directory for JDK page that is displayed, select the JDK directory and click OK.
    7. After selecting the JDK, click Apply.
    8. Select Project, select the JDK added in SDKs from the Project SDK drop-down list box, and select 8 - Lambdas, type annotations etc. from the Project language level drop-down list box.

    9. ClickApply.
    10. Choose Modules. On the Source page, change the value of Language level to 8 - Lambdas, type annotations etc.

      On the Dependencies page, change the value of Module SDK to the JDK added in SDKs.

    11. ClickApplyandOK.

  7. Configure Maven.

    1. Add the configuration information such as the address of the open-source image repository to the setting.xml configuration file of the local Maven by referring to Configuring Huawei Open-Source Mirrors.
    2. On the IntelliJ IDEA page, select File > Settings > Build, Execution, Deployment > Build Tools > Maven, select Override next to User settings file, and change the value of User settings file to the directory where the settings.xml file is stored. Ensure that the directory is <Local Maven installation directory>\conf\settings.xml.
      Figure 2 Directory for storing the settings.xml file
    3. Click the drop-down list next to Maven home directory and select the Maven installation directory.
    4. Click Apply, and then click OK.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback