Operating a Hudi Table Using spark-sql
This section applies only to MRS 3.5.0-LTS and later versions.
Scenario
This section describes how to use the Hudi function using spark-sql.
Prerequisites
You have created a user and added the user to user groups hadoop (primary group) and hive on Manager.
Procedure
- Download and install the Hudi client. For details, see Installing a Client.
Currently, Hudi is integrated in Spark. You only need to download the Spark client on Manager. For example, the client installation directory is /opt/client.
- Log in to the node where the client is installed as user root and run the following command:
cd /opt/client
- Run the following commands to load environment variables:
source bigdata_env
source Hudi/component_env
kinit Created user
- You need to change the password of the created user, and then run the kinit command to log in to the system again.
- In normal mode (Kerberos authentication disabled), you do not need to run the kinit command.
- If multiple services are installed, run the component_env command of the source Spark and then the component_env command of the source Hudi after you run the source bigdata_env command.
- Start spark-sql.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot