()
| 666 | } |
| 667 | |
| 668 | @Test |
| 669 | public void testLongCounterName() throws Exception { |
| 670 | // Pig now restricts the string size of its counter name to less than 64 characters. |
| 671 | PrintWriter w = new PrintWriter(new FileWriter("myinputfile")); |
| 672 | w.println("1\t2\t3"); |
| 673 | w.println("5\t3\t4"); |
| 674 | w.println("3\t4\t5"); |
| 675 | w.println("5\t6\t7"); |
| 676 | w.println("3\t7\t8"); |
| 677 | w.close(); |
| 678 | String longfilename = "longlonglonglonglonglonglonglonglonglonglonglongfilefilefilename"; |
| 679 | Util.copyFromLocalToCluster(cluster, "myinputfile", longfilename); |
| 680 | |
| 681 | PrintWriter w1 = new PrintWriter(new FileWriter(PIG_FILE)); |
| 682 | w1.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);"); |
| 683 | w1.println("B = load '" + longfilename + "' as (a0:int, a1:int, a2:int);"); |
| 684 | w1.println("C = join A by a0, B by a0;"); |
| 685 | w1.println("store C into '" + OUTPUT_FILE + "';"); |
| 686 | w1.close(); |
| 687 | |
| 688 | try { |
| 689 | String[] args = { "-x", execType, PIG_FILE }; |
| 690 | PigStats stats = PigRunner.run(args, new TestNotificationListener(execType)); |
| 691 | |
| 692 | assertTrue(stats.isSuccessful()); |
| 693 | |
| 694 | assertEquals(1, stats.getNumberJobs()); |
| 695 | List<InputStats> inputs = stats.getInputStats(); |
| 696 | assertEquals(2, inputs.size()); |
| 697 | for (InputStats instats : inputs) { |
| 698 | assertEquals(5, instats.getNumberRecords()); |
| 699 | } |
| 700 | } finally { |
| 701 | new File(PIG_FILE).delete(); |
| 702 | Util.deleteFile(cluster, OUTPUT_FILE); |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | @Test |
| 707 | public void testDuplicateCounterName() throws Exception { |
nothing calls this directly
no test coverage detected