()
| 359 | |
| 360 | |
| 361 | @Test |
| 362 | public void testJoinTupleFieldKey() throws Exception{ |
| 363 | String[] input1 = { |
| 364 | "(1,a)", |
| 365 | "(2,aa)" |
| 366 | }; |
| 367 | String[] input2 = { |
| 368 | "(1,b)", |
| 369 | "(2,bb)" |
| 370 | }; |
| 371 | |
| 372 | String firstInput = createInputFile("a.txt", input1); |
| 373 | String secondInput = createInputFile("b.txt", input2); |
| 374 | |
| 375 | String script = "a = load '"+ Util.encodeEscape(firstInput) +"' as (a:tuple(a1:int, a2:chararray));" + |
| 376 | "b = load '"+ Util.encodeEscape(secondInput) +"' as (b:tuple(b1:int, b2:chararray));" + |
| 377 | "c = join a by a.a1, b by b.b1;"; |
| 378 | Util.registerMultiLineQuery(pigServer, script); |
| 379 | Iterator<Tuple> it = pigServer.openIterator("c"); |
| 380 | |
| 381 | List<Tuple> expectedResults = Util.getTuplesFromConstantTupleStrings( |
| 382 | new String[] { |
| 383 | "((1,'a'),(1,'b'))", |
| 384 | "((2,'aa'),(2,'bb'))" |
| 385 | }); |
| 386 | Util.checkQueryOutputsAfterSort(it, expectedResults); |
| 387 | |
| 388 | deleteInputFile(firstInput); |
| 389 | deleteInputFile(secondInput); |
| 390 | } |
| 391 | |
| 392 | @Test |
| 393 | public void testJoinNullTupleFieldKey() throws Exception{ |
nothing calls this directly
no test coverage detected