Skip to content

Commit

Permalink
fix(cubesql): Support CAST projection split
Browse files Browse the repository at this point in the history
  • Loading branch information
MazterQyou committed Jun 15, 2024
1 parent 57e1d74 commit 4df313d
Show file tree
Hide file tree
Showing 7 changed files with 688 additions and 230 deletions.
6 changes: 6 additions & 0 deletions packages/cubejs-backend-native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use itertools::Itertools;
use regex::{Captures, Regex};
use serde_derive::*;
use std::{
any::Any, collections::HashMap, convert::TryInto, fmt, future::Future, iter, pin::Pin, result,
sync::Arc,
any::Any, cmp::min, collections::HashMap, convert::TryInto, fmt, future::Future, iter,
pin::Pin, result, sync::Arc,
};

#[derive(Debug, Clone, Deserialize)]
Expand Down Expand Up @@ -373,13 +373,20 @@ impl CubeScanWrapperNode {
.cloned();
if let Some(node) = cube_scan_node {
let mut new_node = node.clone();
new_node.request.limit = Some(query_limit);
new_node.request.limit = Some(
new_node
.request
.limit
.map_or(query_limit, |limit| min(limit, query_limit)),
);
Arc::new(LogicalPlan::Extension(Extension {
node: Arc::new(new_node),
}))
} else if let Some(node) = wrapped_select_node {
let mut new_node = node.clone();
new_node.limit = Some(query_limit as usize);
new_node.limit = Some(new_node.limit.map_or(query_limit as usize, |limit| {
min(limit, query_limit as usize)
}));
Arc::new(LogicalPlan::Extension(Extension {
node: Arc::new(new_node),
}))
Expand Down
Loading

0 comments on commit 4df313d

Please sign in to comment.