Code Monkey home page Code Monkey logo

iashdfs's Introduction

iashdfs

R based HDFS functions for directing the output of any standard print based functions into and out of an HDFS file. These functions do not need extra memory for caching, staging, or otherwise converting values. These functions are simple, fast, and memory efficient.

Pre-requisites for hdfs commands (NOTE: not used by hdfsWeb commands)

  • Environment variable
    • HADOOP_CMD = location of the hadoop command line executable such as when running 'hadoop fs -ls /anHdfsFolder'
  • Installation
    • library(devtools)
    • install_github('tcederquist/iashdfs')
  • Run
    • library(iashdfs)

hdfsWrite(output, hdfsFilename, append=FALSE)

  • output = any command that outputs to the console or string

    • fwrite(mydatatable)
    • noquote(mystring)
  • hdfsFilename = complete filename including the hdfs path

  • append = default of false

    • False = delete the hdfs file before writing
    • True = append to the existing file
  • Example

    hdfsWrite(fwrite(mydatatable), "/user/tcederquist/mysample.csv")

hdfsReadP(hdfsFilename)

Creates a string that can be used by any pipe friendly function to stream the contents of the html file.

  • hdfsFilename = path the file to read

  • Example

    dat.df3<-fread(hdfsReadP("/user/tcederquist/tim_pop_14_5"),sep=",", header=TRUE, showProgress=F)

hdfsDelete(hdfsFilename)

Delete removes the specified file from the supplied HDFS folder

  • hdfsFilename = Full path to the hdfs file to remove

  • Example

    hdfsDelete('/user/tcederquist/mysample.csv')

iashdfs's People

Watchers

Tim Cederquist avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.