Search in sources :

Example 1 with DatasetReader

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;
}
Also used : Dataset(com.cloudera.cdk.data.Dataset) DatasetRepository(com.cloudera.cdk.data.DatasetRepository) DatasetReader(com.cloudera.cdk.data.DatasetReader)

Aggregations

Dataset (com.cloudera.cdk.data.Dataset)1 DatasetReader (com.cloudera.cdk.data.DatasetReader)1 DatasetRepository (com.cloudera.cdk.data.DatasetRepository)1