Skip to content

Commit 5bc3fd9

Browse files
authored
chore: show file path when copy decompress fail. (#17732)
chore: show file path when decompress fail.
1 parent a7fbe8c commit 5bc3fd9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/query/storages/stage/src/read/row_based/processors/decompressor.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,21 @@ impl AccumulatingTransform for Decompressor {
8080
}
8181

8282
if let Some((de, offset)) = &mut self.decompressor {
83-
let mut data = de.decompress_batch(&batch.data)?;
83+
let mut data = de.decompress_batch(&batch.data).map_err(|e| {
84+
if let Some(p) = &self.path {
85+
e.add_detail_back(format!("file path: {p}"))
86+
} else {
87+
e
88+
}
89+
})?;
8490
if batch.is_eof {
85-
let mut end = de.decompress_batch(&[])?;
91+
let mut end = de.decompress_batch(&[]).map_err(|e| {
92+
if let Some(p) = &self.path {
93+
e.add_detail_back(format!("file path: {p}"))
94+
} else {
95+
e
96+
}
97+
})?;
8698
data.append(&mut end);
8799
let state = de.state();
88100
if !matches!(state, DecompressState::Done) {

0 commit comments

Comments
 (0)