• impyla-0.14.2.2安装注意事项


    ### impyla-0.14.2.2安装注意事项
    + 环境
    - Red Hat Enterprise Linux Server release 6.8 (Santiango)
    - Python3.7.3

    + impyla-0.14.2.2依赖包
    - yum install -y python-devel cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib
    - thrift - 0.11.0
    - sasl - 0.2.1
    - thrift_sasl - 0.2.1
    - thriftpy - 0.3.9

    + 问题1: syntax error near 'async=True)' 报错
    - hiveserver2.py 第340行 `async=True)` 改为 `async2=True)` (估计async是关键字)
    - hiveserver2.py 第1022行 `async=False)` 改为 `async2=False)`
    - hiveserver2.py 第1026行 `=async)` 改为 `=async2)`

    + 问题2:'TSocket' object has no attribute 'isOpen'报错?
    - 把 thrift_sasl 从0.3.0换成0.2.1版本 (在python2.7中0.3.0没问题)

    + 问题3:No protocol version header
    - connect函数需要指定 user, password, auth_mechanism = 'PLAIN'

    + 问题4:报错sasl/sasl.h: No such file or directory
    - yum install -y cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib

    + 示例

    ```python

    from impala.dbapi import connect

    conn = connect(host='hadoop01', port=10000, user='hadoop', password='hadoop', auth_mechanism = 'PLAIN')
    cursor = conn.cursor()
    cursor.execute('SHOW DATABASES')
    for result in cursor.fetchall():
    print(result)

    ```

    + 注意启动hiveserver2
    ```bash
    nohup hive --service hiveserver2 > nohup.hiveserver2&
    ```

  • 相关阅读:
    Java数据库操作(MySQL与SQLserver)
    LeetCode 11. 盛最多水的容器
    LeetCode 10.正则表达式匹配
    LeetCode 9.回文数
    LeetCode 7. 整数反转
    LeetCode 6.Z 字形变换
    LeetCode 4.寻找两个正序数组的中位数
    LeetCode 3. 无重复字符的最长子串
    JOI2020遗迹
    线性规划对偶
  • 原文地址:https://www.cnblogs.com/zhaohz/p/12117102.html
Copyright © 2020-2023  润新知