KyHuynh
KyHuynh

Reputation: 23

How can using Jena read file from HDFS and convert it to Rdf?

I'm using Apache Jena to convert a .csv file to .rdf. I use model.read(pathFile), but it only reads file from the local filesystem. I want to read from hdfs, such as model.read(hdfs://....), but it gives an error.

My code

And the error is:

Exception in thread "main" org.apache.jena.riot.RiotNotFoundException: Not found: hdfs://localhost:54310/user/hduser/demo/departments/part-00000.csv

How can I do it?

Upvotes: 1

Views: 233

Answers (1)

AndyS
AndyS

Reputation: 16630

You will need to add a Locator to the StreamManager to handle "hdfs://".

Jena does not ship with code for reading HDFS URLs.

Upvotes: 1

Related Questions