rhive-hdfs {RHive}R Documentation

R functions to communicate with HDFS

Description

R functions to communicate with HDFS

Usage

rhive.save(..., file, envir=parent.frame())
rhive.load(file, envir=parent.frame())
rhive.hdfs.ls(path="/")
rhive.hdfs.get(src, dst, srcDel=FALSE)
rhive.hdfs.put(src, dst, srcDel=FALSE, overwrite=FALSE)
rhive.hdfs.rm(...)
rhive.hdfs.rename(src, dst)
rhive.hdfs.exists(path)
rhive.hdfs.mkdirs(path)
rhive.hdfs.cat(path) 
rhive.hdfs.tail(path) 
rhive.hdfs.du(path="/", summary=FALSE)
rhive.hdfs.dus(path="/")
rhive.write.table(data, tableName, sep=",", naString=NULL, rowName=FALSE,
  rowNameColumn="rowname")
rhive.hdfs.info(path)
rhive.hdfs.chmod(option, path, recursive=FALSE)
rhive.hdfs.chown(option, path, recursive=FALSE)
rhive.hdfs.chgrp(option, path, recursive=FALSE)

Arguments

src

full path of source data.

dst

full path of target data.

file

the full-name of the file where the data will be saved or loaded

path

hdfs's full path.

envir

environment to search for objects to be saved or loaded.

srcDel

indicates if the source should be removed.

overwrite

if path exists,this option indicates whether to overwrite.

...

target path list.

data

the object to be written, preferably a data frame.

tableName

a character string naming a table

sep

the field separator string. Values within each row of 'data' are separated by this string

naString

default value for NA.

rowName

a logical value indicating whether the row names of 'data' are to be written along with data

rowNameColumn

a character string specifying the column which contains the row names of 'data'

summary

summarize result of 'du'.

option

specific option. chmod's option is 775 or chown's option is user-id.

recursive

apply command recursively

Details

rhive.hdfs.connect : Connect to HDFS

rhive.hdfs.ls : Lists the contents of the directory specified by path, showing the names, permissions, owner, size and modification date for each entry.

rhive.hdfs.put : Copy the file or directory from the local file system identified by source to target within the HDFS.

rhive.hdfs.get : Copy the file or directory in HDFS identified by source to the local file system path identified by target.

rhive.hdfs.rm : Removes the file or empty directory identified by path.

rhive.hdfs.rename : Rename the file or directory identified by source to target within the HDFS.

rhive.hdfs.exists : Check whether the file or directory specified by path is or not.

rhive.hdfs.mkdirs : Creates a directory named path in HDFS.

rhive.hdfs.close : Close hdfs connection

rhive.save : save R Objects to HDFS as R data format

rhive.load : load R data format file stored in HDFS

rhive.write.table : create Hive table using R data.frame

rhive.hdfs.info : report block information of path

rhive.hdfs.chmod : change mode for specified path.

rhive.hdfs.chown : change ownership for specified path.

rhive.hdfs.chgrp : change group for specified path.

Author(s)

rhive@nexr.com

Examples

## try to connect hdfs namenode
## Not run: rhive.hdfs.connect()

## get list of specified path
## Not run: rhive.hdfs.ls()

## load local-file to hdfs
## Not run: rhive.hdfs.put('/data/rhive.txt','/rhive/data/load.txt)

## download data from hdfs to local-file
## Not run: rhive.hdfs.get('/rhive/data/load.txt','/data/rhive.txt')

## delete data in hdfs
## Not run: rhive.hdfs.rm('/rhive/data/load.txt')

## close connection
## Not run: rhive.hdfs.close()

[Package RHive version 2.0-0.10 Index]