From 9a60af7fa3b480e2e04bacd646112cad9aaab6d7 Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Fri, 10 Sep 2021 09:25:03 +0200 Subject: [PATCH] docs: explain `ChunkOrder` query test scenario --- query_tests/src/scenarios.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/query_tests/src/scenarios.rs b/query_tests/src/scenarios.rs index f0e352b4d7..86df0e9a23 100644 --- a/query_tests/src/scenarios.rs +++ b/query_tests/src/scenarios.rs @@ -1170,6 +1170,21 @@ impl DbSetup for ChunkOrder { .clear_lifecycle_action() .unwrap(); + // Now we have the the following chunks (same partition and table): + // + // | ID | order | tag: region | field: user | time | + // | -- | ----- | ----------- | ----------- | ---- | + // | 1 | 1 | "west" | 2 | 100 | + // | 2 | 0 | "west" | 1 | 100 | + // + // The result after deduplication should be: + // + // | tag: region | field: user | time | + // | ----------- | ----------- | ---- | + // | "west" | 2 | 100 | + // + // So the query engine must use `order` as a primary key to sort chunks, NOT `id`. + let scenario = DbScenario { scenario_name: "chunks where chunk ID alone cannot be used for ordering".into(), db,