Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Rhadoop: rmr2: Error when from.hdfs is used

83 views
Skip to first unread message

Ambika J

unread,
Apr 29, 2014, 5:23:10 AM4/29/14
to rha...@googlegroups.com
Issue when from.hdfs() function used. Please let me know what could be wrong.

Packages and Versions:

R version 3.0.3 (2014-03-06) -- "Warm Puppy"

rmr2_2.3.0

rhdfs_1.0.8



R command prompt:

> library("rmr2")

Loading required package: Rcpp

Loading required package: RJSONIO

Loading required package: bitops

Loading required package: digest

Loading required package: functional

Loading required package: reshape2

Loading required package: stringr

Loading required package: plyr

Loading required package: caTools

> from.dfs("input/cities.txt")

14/04/29 09:16:36 WARN snappy.LoadSnappy: Snappy native library is available

14/04/29 09:16:36 INFO snappy.LoadSnappy: Snappy native library loaded

Error: !is.null(template) is not TRUE


Contents of the file input.cities.txt:

[ambika@machine-stg1 ~]$ hadoop fs -cat input/cities.txt

CA San-Francisco 3273190

CO Denver 634265

OH Athens 23832

GA Atlanta 443775

TN Chatanooga 167674

CA San-Jose 984299

OH Columbus 797434

[ambika@machine-stg1 ~]$


I did see another similar thread - https://groups.google.com/forum/#!topic/rhadoop/czDDfxObcbA; but this did not help to solve this issue.

Antonio Piccolboni

unread,
Apr 29, 2014, 12:11:24 PM4/29/14
to RHadoop Google Group
The default format is "native". from.dfs has not ability to detect the format of files it is supposed to read. Please provide the format argument and read the manual for make.input.format. This specific case appears to be some variant of csv.


Antonio


--
post: rha...@googlegroups.com ||
unsubscribe: rhadoop+u...@googlegroups.com ||
web: https://groups.google.com/d/forum/rhadoop?hl=en-US
---
You received this message because you are subscribed to the Google Groups "RHadoop" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rhadoop+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ambika J

unread,
Apr 29, 2014, 1:38:11 PM4/29/14
to rha...@googlegroups.com, ant...@piccolboni.info
Thanks Antonio.

    csvtextinputformat = make.input.format("csv", sep = "\t")
This line helped to resolve this issue.

And my map reduce now directly accesses the input file
    ... mapreduce(input=input, output=output, input.format = csvtextinputformat, ...

This way this is resolved.

Thanks,
Ambika
Reply all
Reply to author
Forward
0 new messages