This is a way to replace a pig query by another query.
For example, if we have this map of overrides: Map<alias,query>
It might be possible to do the same thing in a less hacky way. e.g. pig.registerQuery replace the query of a certain alias...
603604605606607608609610611612613614615616617
PigServer ps = new PigServer(ExecType.LOCAL, new Properties()); String script = getMkDirCommandForHadoop2_0(toLocalFileName) + "fs -cp " + fromLocalFileName + " " + toLocalFileName; new File(toLocalFileName).deleteOnExit(); GruntParser parser = new GruntParser(new StringReader(script)); parser.setInteractive(false); parser.setParams(ps); try { parser.parseStopOnError(); } catch (org.apache.pig.tools.pigscript.parser.ParseException e) { throw new IOException(e); } }