use of org.apache.drill.common.exceptions.UserRemoteException in project drill by apache.
the class TestCTTAS method testCreateWhenTemporaryTableExistsCaseInsensitive.
@Test(expected = UserRemoteException.class)
public void testCreateWhenTemporaryTableExistsCaseInsensitive() throws Exception {
String temporaryTableName = "temporary_table_exists_without_schema";
try {
test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", temporaryTableName);
test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", temporaryTableName.toUpperCase());
} catch (UserRemoteException e) {
assertThat(e.getMessage(), containsString(String.format("VALIDATION ERROR: A table or view with given name [%s]" + " already exists in schema [%s]", temporaryTableName.toUpperCase(), TEMP_SCHEMA)));
throw e;
}
}
use of org.apache.drill.common.exceptions.UserRemoteException in project drill by apache.
the class TestCTTAS method testCreateViewWhenTemporaryTableExists.
@Test(expected = UserRemoteException.class)
public void testCreateViewWhenTemporaryTableExists() throws Exception {
String temporaryTableName = "temporary_table_exists_before_view";
try {
test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", temporaryTableName);
test("create view %s.%s as select 'A' as c1 from (values(1))", TEMP_SCHEMA, temporaryTableName);
} catch (UserRemoteException e) {
assertThat(e.getMessage(), containsString(String.format("VALIDATION ERROR: A non-view table with given name [%s] already exists in schema [%s]", temporaryTableName, TEMP_SCHEMA)));
throw e;
}
}
use of org.apache.drill.common.exceptions.UserRemoteException in project drill by apache.
the class TestImpersonationQueries method testMultiLevelImpersonationExceedsMaxUserHops.
@Test
public void testMultiLevelImpersonationExceedsMaxUserHops() throws Exception {
UserRemoteException ex = null;
try {
updateClient(org1Users[5]);
test(String.format("SELECT * from %s.u4_lineitem LIMIT 1;", getWSSchema(org1Users[4])));
} catch (UserRemoteException e) {
ex = e;
}
assertNotNull("UserRemoteException is expected", ex);
assertThat(ex.getMessage(), containsString("Cannot issue token for view expansion as issuing the token exceeds the maximum allowed number " + "of user hops (3) in chained impersonation"));
}
use of org.apache.drill.common.exceptions.UserRemoteException in project drill by apache.
the class RequestIdMap method recordRemoteFailure.
public void recordRemoteFailure(int coordinationId, DrillPBError failure) {
// logger.debug("Updating failed future.");
try {
RpcOutcome<?> rpc = removeFromMap(coordinationId);
rpc.setException(new UserRemoteException(failure));
} catch (Exception ex) {
logger.warn("Failed to remove from map. Not a problem since we were updating on failed future.", ex);
}
}
use of org.apache.drill.common.exceptions.UserRemoteException in project drill by apache.
the class TestImpersonationMetadata method testShowFilesInWSWithNoPermissionsForQueryUser.
@Test
public void testShowFilesInWSWithNoPermissionsForQueryUser() throws Exception {
UserRemoteException ex = null;
updateClient(user2);
try {
// Try show tables in schema "drillTestGrp1_700" which is owned by "user1"
test(String.format("SHOW FILES IN %s.drillTestGrp1_700", MINIDFS_STORAGE_PLUGIN_NAME));
} catch (UserRemoteException e) {
ex = e;
}
assertNotNull("UserRemoteException is expected", ex);
assertThat(ex.getMessage(), containsString("Permission denied: user=drillTestUser2, " + "access=READ_EXECUTE, inode=\"/drillTestGrp1_700\":drillTestUser1:drillTestGrp1:drwx------"));
}
Aggregations