spark_open()

Read(3356) Label: create, spark database connection,

Description:

Create a Spark database connection.

Syntax:

spark_open()

Create a local connection

spark_open(hdfsUrl)

Create an HDFS connection

spark_open(hdfsUrl,thriftUrl,dbname)

Connect to Spark database

Note:

This external library function (See External Library Guide) connects to a Spark database.

Parameter:

hdfsUrl

HDFS file connection information; the format is hdfs://ip:port, which represents the HDFS file’s IP and port number

thriftUrl

Thrift file connection information; the format is thrift://ip:port, which represents the Thrift file’s IP and port number

dbname

A database name

Return value:

A cursor

Example:

 

A

 

1

=spark_open

Create a local connection. 

2

=spark_open("hdfs://192.168.0.8:9000")

Create an HDFS connection.

3

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

Connect to Spark database.

Related function:

spark_close()

spark_cursor()

spark_query()