}
@Override
public HiveDriverFilterHookResult postDriverFetch( HiveDriverFilterHookContext hookContext)
throws Exception {
HiveDriverFilterHookResult hookResult = new HiveDriverFilterHookResultImpl();
HiveOperation hiveOperation = hookContext.getHiveOperation();
List<String> queryResult = new ArrayList<String>();
queryResult = hookContext.getResult();
List<String> filteredResult = null;
String userName = hookContext.getUserName();
String operationName = hiveOperation.getOperationName();
if ("SHOWTABLES".equalsIgnoreCase(operationName)) {
filteredResult = filterShowTables(queryResult, hiveOperation, userName,
hookContext.getDbName());
} else if ("SHOWDATABASES".equalsIgnoreCase(operationName)) {
filteredResult = filterShowDatabases(queryResult, hiveOperation, userName);
}
hookResult.setHiveOperation(hiveOperation);
hookResult.setResult(filteredResult);
hookResult.setUserName(userName);
hookResult.setConf(hookContext.getConf());
return hookResult;
}