Skip to content

Commit

Permalink
feat: copy filter files with path only. (databendlabs#12527)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun authored and andylokandy committed Nov 27, 2023
1 parent 244cf71 commit 23a2269
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions src/query/service/src/sessions/query_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,32 +675,13 @@ impl TableContext for QueryContext {
);
// Colored
for file in chunk {
if let Some(copied_file) = copied_files.get(&file.path) {
match &copied_file.etag {
Some(copied_etag) => {
if let Some(file_etag) = &file.etag {
// Check the 7 bytes etag prefix.
if file_etag.starts_with(copied_etag) {
continue;
}
}
}
None => {
// etag is none, compare with content_length and last_modified.
if copied_file.content_length == file.size
&& copied_file.last_modified == Some(file.last_modified)
{
continue;
}
}
if !copied_files.contains_key(&file.path) {
results.push(file.clone());
limit += 1;
if limit == max_files {
return Ok(results);
}
}

results.push(file.clone());
limit += 1;
if limit == max_files {
return Ok(results);
}
}
}
Ok(results)
Expand Down

0 comments on commit 23a2269

Please sign in to comment.