}
@Override
public Object visitInputReference(InputReference node, Object context)
{
Input input = node.getInput();
int channel = input.getChannel();
if (context instanceof TupleReadable[]) {
TupleReadable[] inputs = (TupleReadable[]) context;
TupleReadable tuple = inputs[channel];
if (tuple.isNull()) {
return null;
}
switch (tuple.getTupleInfo().getType()) {
case BOOLEAN:
return tuple.getBoolean();
case FIXED_INT_64:
return tuple.getLong();
case DOUBLE:
return tuple.getDouble();
case VARIABLE_BINARY:
return tuple.getSlice();
default:
throw new UnsupportedOperationException("not yet implemented");
}
}
else if (context instanceof RecordCursor) {
RecordCursor cursor = (RecordCursor) context;
if (cursor.isNull(channel)) {
return null;
}
switch (cursor.getType(input.getChannel())) {
case BOOLEAN:
return cursor.getBoolean(channel);
case LONG:
return cursor.getLong(channel);
case DOUBLE: