gyfora commented on a change in pull request #14174:
URL: https://github.com/apache/flink/pull/14174#discussion_r531124628



##########
File path: 
flink-java/src/test/java/org/apache/flink/api/java/io/CsvInputFormatTest.java
##########
@@ -67,24 +71,45 @@
 
        @Test
        public void testSplitCsvInputStreamInLargeBuffer() throws Exception {
-               testSplitCsvInputStream(1024 * 1024, false);
+               testSplitCsvInputStream(1024 * 1024, false, false);
+               testSplitCsvInputStream(1024 * 1024, false, true);
        }
 
        @Test
        public void testSplitCsvInputStreamInSmallBuffer() throws Exception {
-               testSplitCsvInputStream(2, false);
+               testSplitCsvInputStream(2, false, false);
+               testSplitCsvInputStream(1024 * 1024, false, true);
        }
 
-       private void testSplitCsvInputStream(int bufferSize, boolean 
failAtStart) throws Exception {
+       private void testSplitCsvInputStream(int bufferSize, boolean 
failAtStart, boolean compressed) throws Exception {
                final String fileContent =
                        "this is|1|2.0|\n" +
                        "a test|3|4.0|\n" +
                        "#next|5|6.0|\n" +
                        "asdadas|5|30.0|\n";
 
                // create temporary file with 3 blocks
-               final File tempFile = 
File.createTempFile("input-stream-decoration-test", "tmp");
-               tempFile.deleteOnExit();
+               final File tempFile;
+
+               if (compressed) {
+                       tempFile = File.createTempFile("TextInputFormatTest", 
".compressed");
+                       TextInputFormat.registerInflaterInputStreamFactory(
+                               "compressed",
+                               new InflaterInputStreamFactory<InputStream>() {
+                                       @Override
+                                       public InputStream create(InputStream 
in) throws IOException {
+                                               return in;
+                                       }
+
+                                       @Override
+                                       public Collection<String> 
getCommonFileExtensions() {
+                                               return 
Collections.singletonList("compressed");
+                                       }
+                               });
+               } else {
+                       tempFile = 
File.createTempFile("input-stream-decoration-test", ".tmp");
+                       tempFile.deleteOnExit();

Review comment:
       Will do




----------------------------------------------------------------
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]


Reply via email to