MCPcopy Create free account
hub / github.com/apache/datafusion / table_limit

Function table_limit

datafusion/optimizer/src/optimize_projections/mod.rs:2106–2126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2104
2105 #[test]
2106 fn table_limit() -> Result<()> {
2107 let table_scan = test_table_scan()?;
2108 assert_eq!(3, table_scan.schema().fields().len());
2109 assert_fields_eq(&table_scan, vec!["a", "b", "c"]);
2110
2111 let plan = LogicalPlanBuilder::from(table_scan)
2112 .project(vec![col("c"), col("a")])?
2113 .limit(0, Some(5))?
2114 .build()?;
2115
2116 assert_fields_eq(&plan, vec!["c", "a"]);
2117
2118 assert_optimized_plan_equal!(
2119 plan,
2120 @r"
2121 Limit: skip=0, fetch=5
2122 Projection: test.c, test.a
2123 TableScan: test projection=[a, c]
2124 "
2125 )
2126 }
2127
2128 #[test]
2129 fn table_scan_without_projection() -> Result<()> {

Callers

nothing calls this directly

Calls 5

test_table_scanFunction · 0.50
assert_fields_eqFunction · 0.50
buildMethod · 0.45
limitMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…