spark_client()

Description:

Create a Spark database connection.

Syntax:

spark_client(hdfsUrl,thriftUrl,dbname)

Note:

This external library function connects to a Spark database.The format of the parameter hdfsUrl is hdfs://ip:port, which represents the HDFS file’s IP and port number. The format of the parameter thriftUrl is thrift://ip:port, which represents the Thrift file’s IP and port number. The parameter dbname is database name.

Parameters:

hdfsUrl

HDFS file connection information

thriftUrl

Thrift file connection information

dbname

A database name.

Return value:

Database connection

Example:

 

A

 

1

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

Connect to the spark database

Related functions:

spark_close()

spark_cursor()

spark_query()