webhdfs()

Read(4836) Label: file data, upload, download,

Description:

Implement an operation on file data, such as download and upload.

Syntax:

webhdfs(url,localFile)

Note:

The external library function (See External Library Guide) implements any operations within HDFS and WebHDFS.

Parameter:

url

URL of the target file.

localFile

The target file; can be omitted.

Return value:

Operation successful or failed

Example:

 

A

 

1

=webhdfs("http://localhost:50070/webhdfs/v1/test/z1.zip?op=CREATE&user.name=root","D:/z1.zip")

Upload folder D:/z1.zip.

2

=webhdfs("http://localhost:50070/webhdfs/v1/test/f2.png?op=CREATE&user.name=root&overwrite=true","

D:/f2.png")

Upload folder D:/f2.png, and force an overwriting when a namesake folder already exists.

3

=webhdfs("http://localhost:50070/webhdfs/v1/test/f3.txt?op=APPEND&user.name=root","D:/f4.txt")

Append data in D:/f4.txt to f3.txt.

4

=webhdfs("http://localhost:50070/webhdfs/v1/test/f5.xlsx?op=OPEN&user.name=root","D:/f5.xlsx")

Download f5.xlsx.

5

=webhdfs("http://localhost:50070/webhdfs/v1/test/?op=LISTSTATUS&user.name=root")

Get a list of files under /test/ directory and return result as a JSON string.

6

=json(A5)

Convert A5’s JSON string into a multilevel, nested table sequence.

7

=A6.FileStatuses.FileStatus

List detailed information of the files.