* 1: DOCUMENT_TEXT
*/
// Create DataSourceContract for documents relation
@SuppressWarnings("unchecked")
CsvInputFormat docsFormat = new CsvInputFormat('|', StringValue.class, StringValue.class);
FileDataSource docs = new FileDataSource(docsFormat, docsInput, "Docs Input");
/*
* Output Format:
* 0: URL
* 1: RANK
* 2: AVG_DURATION
*/
// Create DataSourceContract for ranks relation
FileDataSource ranks = new FileDataSource(new CsvInputFormat(), ranksInput, "Ranks input");
CsvInputFormat.configureRecordFormat(ranks)
.recordDelimiter('\n')
.fieldDelimiter('|')
.field(StringValue.class, 1)
.field(IntValue.class, 0)
.field(IntValue.class, 2);
/*
* Output Format:
* 0: URL
* 1: DATE
*/
// Create DataSourceContract for visits relation
@SuppressWarnings("unchecked")
CsvInputFormat visitsFormat = new CsvInputFormat('|', null, StringValue.class, StringValue.class);
FileDataSource visits = new FileDataSource(visitsFormat, visitsInput, "Visits input:q");
// Create MapOperator for filtering the entries from the documents
// relation
MapOperator filterDocs = MapOperator.builder(new FilterDocs())
.input(docs)