1. 安装pyhs2
 
pyhs2依赖项如下:
 
gcc-c++
 
python-devel.x86_64
 
cyrus-sasl-devel.x86_64
 
因此pyhs2的安装命令如下:
 
yum install gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64
 
pip install pyhs2
 
此外,可能还需要安装cyrus-sasl-plain:
 
yum install cyrus-sasl-plain
 
2. pyhs2示例
 
(1)执行DDL、DML语句;
 
Python HiveServer2
 
(2)执行DQL语句,获取并打印返回结果的Schema,获取并打印单条结果记录;
 
Python HiveServer2
 
输出结果:
 
Python HiveServer2
 
(3)执行DQL语句,获取并打印返回结果的Schema,获取并打印所有结果记录;
 
Python HiveServer2
 
输出结果:
 
Python HiveServer2

相关文章:

  • 2021-09-18
  • 2021-12-01
  • 2022-02-24
  • 2021-11-06
  • 2021-08-03
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-23
  • 2021-11-13
  • 2021-04-07
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案