AHeise commented on a change in pull request #10573: [FLINK-13589] Fixing
DelimitedInputFormat for whole file input splits.
URL: https://github.com/apache/flink/pull/10573#discussion_r358202290
##########
File path:
flink-core/src/test/java/org/apache/flink/api/common/io/DelimitedInputFormatTest.java
##########
@@ -431,6 +431,34 @@ public void testDelimiterOnBufferBoundary() throws
IOException {
format.close();
}
+ @Test
+ public void testDelimiterOnBufferBoundaryWithWholeFileSplit() throws
IOException {
+
+ String[] records = new
String[]{"1234567890<DEL?NO!>1234567890", "1234567890<DEL?NO!>1234567890",
"<DEL?NO!>"};
+ String delimiter = "<DELIM>";
+ String fileContent = StringUtils.join(records, delimiter);
+
+
+ final FileInputSplit split = createTempFile(fileContent);
+ final FileInputSplit fullSplit = new FileInputSplit(0,
split.getPath(), 0, -1, split.getHostnames());
+ final Configuration parameters = new Configuration();
+
+ format.setBufferSize(12);
+ format.setDelimiter(delimiter);
+ format.configure(parameters);
+ format.open(fullSplit);
+
+ for (String record : records) {
+ String value = format.nextRecord(null);
+ assertEquals(record, value);
+ }
+
+ assertNull(format.nextRecord(null));
+ assertTrue(format.reachedEnd());
+
+ format.close();
Review comment:
All test cases include it, so my guess is that the authors also wanted to
test close itself and have after only as a fallback. So I'd leave that in.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services