use of org.apache.drill.common.exceptions.UserException in project drill by apache.
the class TestResultSetLoaderProjection method testScalarMapConflict.
@Test
public void testScalarMapConflict() {
List<SchemaPath> selection = RowSetTestUtils.projectList("col.child");
TupleMetadata schema = new SchemaBuilder().add("col", MinorType.VARCHAR).buildSchema();
ResultSetOptions options = new ResultSetOptionBuilder().projection(Projections.parse(selection)).readerSchema(schema).build();
try {
new ResultSetLoaderImpl(fixture.allocator(), options);
fail();
} catch (UserException e) {
assertTrue(e.getErrorType() == ErrorType.VALIDATION);
}
}
use of org.apache.drill.common.exceptions.UserException in project drill by apache.
the class TestResultSetLoaderProjection method testArrayMapConflict.
@Test
public void testArrayMapConflict() {
List<SchemaPath> selection = RowSetTestUtils.projectList("col.child");
TupleMetadata schema = new SchemaBuilder().addArray("col", MinorType.VARCHAR).buildSchema();
ResultSetOptions options = new ResultSetOptionBuilder().projection(Projections.parse(selection)).readerSchema(schema).build();
try {
new ResultSetLoaderImpl(fixture.allocator(), options);
fail();
} catch (UserException e) {
assertTrue(e.getErrorType() == ErrorType.VALIDATION);
}
}
use of org.apache.drill.common.exceptions.UserException in project drill by apache.
the class TestResultSetLoaderProjection method testScalarArrayConflict.
@Test
public void testScalarArrayConflict() {
List<SchemaPath> selection = RowSetTestUtils.projectList("col[0]");
TupleMetadata schema = new SchemaBuilder().add("col", MinorType.VARCHAR).buildSchema();
ResultSetOptions options = new ResultSetOptionBuilder().projection(Projections.parse(selection)).readerSchema(schema).build();
try {
new ResultSetLoaderImpl(fixture.allocator(), options);
fail();
} catch (UserException e) {
assertTrue(e.getErrorType() == ErrorType.VALIDATION);
}
}
use of org.apache.drill.common.exceptions.UserException in project drill by apache.
the class TestResultSetLoaderProjection method testArrayMapArrayConflict.
@Test
public void testArrayMapArrayConflict() {
List<SchemaPath> selection = RowSetTestUtils.projectList("col[0].child");
TupleMetadata schema = new SchemaBuilder().addArray("col", MinorType.VARCHAR).buildSchema();
ResultSetOptions options = new ResultSetOptionBuilder().projection(Projections.parse(selection)).readerSchema(schema).build();
try {
new ResultSetLoaderImpl(fixture.allocator(), options);
fail();
} catch (UserException e) {
assertTrue(e.getErrorType() == ErrorType.VALIDATION);
}
}
use of org.apache.drill.common.exceptions.UserException in project drill by apache.
the class TestResultSetLoaderProjection method testMapArrayConflict.
@Test
public void testMapArrayConflict() {
List<SchemaPath> selection = RowSetTestUtils.projectList("col[0]");
TupleMetadata schema = new SchemaBuilder().addMap("col").add("child", MinorType.VARCHAR).resumeSchema().buildSchema();
ResultSetOptions options = new ResultSetOptionBuilder().projection(Projections.parse(selection)).readerSchema(schema).build();
try {
new ResultSetLoaderImpl(fixture.allocator(), options);
fail();
} catch (UserException e) {
assertTrue(e.getErrorType() == ErrorType.VALIDATION);
}
}
Aggregations