use of org.apache.drill.exec.physical.impl.scan.columns.UnresolvedColumnsArrayColumn in project drill by apache.
the class TestColumnsArrayParser method testWildcardAndColumns.
/**
* If a query is of the form:
* <pre><code>
* select * from dfs.`multilevel/csv` where columns[1] < 1000
* </code><pre>
* Then the projection list passed to the scan operator
* includes both the wildcard and the `columns` array.
* We can ignore one of them.
*/
@Test
public void testWildcardAndColumns() {
ScanLevelProjection scanProj = ScanLevelProjection.build(RowSetTestUtils.projectList(SchemaPath.DYNAMIC_STAR, ColumnsScanFramework.COLUMNS_COL), ScanTestUtils.parsers(new ColumnsArrayParser(true)));
assertTrue(scanProj.projectAll());
assertEquals(2, scanProj.requestedCols().size());
assertEquals(1, scanProj.columns().size());
assertEquals(ColumnsScanFramework.COLUMNS_COL, scanProj.columns().get(0).name());
// Verify column type
assertTrue(scanProj.columns().get(0) instanceof UnresolvedColumnsArrayColumn);
}
use of org.apache.drill.exec.physical.impl.scan.columns.UnresolvedColumnsArrayColumn in project drill by apache.
the class TestColumnsArrayParser method testColumnsArrayCaseInsensitive.
@Test
public void testColumnsArrayCaseInsensitive() {
// Sic: case variation of standard name
ScanLevelProjection scanProj = ScanLevelProjection.build(RowSetTestUtils.projectList("Columns"), ScanTestUtils.parsers(new ColumnsArrayParser(true)));
assertFalse(scanProj.projectAll());
assertEquals(1, scanProj.requestedCols().size());
assertEquals(1, scanProj.columns().size());
assertEquals("Columns", scanProj.columns().get(0).name());
// Verify column type
assertTrue(scanProj.columns().get(0) instanceof UnresolvedColumnsArrayColumn);
}
Aggregations