This is an automated email from the ASF dual-hosted git repository.
jonah pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 0a57469f67 Minor: remove unused `AutoFinishBzEncoder` (#14630)
0a57469f67 is described below
commit 0a57469f6779c32d5765a7aeed6612e92fa1ef21
Author: Jonah Gao <[email protected]>
AuthorDate: Thu Feb 13 07:20:37 2025 +0800
Minor: remove unused `AutoFinishBzEncoder` (#14630)
---
datafusion/core/src/test/mod.rs | 29 +++--------------------------
1 file changed, 3 insertions(+), 26 deletions(-)
diff --git a/datafusion/core/src/test/mod.rs b/datafusion/core/src/test/mod.rs
index f2fef06c8f..5b7a9d8a16 100644
--- a/datafusion/core/src/test/mod.rs
+++ b/datafusion/core/src/test/mod.rs
@@ -96,28 +96,6 @@ pub fn scan_partitioned_csv(
Ok(config.new_exec())
}
-/// Auto finish the wrapped BzEncoder on drop
-#[cfg(feature = "compression")]
-struct AutoFinishBzEncoder<W: Write>(BzEncoder<W>);
-
-#[cfg(feature = "compression")]
-impl<W: Write> Write for AutoFinishBzEncoder<W> {
- fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
- self.0.write(buf)
- }
-
- fn flush(&mut self) -> std::io::Result<()> {
- self.0.flush()
- }
-}
-
-#[cfg(feature = "compression")]
-impl<W: Write> Drop for AutoFinishBzEncoder<W> {
- fn drop(&mut self) {
- let _ = self.0.try_finish();
- }
-}
-
/// Returns file groups [`Vec<Vec<PartitionedFile>>`] for scanning
`partitions` of `filename`
pub fn partitioned_file_groups(
path: &str,
@@ -159,10 +137,9 @@ pub fn partitioned_file_groups(
Box::new(encoder)
}
#[cfg(feature = "compression")]
- FileCompressionType::BZIP2 =>
Box::new(AutoFinishBzEncoder(BzEncoder::new(
- file,
- BzCompression::default(),
- ))),
+ FileCompressionType::BZIP2 => {
+ Box::new(BzEncoder::new(file, BzCompression::default()))
+ }
#[cfg(not(feature = "compression"))]
FileCompressionType::GZIP
| FileCompressionType::BZIP2
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]