use of com.cloudera.cdk.data.DatasetReader in project cdk-examples by cloudera.
the class ReadMovies method run.
@Override
public int run(String[] args) throws Exception {
DatasetRepository repo = DatasetRepositories.open("repo:hdfs://localhost:8020/user/cloudera");
Dataset movies = repo.load("movies");
DatasetReader reader = movies.newReader();
try {
reader.open();
for (Object rec : reader) {
System.err.println("Movie: " + rec);
}
} finally {
reader.close();
}
return 0;
}
Aggregations