spark_cursor()

Read(257) Label: query, spark database, cursor,

Description:

Query a Spark database, and return the result as a cursor.

Syntax:

spark_cursor(con,sql)

Note:

  This external library function executes a SQL query on a Spark database 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

spark_client("hdfs://192.168.0.8:9000","thrift://192.168.0.8:9083","aa")

Connect to the spark database

2

=spark_cursor(A1,"select * from tablename")

 

3

=spark_close()

 

Related functions:

spark_close()

spark_client()

spark_query()