hdfs_open()

Description:

Connect to the HDFS file system and return a connection object.

Syntax:

hdfs_open(;url,user)

Note:

This external library function (See External Library Guide) connects to the Hadoop server. When all parameters are absent, Hadoop configuration file needs to be placed under the external library directory, and in this case, the function returns the default connection.

Parameter:

url

The URL format is scheme://authority/path.

Scheme is the HDFS protocol name; authority is the host name; and path is a string of the file (or directory) path.

user

A Hadoop user; default is root.

Return value:

Connection object

Example:

 

A

 

1

=hdfs_open(;"hdfs://192.168.0.76:9000","root")

Connect to the HDFS.

2

=hdfs_open(;"hdfs://192.168.0.8:9000")

Connect to the HDFS with parameter user omitted

3

=hdfs_open()

Put Hadoop configuration file in the external library directory as all parameters are absent.