Skip to content

Commit

Permalink
s/batching/chunking
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Jan 22, 2024
1 parent afb38ea commit 7a74188
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ mod not_in_batching {

#[connector_test(exclude(CockroachDb))]
async fn not_in_batch_filter(runner: Runner) -> TestResult<()> {
runner.query(r#"mutation { createManyTestModel(data: [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]) { count }}"#).await?.assert_success();

assert_error!(
runner,
with_id_excess!(
Expand All @@ -27,8 +25,6 @@ mod not_in_batching_cockroachdb {

#[connector_test]
async fn not_in_batch_filter(runner: Runner) -> TestResult<()> {
runner.query(r#"mutation { createManyTestModel(data: [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]) { count }}"#).await?.assert_success();

assert_error!(
runner,
with_id_excess!(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod in_selection_batching;
mod select_one_compound;
mod select_one_singular;
mod transactional_batch;
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
use query_engine_tests::*;

/// Port note: Batch size for testing is now 10 by default, not configurable (look at the direnv).
/// * QUERY_BATCH_SIZE for testing is 10, configured in direnv.
/// * It should be called QUERY_CHUNK_SIZE instead, because it's a knob to configure query chunking
/// which is splitting queries with more arguments than accepted by the database, in multiple
/// queries.
/// * WASM versions of the engine don't accept runtime configuration of this value so they default
/// the mininum supported by any database on a SQL family (eg. Postgres, MySQL, SQLite, SQL Server,
/// etc.) As such, in order to guarantee chunking happens, a large number of arguments --larger
/// than the default-- needs to be used, to have actual coverage of chunking code while exercising
/// WASM query engines.
#[test_suite(schema(schema))]
mod isb {
mod chunking {
use indoc::indoc;
use query_engine_tests::{assert_error, run_query};

Expand Down Expand Up @@ -34,8 +42,8 @@ mod isb {
schema.to_owned()
}

// "batching of IN queries" should "work when having more than the specified amount of items"
// TODO(joins): Excluded because we have no support for batched queries with joins. In practice, it should happen under much less circumstances
// "chunking of IN queries" should "work when having more than the specified amount of items"
// TODO(joins): Excluded because we have no support for chunked queries with joins. In practice, it should happen under much less circumstances
// TODO(joins): than with the query-based strategy, because we don't issue `WHERE IN (parent_ids)` queries anymore to resolve relations.
#[connector_test(exclude_features("relationJoins"))]
async fn in_more_items(runner: Runner) -> TestResult<()> {
Expand All @@ -52,8 +60,8 @@ mod isb {
Ok(())
}

// "ascending ordering of batched IN queries" should "work when having more than the specified amount of items"
// TODO(joins): Excluded because we have no support for batched queries with joins. In practice, it should happen under much less circumstances
// "ascending ordering of chunked IN queries" should "work when having more than the specified amount of items"
// TODO(joins): Excluded because we have no support for chunked queries with joins. In practice, it should happen under much less circumstances
// TODO(joins): than with the query-based strategy, because we don't issue `WHERE IN (parent_ids)` queries anymore to resolve relations.
#[connector_test(exclude_features("relationJoins"))]
async fn asc_in_ordering(runner: Runner) -> TestResult<()> {
Expand All @@ -70,8 +78,8 @@ mod isb {
Ok(())
}

// "ascending ordering of batched IN queries" should "work when having more than the specified amount of items"
// TODO(joins): Excluded because we have no support for batched queries with joins. In practice, it should happen under much less circumstances
// "ascending ordering of chunked IN queries" should "work when having more than the specified amount of items"
// TODO(joins): Excluded because we have no support for chunked queries with joins. In practice, it should happen under much less circumstances
// TODO(joins): than with the query-based strategy, because we don't issue `WHERE IN (parent_ids)` queries anymore to resolve relations.
#[connector_test(exclude_features("relationJoins"))]
async fn desc_in_ordering(runner: Runner) -> TestResult<()> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod aggregation;
mod batch;
mod batching;
mod chunking;
mod data_types;
mod distinct;
mod filters;
Expand Down

0 comments on commit 7a74188

Please sign in to comment.