use of org.apache.drill.exec.physical.impl.scan.file.ImplicitColumnManager.ImplicitColumnOptions in project drill by apache.
the class TestImplicitColumnProjection method standardOptions.
private ImplicitColumnOptions standardOptions(List<Path> files) {
ImplicitColumnOptions options = new ImplicitColumnOptions();
// Don't expand partition columns for wildcard
options.useLegacyWildcardExpansion(false);
options.setSelectionRoot(new Path("hdfs:///w"));
options.setFiles(files);
return options;
}
use of org.apache.drill.exec.physical.impl.scan.file.ImplicitColumnManager.ImplicitColumnOptions in project drill by apache.
the class TestColumnsArray method standardOptions.
private ImplicitColumnOptions standardOptions(Path filePath) {
ImplicitColumnOptions options = new ImplicitColumnOptions();
// Don't expand partition columns for wildcard
options.useLegacyWildcardExpansion(false);
options.setSelectionRoot(new Path("hdfs:///w"));
options.setFiles(Lists.newArrayList(filePath));
return options;
}
use of org.apache.drill.exec.physical.impl.scan.file.ImplicitColumnManager.ImplicitColumnOptions in project drill by apache.
the class TestImplicitColumnParser method standardOptions.
private ImplicitColumnOptions standardOptions(List<Path> files) {
ImplicitColumnOptions options = new ImplicitColumnOptions();
// Don't expand partition columns for wildcard
options.useLegacyWildcardExpansion(false);
options.setSelectionRoot(new Path("hdfs:///w"));
options.setFiles(files);
return options;
}
use of org.apache.drill.exec.physical.impl.scan.file.ImplicitColumnManager.ImplicitColumnOptions in project drill by apache.
the class TestImplicitColumnParser method testPreferedWildcardExpansionWithOverlap.
@Test
public void testPreferedWildcardExpansionWithOverlap() {
Path filePath = new Path("hdfs:///w/x/y/z.csv");
ImplicitColumnOptions options = standardOptions(filePath);
options.useLegacyWildcardExpansion(true);
ImplicitColumnManager implictColManager = new ImplicitColumnManager(fixture.getOptionManager(), options);
ScanLevelProjection scanProj = ScanLevelProjection.build(RowSetTestUtils.projectList(SchemaPath.DYNAMIC_STAR, ScanTestUtils.partitionColName(1)), Lists.newArrayList(implictColManager.projectionParser()));
List<ColumnProjection> cols = scanProj.columns();
assertEquals(3, cols.size());
assertTrue(scanProj.columns().get(0) instanceof UnresolvedWildcardColumn);
assertTrue(scanProj.columns().get(1) instanceof PartitionColumn);
assertEquals(1, ((PartitionColumn) cols.get(1)).partition());
assertTrue(scanProj.columns().get(2) instanceof PartitionColumn);
assertEquals(0, ((PartitionColumn) cols.get(2)).partition());
}
use of org.apache.drill.exec.physical.impl.scan.file.ImplicitColumnManager.ImplicitColumnOptions in project drill by apache.
the class TestImplicitColumnParser method testPreferredPartitionExpansion.
@Test
public void testPreferredPartitionExpansion() {
Path filePath = new Path("hdfs:///w/x/y/z.csv");
ImplicitColumnOptions options = standardOptions(filePath);
options.useLegacyWildcardExpansion(true);
ImplicitColumnManager implictColManager = new ImplicitColumnManager(fixture.getOptionManager(), options);
ScanLevelProjection scanProj = ScanLevelProjection.build(RowSetTestUtils.projectList(SchemaPath.DYNAMIC_STAR, ScanTestUtils.partitionColName(8)), Lists.newArrayList(implictColManager.projectionParser()));
List<ColumnProjection> cols = scanProj.columns();
assertEquals(4, cols.size());
assertTrue(scanProj.columns().get(0) instanceof UnresolvedWildcardColumn);
assertTrue(scanProj.columns().get(1) instanceof PartitionColumn);
assertEquals(8, ((PartitionColumn) cols.get(1)).partition());
assertTrue(scanProj.columns().get(2) instanceof PartitionColumn);
assertEquals(0, ((PartitionColumn) cols.get(2)).partition());
assertTrue(scanProj.columns().get(3) instanceof PartitionColumn);
assertEquals(1, ((PartitionColumn) cols.get(3)).partition());
}
Aggregations