Skip to content

Commit 8ab2741

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

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

vortex-datafusion/src/persistent/mod.rs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ mod tests {
7979
#[case(None)]
8080
#[tokio::test]
8181
async fn query_file(#[case] limit: Option<usize>) -> anyhow::Result<()> {
82+
use datafusion::functions_aggregate::count::count;
83+
use datafusion_expr::Expr;
84+
use datafusion_expr::utils::COUNT_STAR_EXPANSION;
85+
8286
let session = VortexSession::default();
8387
let temp_dir = tempdir()?;
8488
let strings = ChunkedArray::from_iter([
@@ -116,12 +120,13 @@ mod tests {
116120

117121
let ctx = SessionContext::default();
118122
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-
)?;
123+
124+
let table_url = temp_dir
125+
.path()
126+
.to_str()
127+
.ok_or_else(|| vortex_err!("Path is not valid UTF-8"))?;
128+
dbg!(table_url);
129+
let table_url = ListingTableUrl::parse(table_url)?;
125130
assert!(table_url.is_collection());
126131

127132
let config = ListingTableConfig::new(table_url)
@@ -134,6 +139,18 @@ mod tests {
134139
let listing_table = Arc::new(ListingTable::try_new(config)?);
135140

136141
ctx.register_table("vortex_tbl", listing_table as _)?;
142+
let count_df = ctx.table("vortex_tbl").await?.aggregate(
143+
vec![],
144+
vec![count(Expr::Literal(COUNT_STAR_EXPANSION, None))],
145+
)?;
146+
147+
let plan = count_df.create_physical_plan().await?;
148+
println!(
149+
"{}",
150+
DisplayableExecutionPlan::new(plan.as_ref())
151+
.set_show_schema(true)
152+
.tree_render()
153+
);
137154
let total_row_count = ctx.table("vortex_tbl").await?.count().await?;
138155
assert_eq!(total_row_count, 8);
139156

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)