Help Center/
MapReduce Service/
Developer Guide (LTS)/
Hive Development Guide (Security Mode)/
Commissioning Hive Applications/
Commissioning the Hive Python3 Sample Program
Updated on 2025-04-14 GMT+08:00
Commissioning the Hive Python3 Sample Program
Running Python in CLI Mode
- Grant the execution permission for the script of python3-examples folder. Run the following command in the CLI:
chmod +x python3-examples -R.
- In python3-examples/pyCLI_sec.py, change the value of host to the service plane IP address of the node where HiveServer is installed, and change the value of port to the port (hive.server2.thrift.port) used by Hive to provide the Thrift service. The default value is 10000.
- Change hadoop.hadoop.com in the conf of python-examples/pyCLI_sec.py to hadoop.the actual domain name. To view the actual domain name, log in to FusionInsight Manager and choose System > Permission > Domain and Mutual Trust > Local Domain.
- Run the kinit command to obtain the cache for Kerberos authentication.
Use the developer account created in Preparing MRS Application Development User to run the following commands to run the client program:
kinit -kt keytabstorage path username
cd python3-examples
python3 pyCLI_sec.py
- In the CLI, view the HQL query results in the example codes. For example:
[['default', '']] [{'comment': 'from deserializer', 'columnName': 'tab_name', 'type': 'STRING_TYPE'}] ['xx']
Parent topic: Commissioning Hive Applications
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot