com.facebook.presto.spi.RecordCursor Java Examples

The following examples show how to use com.facebook.presto.spi.RecordCursor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EthereumRecordSet.java    From presto-ethereum with Apache License 2.0 5 votes vote down vote up
@Override
public RecordCursor cursor() {
    EthBlock block = null;
    try {
        block = web3j.ethGetBlockByNumber(DefaultBlockParameter.valueOf(BigInteger.valueOf(split.getBlockId())), true).send();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return new EthereumRecordCursor(columnHandles, block, split.getTable(), web3j);
}
 
Example #2
Source File: KuduRecordSet.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
@Override
public RecordCursor cursor() {
    KuduScanner scanner = clientSession.createScanner(kuduSplit);
    if (!containsVirtualRowId) {
        return new KuduRecordCursor(scanner, getColumnTypes());
    } else {
        final int primaryKeyColumnCount = kuduSplit.getPrimaryKeyColumnCount();

        Map<Integer, Integer> fieldMapping = new HashMap<>();
        int index = primaryKeyColumnCount;
        for (int i = 0; i < columns.size(); i++) {
            KuduColumnHandle handle = (KuduColumnHandle) columns.get(i);
            if (!handle.isVirtualRowId()) {
                if (handle.getOrdinalPosition() < primaryKeyColumnCount) {
                    fieldMapping.put(i, handle.getOrdinalPosition());
                } else {
                    fieldMapping.put(i, index);
                    index++;
                }
            } else {
                fieldMapping.put(i, -1);
            }
        }

        KuduTable table = getTable();
        return new KuduRecordCursorWithVirtualRowId(scanner, table, getColumnTypes(), fieldMapping);
    }
}
 
Example #3
Source File: KubeRecordSet.java    From kubesql with Apache License 2.0 4 votes vote down vote up
@Override
public RecordCursor cursor()
{
    return new KubeRecordCursor(kubeTables, columns, tableName, address, effectivePredicate);
}
 
Example #4
Source File: HbaseRecordSet.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
@Override
public RecordCursor cursor()
{
    return new HbaseRecordCursor(resultRecordReader, rowIdName, columnHandles, constraints);
}
 
Example #5
Source File: KinesisRecordSet.java    From presto-kinesis with Apache License 2.0 4 votes vote down vote up
@Override
public RecordCursor cursor()
{
    return new KinesisRecordCursor();
}