hive_cursor()

Read(4586) Label: query, hive database, cursor,

Description:

Query a Hive database and return the result as a cursor.

Syntax:

hive_cursor(con,sql)

Note:

This external library function (See External Library Guide) performs a SQL query and returns the result as a cursor.

Parameter:

con

Database connection string

sql

A SQL query statement, like select * from table

Return value:

Cursor

Example:

 

A

 

1

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

Connect to the hive database.

2

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

Return a cursor.

3

=hive_close(A1)

 

Related function:

hive_close()

hive_open()

hive_query()