()
| 333 | } |
| 334 | |
| 335 | @Override |
| 336 | public PigStats call() throws Exception { |
| 337 | LOG.info("Query to run:\n" + query); |
| 338 | PigContext pc = scriptContext.getPigContext(); |
| 339 | ScriptState scriptState = pc.getExecutionEngine().instantiateScriptState(); |
| 340 | ScriptState.start(scriptState); |
| 341 | ScriptState.get().setScript(query); |
| 342 | ScriptState.get().registerListener(adaptor); |
| 343 | PigServer pigServer = new PigServer(ctx, true); |
| 344 | GruntParser grunt = new GruntParser(new StringReader(query), pigServer); |
| 345 | grunt.setInteractive(false); |
| 346 | try { |
| 347 | grunt.parseStopOnError(false); |
| 348 | } catch (ParseException e) { |
| 349 | throw new IOException("Failed to parse script", e); |
| 350 | } |
| 351 | return PigStats.get(); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | } |
no test coverage detected