Skip to content

Commit

Permalink
some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Jan 27, 2025
1 parent 0f04b7e commit b9cf2bb
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions rust/cubesql/cubesql/src/compile/rewrite/rules/members.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ impl RewriteRules for MemberRules {
"?members",
"?filters",
"?orders",
"?limit",
"?offset",
"CubeScanLimit:None",
"CubeScanOffset:None",
"?split",
"?can_pushdown_join",
"CubeScanWrapped:false",
Expand All @@ -281,14 +281,14 @@ impl RewriteRules for MemberRules {
"?members",
"?filters",
"?orders",
"?limit",
"?offset",
"CubeScanLimit:None",
"CubeScanOffset:None",
"?split",
"?can_pushdown_join",
"CubeScanWrapped:false",
"CubeScanUngrouped:false",
),
self.select_distinct_dimensions(/*"?members",*/ "?limit"),
self.select_distinct_dimensions(/*"?members"*/),
),
// MOD function to binary expr
transforming_rewrite_with_root(
Expand Down Expand Up @@ -1509,20 +1509,10 @@ impl MemberRules {
fn select_distinct_dimensions(
&self,
// members_var: &'static str,
limit_var: &'static str,
) -> impl Fn(&mut CubeEGraph, &mut Subst) -> bool {
// let members_var = var!(members_var);
let limit_var = var!(limit_var);

move |egraph, subst| {
let cube_limit = var_iter!(egraph[subst[limit_var]], CubeScanLimit)
.next()
.unwrap();

if cube_limit.is_some() {
return false;
}

move |_egraph, _subst| {
// for members in var_list_iter!(egraph[subst[members_var]], CubeScanMembers) {
// // TODO: check if all members in request are dimensions
// // If no - return false
Expand Down

0 comments on commit b9cf2bb

Please sign in to comment.