spark_query()

Read(206) 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 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_client("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()

 

Related functions:

spark_close()

spark_cursor()

spark_client()