| 1368 | } |
| 1369 | |
| 1370 | public Map<Operator, DataBag> getExamples(String alias) throws IOException { |
| 1371 | try { |
| 1372 | if (currDAG.isBatchOn() && alias != null) { |
| 1373 | currDAG.parseQuery(); |
| 1374 | currDAG.buildPlan( null ); |
| 1375 | execute(); |
| 1376 | } |
| 1377 | currDAG.parseQuery(); |
| 1378 | currDAG.skipStores(); |
| 1379 | currDAG.buildPlan( alias ); |
| 1380 | currDAG.compile(); |
| 1381 | } catch (IOException e) { |
| 1382 | //Since the original script is parsed anyway, there should not be an |
| 1383 | //error in this parsing. The only reason there can be an error is when |
| 1384 | //the files being loaded in load don't exist anymore. |
| 1385 | e.printStackTrace(); |
| 1386 | } |
| 1387 | |
| 1388 | ExampleGenerator exgen = new ExampleGenerator( currDAG.lp, pigContext ); |
| 1389 | try { |
| 1390 | return exgen.getExamples(); |
| 1391 | } catch (ExecException e) { |
| 1392 | e.printStackTrace(System.out); |
| 1393 | throw new IOException("ExecException" , e); |
| 1394 | } catch (Exception e) { |
| 1395 | e.printStackTrace(System.out); |
| 1396 | throw new IOException("Exception ", e); |
| 1397 | } |
| 1398 | |
| 1399 | } |
| 1400 | |
| 1401 | public void printHistory(boolean withNumbers) { |
| 1402 | |