Set<WriteEntity> outputs, StringBuilder command,
LinkedHashMap<String, String> partSpec,
String indexTableName, String dbName){
// Don't try to index optimize the query to build the index
HiveConf.setBoolVar(builderConf, HiveConf.ConfVars.HIVEOPTINDEXFILTER, false);
Driver driver = new Driver(builderConf);
driver.compile(command.toString());
Task<?> rootTask = driver.getPlan().getRootTasks().get(0);
inputs.addAll(driver.getPlan().getInputs());
outputs.addAll(driver.getPlan().getOutputs());
IndexMetadataChangeWork indexMetaChange = new IndexMetadataChangeWork(partSpec,
indexTableName, dbName);
IndexMetadataChangeTask indexMetaChangeTsk = new IndexMetadataChangeTask();
indexMetaChangeTsk.setWork(indexMetaChange);