hive_query()

Read(3787) Label: query, hive database,

Description:

Query a Hive database.

Syntax:

hive_query(con,sql)

Note:

This external library function (See External Library Guide) executes a certain SQL query on a Hive database, and returns the query result as a table sequence.

Parameter:

con

Database connection string

sql

A SQL query statement, like select * from table

Return value:

Table sequence

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_query(A1, "select  *  from  table")

Query data in table.

3

=hive_close(A1)

 

Related function:

hive_close()

hive_cursor()

hive_open()