hive_query()

阅读(443) 标签: 查询, hive数据库,

描述:

查询Hive数据库,结果值返回成序列

语法:

hive_query(con,sql)

备注:

外部库函数,在数据库中查询指定的sql,返回sql的查询结果所组成的序表,其中con为数据库连接。

参数:

con

数据库连接串

sql

需要查询的sql语句,如select * from table

返回值:

序表

示例:

 

A

 

1

=hive_client("hdfs://192.168.0.8:9000","thrift://192.168.0.8:9083","hive","asus")

连接hive数据库

2

=hive_query(A1, "select  *  from  table")

查询table表数据

3

=hive_close()

 

相关概念:

hive_close()

hive_cursor()

hive_client()