Skip to content

Commit

Permalink
ci(cubesql): Run unit tests for both top-down and bottom-up extractors (
Browse files Browse the repository at this point in the history
#8884)

Also remove duplicated test_wrapper_limit_zero
This case is already covered with compile::test::test_wrapper::test_wrapper_limit_zero
  • Loading branch information
mcheshkov authored Nov 7, 2024
1 parent 276ee09 commit 15afec1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/rust-cubesql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ jobs:
# We use host instead of cross container, because it's much faster
runs-on: ubuntu-24.04
timeout-minutes: 60
name: Unit (Rewrite Engine)
name: Unit (Rewrite Engine) (CUBESQL_TOP_DOWN_EXTRACTOR=${{ matrix.top-down-extractor }})
strategy:
matrix:
top-down-extractor: ['true', 'false']
fail-fast: false

steps:
- name: Checkout
Expand Down Expand Up @@ -90,6 +94,7 @@ jobs:
CUBESQL_TESTING_CUBE_TOKEN: ${{ secrets.CUBESQL_TESTING_CUBE_TOKEN }}
CUBESQL_TESTING_CUBE_URL: ${{ secrets.CUBESQL_TESTING_CUBE_URL }}
CUBESQL_SQL_PUSH_DOWN: true
CUBESQL_TOP_DOWN_EXTRACTOR: ${{ matrix.top-down-extractor }}
CUBESQL_REWRITE_CACHE: true
CUBESQL_REWRITE_TIMEOUT: 60
run: |
Expand Down
31 changes: 0 additions & 31 deletions rust/cubesql/cubesql/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16220,35 +16220,4 @@ LIMIT {{ limit }}{% endif %}"#.to_string(),

Ok(())
}

#[tokio::test]
async fn test_wrapper_limit_zero() {
if !Rewriter::sql_push_down_enabled() {
return;
}
init_testing_logger();

let query_plan = convert_select_to_query_plan(
r#"
SELECT MAX(order_date) FROM KibanaSampleDataEcommerce LIMIT 0
"#
.to_string(),
DatabaseProtocol::PostgreSQL,
)
.await;

let logical_plan = query_plan.as_logical_plan();
let sql = logical_plan
.find_cube_scan_wrapper()
.wrapped_sql
.unwrap()
.sql;
assert!(sql.contains("LIMIT 0"));

let physical_plan = query_plan.as_physical_plan().await.unwrap();
println!(
"Physical plan: {}",
displayable(physical_plan.as_ref()).indent()
);
}
}

0 comments on commit 15afec1

Please sign in to comment.