Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-27415

Read empty csv file throws exception in FileSystem table connector

    XMLWordPrintableJSON

Details

    Description

      // in CsvFilesystemBatchITCase
      @Test
      public void testEmpty() throws Exception {
          String path = new URI(resultPath()).getPath();
          new File(path).mkdirs();
          File file = new File(path, "test_file");
          file.createNewFile();
      
          check("select * from nonPartitionedTable", Collections.emptyList());
      } 

      Throws:

      Caused by: java.lang.IllegalArgumentException
          at org.apache.flink.util.Preconditions.checkArgument(Preconditions.java:122)
          at org.apache.flink.connector.file.src.impl.StreamFormatAdapter$TrackingFsDataInputStream.<init>(StreamFormatAdapter.java:264)
          at org.apache.flink.connector.file.src.impl.StreamFormatAdapter.lambda$openStream$3(StreamFormatAdapter.java:180)
          at org.apache.flink.connector.file.src.util.Utils.doWithCleanupOnException(Utils.java:45)
          at org.apache.flink.connector.file.src.impl.StreamFormatAdapter.openStream(StreamFormatAdapter.java:172)
          at org.apache.flink.connector.file.src.impl.StreamFormatAdapter.createReader(StreamFormatAdapter.java:70)
          at org.apache.flink.connector.file.src.impl.FileSourceSplitReader.checkSplitOrStartNext(FileSourceSplitReader.java:112)
          at org.apache.flink.connector.file.src.impl.FileSourceSplitReader.fetch(FileSourceSplitReader.java:65)
          at org.apache.flink.connector.base.source.reader.fetcher.FetchTask.run(FetchTask.java:58)
          at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:142)
          ... 6 more 

      This may be introduced by FLINK-24703 

      Attachments

        Issue Links

          Activity

            People

              sonice_lj jia liu
              lzljs3620320 Jingsong Lee
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: