Examples of cursor()


Examples of com.facebook.presto.spi.RecordSet.cursor()

            throws Exception
    {
        RecordSet recordSet = new ExampleRecordSet(new ExampleSplit("test", "schema", "table", dataUri), ImmutableList.of(
                new ExampleColumnHandle("test", "text", STRING, 0),
                new ExampleColumnHandle("test", "value", LONG, 1)));
        RecordCursor cursor = recordSet.cursor();

        assertEquals(cursor.getType(0), STRING);
        assertEquals(cursor.getType(1), LONG);

        Map<String, Long> data = new LinkedHashMap<>();
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

    {
        RecordSet recordSet = new ExampleRecordSet(new ExampleSplit("test", "schema", "table", dataUri), ImmutableList.of(
                new ExampleColumnHandle("test", "value", LONG, 1),
                new ExampleColumnHandle("test", "value", LONG, 1),
                new ExampleColumnHandle("test", "text", STRING, 0)));
        RecordCursor cursor = recordSet.cursor();

        Map<String, Long> data = new LinkedHashMap<>();
        while (cursor.advanceNextPosition()) {
            assertEquals(cursor.getLong(0), cursor.getLong(1));
            data.put(new String(cursor.getString(2), UTF_8), cursor.getLong(0));
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

    {
        ConnectorTableHandle table = getTableHandle(tableUnpartitioned);
        ConnectorPartitionResult partitionResult = splitManager.getPartitions(table, TupleDomain.<ConnectorColumnHandle>all());
        ConnectorSplit split = Iterables.getFirst(getAllSplits(splitManager.getPartitionSplits(table, partitionResult.getPartitions())), null);
        RecordSet recordSet = recordSetProvider.getRecordSet(split, ImmutableList.of(invalidColumnHandle));
        recordSet.cursor();
    }

    @Test
    public void testHiveViewsAreNotSupported()
            throws Exception
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

    {
        TableHandle table = getTableHandle(tableUnpartitioned);
        PartitionResult partitionResult = splitManager.getPartitions(table, TupleDomain.all());
        Split split = Iterables.getFirst(splitManager.getPartitionSplits(table, partitionResult.getPartitions()), null);
        RecordSet recordSet = recordSetProvider.getRecordSet(split, ImmutableList.of(invalidColumnHandle));
        recordSet.cursor();
    }

    @Test
    public void testViewsAreNotSupported()
            throws Exception
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

    {
        TableHandle table = getTableHandle(tableUnpartitioned);
        PartitionResult partitionResult = splitManager.getPartitions(table, TupleDomain.all());
        Split split = Iterables.getFirst(getAllSplits(splitManager.getPartitionSplits(table, partitionResult.getPartitions())), null);
        RecordSet recordSet = recordSetProvider.getRecordSet(split, ImmutableList.of(invalidColumnHandle));
        recordSet.cursor();
    }

    @Test
    public void testViewsAreNotSupported()
            throws Exception
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

            throws Exception
    {
        RecordSet recordSet = new ExampleRecordSet(new ExampleSplit("test", "schema", "table", dataUri), ImmutableList.of(
                new ExampleColumnHandle("test", "text", STRING, 0),
                new ExampleColumnHandle("test", "value", LONG, 1)));
        RecordCursor cursor = recordSet.cursor();

        assertEquals(cursor.getType(0), STRING);
        assertEquals(cursor.getType(1), LONG);

        Map<String, Long> data = new LinkedHashMap<>();
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

    {
        RecordSet recordSet = new ExampleRecordSet(new ExampleSplit("test", "schema", "table", dataUri), ImmutableList.of(
                new ExampleColumnHandle("test", "value", LONG, 1),
                new ExampleColumnHandle("test", "value", LONG, 1),
                new ExampleColumnHandle("test", "text", STRING, 0)));
        RecordCursor cursor = recordSet.cursor();

        Map<String, Long> data = new LinkedHashMap<>();
        while (cursor.advanceNextPosition()) {
            assertEquals(cursor.getLong(0), cursor.getLong(1));
            data.put(new String(cursor.getString(2), UTF_8), cursor.getLong(0));
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

        RecordSet recordSet = recordSetProvider.getRecordSet(new ExampleSplit("test", "schema", "table", dataUri), ImmutableList.of(
                new ExampleColumnHandle("test", "text", ColumnType.STRING, 0),
                new ExampleColumnHandle("test", "value", ColumnType.LONG, 1)));
        assertNotNull(recordSet, "recordSet is null");

        RecordCursor cursor = recordSet.cursor();
        assertNotNull(cursor, "cursor is null");

        Map<String, Long> data = new LinkedHashMap<>();
        while (cursor.advanceNextPosition()) {
            data.put(new String(cursor.getString(0), UTF_8), cursor.getLong(1));
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

    {
        ConnectorTableHandle table = getTableHandle(tableUnpartitioned);
        ConnectorPartitionResult partitionResult = splitManager.getPartitions(table, TupleDomain.<ConnectorColumnHandle>all());
        ConnectorSplit split = Iterables.getFirst(getAllSplits(splitManager.getPartitionSplits(table, partitionResult.getPartitions())), null);
        RecordSet recordSet = recordSetProvider.getRecordSet(split, ImmutableList.of(invalidColumnHandle));
        recordSet.cursor();
    }

    @Test
    public void testHiveViewsAreNotSupported()
            throws Exception
View Full Code Here

Examples of com.facebook.presto.spi.RecordSet.cursor()

    {
        RecordSet recordSet = new JdbcRecordSet(jdbcClient, split, ImmutableList.of(
                columnHandles.get("text"),
                columnHandles.get("value")));

        try (RecordCursor cursor = recordSet.cursor()) {
            assertEquals(cursor.getType(0), VARCHAR);
            assertEquals(cursor.getType(1), BIGINT);

            Map<String, Long> data = new LinkedHashMap<>();
            while (cursor.advanceNextPosition()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.