You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/06/17 10:47:24 UTC

[GitHub] [flink] liujiawinds opened a new pull request, #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

liujiawinds opened a new pull request, #20006:
URL: https://github.com/apache/flink/pull/20006

   
   ## What is the purpose of the change
   
   Read empty csv file throws exception in FileSystem table connector. 
   
   
   ## Brief change log
   
     - *Remove size check, so `StreamFormatAdapter` can read empty files *
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - *Added integration tests for reading empty csv file*
     - *Added test that validates that `StreamFormatAdapter` read empty file*
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
   


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] liujiawinds commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by GitBox <gi...@apache.org>.
liujiawinds commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1160143315

   @JingsongLi Please take a look.


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] liujiawinds commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by GitBox <gi...@apache.org>.
liujiawinds commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1159871386

   @reswqa Thanks for your review.


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] snuyanzin commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1621059659

   Friendly reminder: before merging please be sure it passes ci
   
   it seems this PR merged is the reason of a blocker issue https://issues.apache.org/jira/browse/FLINK-32539


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1158755870

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0d5014acaf1fd24eeec59a265a607f34468545e5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0d5014acaf1fd24eeec59a265a607f34468545e5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0d5014acaf1fd24eeec59a265a607f34468545e5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] wanglijie95 commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by "wanglijie95 (via GitHub)" <gi...@apache.org>.
wanglijie95 commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1442775810

   @flinkbot run azure


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] dannycranmer merged pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer merged PR #20006:
URL: https://github.com/apache/flink/pull/20006


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] dannycranmer commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1621126555

   Apologies, taking a look


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] reswqa commented on a diff in pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by GitBox <gi...@apache.org>.
reswqa commented on code in PR #20006:
URL: https://github.com/apache/flink/pull/20006#discussion_r901136039


##########
flink-connectors/flink-connector-files/src/test/java/org/apache/flink/connector/file/src/impl/StreamFormatAdapterTest.java:
##########
@@ -83,6 +85,26 @@ void testBatchSizeIsRecordMultiple() throws IOException {
         simpleReadTest(20);
     }
 
+    @Test
+    public void testReadEmptyFile() throws IOException {

Review Comment:
   ```suggestion
       void testReadEmptyFile() throws IOException {
   ```



##########
flink-connectors/flink-connector-files/src/test/java/org/apache/flink/connector/file/src/impl/StreamFormatAdapterTest.java:
##########
@@ -83,6 +85,26 @@ void testBatchSizeIsRecordMultiple() throws IOException {
         simpleReadTest(20);
     }
 
+    @Test
+    public void testReadEmptyFile() throws IOException {
+        final StreamFormatAdapter<Integer> format =
+                new StreamFormatAdapter<>(new CheckpointedIntFormat());
+
+        final File emptyFile = new File(tmpDir.toFile(), "testFile-empty");
+        emptyFile.createNewFile();
+        Path emptyFilePath = Path.fromLocalFile(emptyFile);
+
+        final BulkFormat.Reader<Integer> reader =
+                format.createReader(
+                        new Configuration(),
+                        new FileSourceSplit("test-id", emptyFilePath, 0L, 0, 0L, 0));
+
+        final List<Integer> result = new ArrayList<>();
+        readNumbers(reader, result, 0);
+
+        assertThat(result).hasSize(0);

Review Comment:
   ```suggestion
           assertThat(result).isEmpty();
   ```



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] dannycranmer commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1582176493

   @flinkbot run azure


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] dannycranmer commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1618254033

   @flinkbot run azure


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] dannycranmer commented on pull request #20006: [FLINK-27415][Connectors / FileSystem] Read empty csv file throws exception in FileSystem table connector

Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer commented on PR #20006:
URL: https://github.com/apache/flink/pull/20006#issuecomment-1620612034

   Given that the CI failure is not related, merging this.


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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org