Skip to content

Commit 245fa3c

Browse files
committed
add test_select_distinct_dimensions
1 parent 3822107 commit 245fa3c

File tree

1 file changed

+36
-0
lines changed
  • rust/cubesql/cubesql/src/compile

1 file changed

+36
-0
lines changed

rust/cubesql/cubesql/src/compile/mod.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8205,6 +8205,42 @@ ORDER BY "source"."str0" ASC
82058205
)
82068206
}
82078207

8208+
#[tokio::test]
8209+
async fn test_select_distinct_dimensions() {
8210+
if !Rewriter::sql_push_down_enabled() {
8211+
return;
8212+
}
8213+
init_testing_logger();
8214+
8215+
let logical_plan = convert_select_to_query_plan(
8216+
"SELECT DISTINCT customer_gender FROM \"KibanaSampleDataEcommerce\"".to_string(),
8217+
DatabaseProtocol::PostgreSQL,
8218+
)
8219+
.await
8220+
.as_logical_plan();
8221+
8222+
println!("logical_plan: {:?}", logical_plan);
8223+
8224+
assert_eq!(
8225+
logical_plan.find_cube_scan().request,
8226+
V1LoadRequestQuery {
8227+
measures: Some(vec![]),
8228+
dimensions: Some(vec![
8229+
// "KibanaSampleDataEcommerce.order_date".to_string(),
8230+
// "KibanaSampleDataEcommerce.last_mod".to_string(),
8231+
"KibanaSampleDataEcommerce.customer_gender".to_string(),
8232+
// "KibanaSampleDataEcommerce.notes".to_string(),
8233+
// "KibanaSampleDataEcommerce.taxful_total_price".to_string(),
8234+
// "KibanaSampleDataEcommerce.has_subscription".to_string(),
8235+
]),
8236+
segments: Some(vec![]),
8237+
order: Some(vec![]),
8238+
ungrouped: Some(false),
8239+
..Default::default()
8240+
}
8241+
)
8242+
}
8243+
82088244
#[tokio::test]
82098245
async fn test_sort_relations() -> Result<(), CubeError> {
82108246
init_testing_logger();

0 commit comments

Comments
 (0)