use of edu.uci.ics.texera.api.schema.AttributeType in project textdb by TextDB.
the class WordCloudSink method open.
@Override
public void open() throws TexeraException {
if (cursor != CLOSED) {
return;
}
if (inputOperator == null) {
throw new TexeraException(ErrorMessages.INPUT_OPERATOR_NOT_SPECIFIED);
}
inputOperator.open();
this.addPayload = !inputOperator.getOutputSchema().containsAttribute(SchemaConstants.PAYLOAD);
Schema schema = inputOperator.getOutputSchema();
Attribute textColumn = schema.getAttribute(predicate.getAttribute());
AttributeType nameColumnType = textColumn.getType();
if (!nameColumnType.equals(AttributeType.TEXT)) {
throw new DataflowException("Type of name column should be text.");
}
outputSchema = new Schema.Builder().add(new Attribute("word", AttributeType.STRING), new Attribute("count", AttributeType.INTEGER)).build();
cursor = OPENED;
}
Aggregations