Skip to content

store data in CSV format #234

@simran-k

Description

@simran-k

I wrote the following function to write data in HDFS using R. I

writeToHDFS <- function(fileName){
hdfs.init()
modelfile <- hdfs.file(fileName, "w")
hdfs.write(get(fileName), modelfile)
hdfs.close(modelfile)
}
How do I modify it store this data in CSV format instead?I have tried using pipe but since it is deprecated, I would like a way to write CSV files through hdfs.write functions.

I tried this:

modelfile <- hdfs.file(paste(fileName, "csv", sep="."), "w")
but I do not think it creates a valid CSV but only appends the extension for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions