spark_query()

Read(3940) Label: query, spark database, query,

Description:

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

Syntax:

spark_query(con,sql)

Note:

This external library function (See External Library Guide) executes a certain SQL query on a Spark database, and returns the query result as a table sequence. The parameter con represents database connection.

Parameter:

con

Database connection string

sql

A SQL query statement, like select * from table

Return value:

Table sequence

Example:

 

A

 

1

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

Connect to the spark database.

2

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

 

3

=spark_close(A1)

 

Related function:

spark_close()

spark_cursor()

spark_open()