JingsongLi commented on a change in pull request #13605: URL: https://github.com/apache/flink/pull/13605#discussion_r513207394
########## File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/FileSystemTableSource.java ########## @@ -88,7 +92,16 @@ private FileSystemTableSource( } @Override - public ScanRuntimeProvider getScanRuntimeProvider(ScanContext runtimeProviderContext) { + public ScanRuntimeProvider getScanRuntimeProvider(ScanContext scanContext) { + Optional<BulkDecodingFormat<RowData>> bulkDecodingFormat = discoverBulkDecodingFormat(); + + if (!partitionKeys.isEmpty() && getOrFetchPartitions().isEmpty()) { + // When this table has no partition, just return a empty source. + return InputFormatProvider.of(new CollectionInputFormat<>(new ArrayList<>(), null)); + } else if (bulkDecodingFormat.isPresent()) { + return SourceProvider.of(createBulkFormatSource(bulkDecodingFormat.get(), scanContext)); + } + return new DataStreamScanProvider() { @Override public DataStream<RowData> produceDataStream(StreamExecutionEnvironment execEnv) { Review comment: Indeed, we can! ---------------------------------------------------------------- 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: us...@infra.apache.org