更新时间:2022-07-14 GMT+08:00
分享

Python3样例工程运行及结果查看

Python3样例工程的命令行形式运行

  1. 赋予“python3-examples”文件夹中脚本的可执行权限。在命令行终端执行以下命令:

    chmod +x python3-examples -R

  2. 在python3-examples/pyCLI_nosec.py中的host的值修改为安装HiveServer的节点的业务平面IP,port的值修改为Hive提供Thrift服务的端口(hive.server2.thrift.port),默认为21066。

    Hive多实例的python客户端命令行形式:“python3-examples/pyCLI_nosec.py”不仅要修改host,还需根据所使用的实例修改port,port为Hive提供Thrift服务的端口(hive.server2.thrift.port)。

  3. 执行以下命令运行Python3客户端:

    cd python3-examples

    python pyCLI_nosec.py

  4. 在命令行终端查看样例代码中的HQL所查询出的结果。例如:

    [['default', '']] 
     [{'comment': 'from deserializer', 'columnName': 'tab_name', 'type': 'STRING_TYPE'}] 
     ['xx']     

分享:

    相关文档

    相关产品