Parses and registers the pig script. @param fileName The Pig script file. @param aliasOverride The list of aliases to override in the Pig script. @throws IOException If the Pig script can't be parsed correctly.
(String fileName, Map<String, String> aliasOverride)
| 47 | * @throws IOException If the Pig script can't be parsed correctly. |
| 48 | */ |
| 49 | public void registerScript(String fileName, Map<String, String> aliasOverride) |
| 50 | throws IOException { |
| 51 | try { |
| 52 | InputStream compositeStream = Utils.getCompositeStream(new FileInputStream(fileName), pigContext.getProperties()); |
| 53 | GruntParser grunt = new GruntParser(new InputStreamReader(compositeStream), this, aliasOverride); |
| 54 | grunt.setInteractive(false); |
| 55 | grunt.parseStopOnError(true); |
| 56 | } catch (FileNotFoundException e) { |
| 57 | throw new IOException(e); |
| 58 | } catch (org.apache.pig.tools.pigscript.parser.ParseException e) { |
| 59 | throw new IOException(e); |
| 60 | } |
| 61 | } |
| 62 | } |
no test coverage detected