Skip to content

Commit

Permalink
fix(cubesql): Allow to push LIMIT 0 to CubeScan
Browse files Browse the repository at this point in the history
  • Loading branch information
mcheshkov committed Nov 13, 2024
1 parent ba4a242 commit cad6918
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1621,17 +1621,13 @@ impl MemberRules {

let mut skip_value = None;
for skip in var_iter!(egraph[subst[skip_var]], LimitSkip) {
if skip.unwrap_or_default() > 0 {
skip_value = *skip;
break;
}
skip_value = *skip;
break;
}
let mut fetch_value = None;
for fetch in var_iter!(egraph[subst[fetch_var]], LimitFetch) {
if fetch.unwrap_or_default() > 0 {
fetch_value = *fetch;
break;
}
fetch_value = *fetch;
break;
}

let mut inner_skip_value = None;
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/src/compile/test/test_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ async fn select_agg_where_false() {
segments: Some(vec![]),
dimensions: Some(vec![]),
order: Some(vec![]),
limit: None,
limit: Some(0),
ungrouped: Some(true),
..Default::default()
}
Expand Down

0 comments on commit cad6918

Please sign in to comment.