Package io.crate.operation.projectors

Examples of io.crate.operation.projectors.CollectingProjector.result()


    @Test
    public void testCollectFromS3Uri() throws Throwable {
        // this test just verifies the s3 schema detection and bucketName / prefix extraction from the uri.
        // real s3 interaction is mocked completely.
        CollectingProjector projector = getObjects("s3://fakebucket/foo");
        projector.result().get();
    }

    @Test
    public void testNoErrorIfNoSuchFile() throws Throwable {
        // no error, -> don't want to fail just because one node doesn't have a file
View Full Code Here


    }

    @Test (expected = IllegalArgumentException.class)
    public void testRelativeImport() throws Throwable {
        CollectingProjector projector = getObjects("xy");
        assertCorrectResult(projector.result().get());
    }

    @Test
    public void testCollectFromUriWithGlob() throws Throwable {
        CollectingProjector projector = getObjects(tmpFile.getParent() + "/file*.json");
 
View Full Code Here

    }

    @Test
    public void testCollectFromUriWithGlob() throws Throwable {
        CollectingProjector projector = getObjects(tmpFile.getParent() + "/file*.json");
        assertCorrectResult(projector.result().get());
    }

    @Test
    public void testCollectFromDirectory() throws Throwable {
        CollectingProjector projector = getObjects(tmpFile.getParent() + "/*");
 
View Full Code Here

    }

    @Test
    public void testCollectFromDirectory() throws Throwable {
        CollectingProjector projector = getObjects(tmpFile.getParent() + "/*");
        assertCorrectResult(projector.result().get());
    }

    @Test
    public void testDoCollectRaw() throws Throwable {
        CollectingProjector projector = getObjects(tmpFile.getAbsolutePath());
View Full Code Here

    }

    @Test
    public void testDoCollectRaw() throws Throwable {
        CollectingProjector projector = getObjects(tmpFile.getAbsolutePath());
        assertCorrectResult(projector.result().get());
    }

    @Test
    public void testDoCollectRawFromCompressed() throws Throwable {
        CollectingProjector projector = getObjects(tmpFileGz.getAbsolutePath(), "gzip");
View Full Code Here

    }

    @Test
    public void testDoCollectRawFromCompressed() throws Throwable {
        CollectingProjector projector = getObjects(tmpFileGz.getAbsolutePath(), "gzip");
        assertCorrectResult(projector.result().get());
    }

    private void assertCorrectResult(Object[][] rows) throws Throwable {
        assertThat(((BytesRef)rows[0][0]).utf8ToString(), is(
                "{\"name\": \"Arthur\", \"id\": 4, \"details\": {\"age\": 38}}"));
View Full Code Here

                container,
                Arrays.<Input<?>>asList(digestExpression, ctimeExpression),
                Arrays.<BlobCollectorExpression<?>>asList(digestExpression, ctimeExpression),
                condition
        );
        Object[][] result = projector.result().get();

        assertEquals(digest, ((BytesRef)result[0][0]).utf8ToString());
        assertEquals(mtime, result[0][1]);
    }
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.