use of org.apache.drill.exec.physical.impl.scan.v3.schema.ScanProjectionParser.ProjectionParseResult in project drill by apache.
the class TestProjectionParser method testProjectionAll.
/**
* Null map means everything is projected
*/
@Test
public void testProjectionAll() {
ProjectionParseResult result = ScanProjectionParser.parse(null);
assertEquals(0, result.wildcardPosn);
TupleMetadata projSet = result.dynamicSchema;
assertTrue(SchemaUtils.isProjectAll(projSet));
assertFalse(SchemaUtils.isProjectNone(projSet));
assertTrue(projSet.isEmpty());
}
use of org.apache.drill.exec.physical.impl.scan.v3.schema.ScanProjectionParser.ProjectionParseResult in project drill by apache.
the class TestProjectionParser method testProjectionNone.
/**
* Test an empty projection which occurs in a
* SELECT COUNT(*) query.
* Empty list means nothing is projected.
*/
@Test
public void testProjectionNone() {
ProjectionParseResult result = ScanProjectionParser.parse(Collections.emptyList());
assertEquals(-1, result.wildcardPosn);
TupleMetadata projSet = result.dynamicSchema;
assertFalse(SchemaUtils.isProjectAll(projSet));
assertTrue(SchemaUtils.isProjectNone(projSet));
assertTrue(projSet.isEmpty());
}
use of org.apache.drill.exec.physical.impl.scan.v3.schema.ScanProjectionParser.ProjectionParseResult in project drill by apache.
the class TestProjectedPath method testSimplePath.
@Test
public void testSimplePath() {
ProjectionParseResult result = ScanProjectionParser.parse(RowSetTestUtils.projectList("a"));
TupleMetadata projSet = result.dynamicSchema;
assertAllConsistent(projSet);
// No constraints on an unprojected column.
assertTrue(isConsistent(projSet, MetadataUtils.newScalar("b", Types.required(MinorType.INT))));
}
use of org.apache.drill.exec.physical.impl.scan.v3.schema.ScanProjectionParser.ProjectionParseResult in project drill by apache.
the class TestProjectedPath method test1DArray.
@Test
public void test1DArray() {
ProjectionParseResult result = ScanProjectionParser.parse(RowSetTestUtils.projectList("a[0]"));
TupleMetadata projSet = result.dynamicSchema;
assertNotConsistent(projSet, INT_COLUMN);
assertConsistent(projSet, INT_ARRAY_COLUMN);
assertNotConsistent(projSet, MAP_COLUMN);
assertConsistent(projSet, MAP_ARRAY_COLUMN);
assertConsistent(projSet, UNION_COLUMN);
assertConsistent(projSet, LIST_COLUMN);
assertConsistent(projSet, DICT_INT_INT_COLUMN);
// TODO: Enforce specific DICT keys, if needed.
// assertDictConsistent(projSet, DICT_INT_INT_COLUMN);
// assertDictConsistent(projSet, DICT_ARRAY_INT_INT_COLUMN);
// assertDictConsistent(projSet, DICT_ARRAY_INT_INT_ARRAY_COLUMN);
// assertDictConsistent(projSet, DICT_BIGINT_INT_COLUMN);
// assertDictConsistent(projSet, DICT_ARRAY_BIGINT_INT_COLUMN);
// assertDictNotConsistent(projSet, DICT_VARCHAR_INT_COLUMN);
// assertDictConsistent(projSet, DICT_ARRAY_VARCHAR_INT_COLUMN);
// assertDictConsistent(projSet, DICT_ARRAY_VARCHAR_INT_ARRAY_COLUMN);
// assertDictNotConsistent(projSet, DICT_DOUBLE_INT_COLUMN);
// assertDictConsistent(projSet, DICT_ARRAY_DOUBLE_INT_COLUMN);
}
use of org.apache.drill.exec.physical.impl.scan.v3.schema.ScanProjectionParser.ProjectionParseResult in project drill by apache.
the class TestProjectedPath method testProjectNone.
@Test
public void testProjectNone() {
ProjectionParseResult result = ScanProjectionParser.parse(RowSetTestUtils.projectNone());
// No constraints on empty projection
assertAllConsistent(result.dynamicSchema);
}
Aggregations