String[][] tables,
String query) throws Exception {
TajoTestingCluster util = new TajoTestingCluster();
util.startMiniClusterInLocal(1);
TajoConf conf = util.getConfiguration();
TajoClient client = new TajoClient(conf);
File tmpDir = util.setupClusterTestBuildDir();
for (int i = 0; i < tableNames.length; i++) {
File tableDir = new File(tmpDir,tableNames[i]);
tableDir.mkdirs();
File tableFile = new File(tableDir, tableNames[i]);
writeLines(tableFile, tables[i]);
TableMeta meta = CatalogUtil
.newTableMeta(schemas[i], CatalogProtos.StoreType.CSV, option);
client.createExternalTable(tableNames[i], new Path(tableDir.getAbsolutePath()), meta);
}
Thread.sleep(1000);
ResultSet res = client.executeQueryAndGetResult(query);
util.shutdownMiniCluster();
return res;
}