Tests the case where a bzip block ends exactly at the end of the input split (byte aligned with the last byte) and the last byte is a carriage return.
()
| 420 | * return. |
| 421 | */ |
| 422 | @Test |
| 423 | public void testBlockHeaderEndingWithCR() throws IOException { |
| 424 | String inputFileName = |
| 425 | "test/org/apache/pig/test/data/blockEndingInCR.txt.bz2"; |
| 426 | // number of lines in above file (the value is 1 more than bzcat | wc -l |
| 427 | // since there is a '\r' which is also treated as a record delim |
| 428 | Long expectedCount = 82094L; |
| 429 | // the first block in the above file exactly ends at the byte at |
| 430 | // position 136498 and the last byte is a carriage return ('\r') |
| 431 | try { |
| 432 | int splitSize = 136498; |
| 433 | Util.copyFromLocalToCluster(cluster, inputFileName, inputFileName); |
| 434 | testCount(inputFileName, expectedCount, splitSize, "PigStorage()"); |
| 435 | } finally { |
| 436 | Util.deleteFile(cluster, inputFileName); |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Tests the case where a bzip block ends exactly at the end of the input |
nothing calls this directly
no test coverage detected