Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/integrations/datafusion/src/physical_plan/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ impl DisplayAs for IcebergTableScan {
self.predicates
.clone()
.map_or(String::from(""), |p| format!("{p}"))
)
)?;
if let Some(limit) = self.limit {
write!(f, " limit:[{limit}]")?;
}
Ok(())
}
}

Expand Down
12 changes: 12 additions & 0 deletions crates/sqllogictest/testdata/slts/df_test/basic_queries.slt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ INSERT INTO default.default.query_test_table VALUES
----
10

# Verify EXPLAIN shows limit is pushed down to IcebergTableScan
query TT
EXPLAIN SELECT * FROM default.default.query_test_table LIMIT 3
----
logical_plan
01)Limit: skip=0, fetch=3
02)--TableScan: default.default.query_test_table projection=[id, name, score, category], fetch=3
physical_plan
01)GlobalLimitExec: skip=0, fetch=3
02)--CooperativeExec
03)----IcebergTableScan projection:[id,name,score,category] predicate:[] limit:[3]

# Test SELECT * with ORDER BY and LIMIT
query ITRT
SELECT * FROM default.default.query_test_table ORDER BY id LIMIT 3
Expand Down