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

Commissioning the Python3 Sample Project

This section applies to MRS 3.3.0 or later.

Scenario

After the program code is written, you can commission the code in the Windows environment or upload the code to the Linux environment. If the local environment can communicate with the cluster service plane network, you can commission the program locally.

Procedure

  1. Refer to Configuring the Python3 Sample Project to obtain the sample code, obtain the hetu-jdbc-XXX.jar file, and copy it to the user-defined directory.
  2. Edit the sample code, modify URLs and user information based on the cluster requirements, and modify jdbc_location based on the actual path.
    • Example path in Windows: D:\\hetu-examples-python3\\hetu-jdbc-XXX.jar
    • Example path in Linux: /opt/hetu-examples-python3/hetu-jdbc-XXX.jar
  1. Run the python3 sample code.
    • In Windows, run the py script through pycharm or Python IDLE.
    • To run the sample code on Linux, install Java first.

      Go to the sample code path and run the py script. An example of the sample code path is /opt/hetu-examples-python3.

      cd /opt/hetu-examples-python3

      python3 JDBCExampleBroker.py

  1. View the command output.
    • In Windows, view the running result on the console.
      Figure 1 Running result
    • The following is an example of the running result in Linux:
      ...
      [ ('hive', ('mv',), ('svc',), ('system',), ('systemremote',)]