How to connect to HDFS from R and read/write parquets using arrow?

Viewed 104

I have couple of parquet files in HDFS that I'd like to read into R and some data in R I'd like to write into HDFS and store in parquet file format. I'd like to use arrow library, because I believe it's the R equivalent of pyarrow and pyarrow is awesome.

The problem is, nowhere in the R arrow docs can I find information about working with HDFS and also in general not much information about how to use the library properly.

I am basically looking for the R equivalent of:

from pyarrow import fs
filesystem = fs.HadoopFileSystem(host = 'my_host', port = 0, kerb_ticket = 'my_ticket')

Disclosure: I know how to use odbc to read and write my data. While reading is fine (but slow), inserting larger amounts of data into impala/hive this way is pure awful (slow, often fails, and impala isn't really built to digest data this way).

I know I could probably use pyarrow to work with hdfs, but would like to avoid installing python in my docker image just for this purpose.

1 Answers

The bindings for this are not currently implemented in R; there is a ticket open here on the project JIRA, which at time of writing is still marked "Unresolved": https://issues.apache.org/jira/browse/ARROW-6981. I'll comment on the JIRA ticket to mention that there is user interest in implementing these bindings.

Related