hive_cursor()

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

描述:

查询Hive数据库,结果值返回成游标。

语法:

hive_cursor(con,sql)

备注:

外部库函数,外部库的使用请参考《外部库使用指南》。

根据sql查询数据并返回游标。

参数:

con

数据库连接串。

sql

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

返回值:

游标

示例:

 

A

 

1

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

连接hive数据库。

2

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

返回游标。

3

=hive_close()

 

相关概念:

hive_close()

hive_open()

hive_query()