chenkovsky commented on code in PR #16342: URL: https://github.com/apache/datafusion/pull/16342#discussion_r2185571139
########## datafusion/datasource/src/file_sink_config.rs: ########## @@ -77,13 +79,34 @@ pub trait FileSink: DataSink { .runtime_env() .object_store(&config.object_store_url)?; let (demux_task, file_stream_rx) = start_demuxer_task(config, data, context); - self.spawn_writer_tasks_and_join( - context, - demux_task, - file_stream_rx, - object_store, - ) - .await + let mut num_rows = self + .spawn_writer_tasks_and_join( + context, + demux_task, + file_stream_rx, + Arc::clone(&object_store), + ) + .await?; + if num_rows == 0 { + // If no rows were written, then no files are output either. Review Comment: @alamb I think we need to define 'empty' in datafusion clearly. currently it's vec![] https://github.com/apache/datafusion/blob/a7151730a6c65a62793d293557ca15e975fcb701/datafusion/physical-plan/src/empty.rs#L70 , I guess brunal uses `vec![empty_record_batch]`. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org