Skip to content

Commit 9f34c76

Browse files
committed
Strip prefix of stage
Signed-off-by: Xuanwo <github@xuanwo.io>
1 parent 2e9b693 commit 9f34c76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/query/service/src/interpreters/interpreter_common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ pub async fn list_files_from_dal(
153153
) -> Result<Vec<StageFile>> {
154154
let rename_me_qry_ctx: Arc<dyn TableContext> = ctx.clone();
155155
let op = StageSourceHelper::get_op(&rename_me_qry_ctx, stage).await?;
156+
let prefix = stage.get_prefix();
156157
let mut files = Vec::new();
157158

158159
// - If the path itself is a dir, return directly.
@@ -177,7 +178,7 @@ pub async fn list_files_from_dal(
177178
let mut ds = op.batch().walk_top_down(&dir)?;
178179
while let Some(de) = ds.try_next().await? {
179180
if de.mode().is_file() {
180-
let path = de.name().to_string();
181+
let path = de.path().trim_start_matches(&prefix).to_string();
181182
let meta = de.metadata().await?;
182183
files.push((path, meta));
183184
}

0 commit comments

Comments
 (0)