Skip to content

Commit 3a5af7a

Browse files
committed
debug windows
Signed-off-by: Adam Gutglick <[email protected]>
1 parent 29bd646 commit 3a5af7a

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vortex-datafusion/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ vortex-utils = { workspace = true, features = ["dashmap"] }
4343
anyhow = { workspace = true }
4444
datafusion = { workspace = true }
4545
insta = { workspace = true }
46+
regex = { workspace = true }
4647
rstest = { workspace = true }
4748
tempfile = { workspace = true }
4849
tokio = { workspace = true, features = ["test-util", "rt-multi-thread", "fs"] }

vortex-datafusion/src/persistent/mod.rs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fn register_vortex_format_factory(
3737

3838
#[cfg(test)]
3939
mod tests {
40+
use std::path::Path;
4041
use std::sync::Arc;
4142

4243
use arrow_schema::DataType;
@@ -55,6 +56,7 @@ mod tests {
5556
use datafusion_expr::LogicalPlanBuilder;
5657
use datafusion_physical_plan::display::DisplayableExecutionPlan;
5758
use insta::assert_snapshot;
59+
use regex::Regex;
5860
use rstest::rstest;
5961
use tempfile::TempDir;
6062
use tempfile::tempdir;
@@ -66,7 +68,6 @@ mod tests {
6668
use vortex::array::arrays::VarBinArray;
6769
use vortex::array::validity::Validity;
6870
use vortex::buffer::buffer;
69-
use vortex::error::vortex_err;
7071
use vortex::file::WriteOptionsSessionExt;
7172
use vortex::session::VortexSession;
7273

@@ -100,8 +101,25 @@ mod tests {
100101
Validity::NonNullable,
101102
)?;
102103

104+
let regex = Regex::new(r".:\\")?;
105+
106+
// Windows paths like C:\ currently do not get handled correctly by
107+
// Path::parse (https://github.com/apache/arrow-rs-object-store/issues/499)
108+
// and we need to change the first \ into a /
109+
let fix_path = |path: &Path| -> String {
110+
let path = path.to_str().unwrap();
111+
if regex.is_match(path) {
112+
path.to_string().replacen("\\", "/", 1)
113+
} else {
114+
path.to_string()
115+
}
116+
};
117+
103118
let filepath = temp_dir.path().join("data.vortex");
104119

120+
let table_url = fix_path(temp_dir.path());
121+
let filepath = fix_path(filepath.as_path());
122+
105123
let mut f = OpenOptions::new()
106124
.write(true)
107125
.create(true)
@@ -116,12 +134,8 @@ mod tests {
116134

117135
let ctx = SessionContext::default();
118136
let format = Arc::new(VortexFormat::new(session));
119-
let table_url = ListingTableUrl::parse(
120-
temp_dir
121-
.path()
122-
.to_str()
123-
.ok_or_else(|| vortex_err!("Path is not valid UTF-8"))?,
124-
)?;
137+
138+
let table_url = ListingTableUrl::parse(table_url)?;
125139
assert!(table_url.is_collection());
126140

127141
let config = ListingTableConfig::new(table_url)

vortex-datafusion/src/persistent/opener.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl FileOpener for VortexOpener {
335335
})
336336
.try_flatten()
337337
.map(move |batch| {
338-
if projector.projection().column_indices().is_empty() {
338+
if projector.projection().as_ref().is_empty() {
339339
batch
340340
} else {
341341
batch.and_then(|b| projector.project_batch(&b))

0 commit comments

Comments
 (0)