hive_cursor()

Read(220) 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 performs a SQL query and returns the result as a cursor. The parameter con is database connection.

Parameters:

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()

 

Related functions:

hive_close()

hive_client()

hive_query()