public static ResultSet createResultSet(TajoClient client, SubmitQueryResponse response) throws IOException {
if (response.hasTableDesc()) {
TajoConf conf = new TajoConf(client.getConf());
conf.setVar(ConfVars.USERNAME, response.getUserName());
if (response.hasMaxRowNum()) {
return new TajoResultSet(
client,
QueryIdFactory.NULL_QUERY_ID,
conf,
new TableDesc(response.getTableDesc()),
response.getMaxRowNum());
} else {
return new TajoResultSet(
client,
QueryIdFactory.NULL_QUERY_ID,
conf,
new TableDesc(response.getTableDesc()));
}