Description:
Query a Spark database, and return the result as a cursor.
Syntax:
spark_cursor(con,sql)
Note:
This external library function (See External Library Guide) executes a SQL query on a Spark database and returns the result as a cursor. The parameter con is database connection.
Parameter:
con |
Database connection string |
sql |
A SQL query statement, like select * from table |
Return value:
Cursor
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_cursor(A1,"select * from tablename") |
|
3 |
=spark_close(A1) |
|
Related function: