Search in sources :

Example 6 with FileUriCollectPhase

use of io.crate.execution.dsl.phases.FileUriCollectPhase in project crate by crate.

the class CopyFromPlannerTest method testCopyFromPlan.

@Test
public void testCopyFromPlan() {
    Collect plan = plan("copy users from '/path/to/file.extension'");
    assertThat(plan.collectPhase(), instanceOf(FileUriCollectPhase.class));
    FileUriCollectPhase collectPhase = (FileUriCollectPhase) plan.collectPhase();
    assertThat(((Literal) collectPhase.targetUri()).value(), is("/path/to/file.extension"));
}
Also used : Collect(io.crate.planner.node.dql.Collect) FileUriCollectPhase(io.crate.execution.dsl.phases.FileUriCollectPhase) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Aggregations

FileUriCollectPhase (io.crate.execution.dsl.phases.FileUriCollectPhase)6 Collect (io.crate.planner.node.dql.Collect)4 CrateDummyClusterServiceUnitTest (io.crate.test.integration.CrateDummyClusterServiceUnitTest)4 Test (org.junit.Test)4 SourceIndexWriterProjection (io.crate.execution.dsl.projection.SourceIndexWriterProjection)2 ColumnIdent (io.crate.metadata.ColumnIdent)2 AnalyzedCopyFromReturnSummary (io.crate.analyze.AnalyzedCopyFromReturnSummary)1 CollectionBucket (io.crate.data.CollectionBucket)1 Row (io.crate.data.Row)1 AbstractIndexWriterProjection (io.crate.execution.dsl.projection.AbstractIndexWriterProjection)1 MergeCountProjection (io.crate.execution.dsl.projection.MergeCountProjection)1 Projection (io.crate.execution.dsl.projection.Projection)1 SourceIndexWriterReturnSummaryProjection (io.crate.execution.dsl.projection.SourceIndexWriterReturnSummaryProjection)1 InputColumns (io.crate.execution.dsl.projection.builder.InputColumns)1 FileInputFactory (io.crate.execution.engine.collect.files.FileInputFactory)1 LineCollectorExpression (io.crate.execution.engine.collect.files.LineCollectorExpression)1 FileCollectSource (io.crate.execution.engine.collect.sources.FileCollectSource)1 InputFactory (io.crate.expression.InputFactory)1 FileLineReferenceResolver (io.crate.expression.reference.file.FileLineReferenceResolver)1 InputColumn (io.crate.expression.symbol.InputColumn)1