test: Add read_group test for missing fields (#2881)

* test: Add read_group test

* fix: Update to use o2 table
pull/24376/head
Andrew Lamb 2021-10-18 14:43:52 -04:00 committed by GitHub
parent bb661cef47
commit 30c3d1e001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 0 deletions

View File

@ -3,6 +3,7 @@ use crate::{
influxrpc::util::run_series_set_plan,
scenarios::{
make_two_chunk_scenarios, util::all_scenarios_for_one_chunk, DbScenario, DbSetup, NoData,
TwoMeasurementsManyFieldsOneChunk,
},
};
@ -925,3 +926,33 @@ async fn test_grouped_series_set_plan_group_measurement_tag_count() {
)
.await;
}
#[tokio::test]
async fn test_grouped_series_set_plan_group_field_pred_and_null_fields() {
// no predicate
let predicate = PredicateBuilder::default().table("o2").build();
let agg = Aggregate::Count;
let group_columns = vec!["state", "_field"];
// Expect the data is grouped so output is sorted by measurement and then region
let expected_results = vec![
"Group tag_keys: _field, _measurement, state partition_key_vals: CA, reading",
"Series tags={_field=reading, _measurement=o2, state=CA}\n IntegerPoints timestamps: [300], values: [0]",
"Group tag_keys: _field, _measurement, state partition_key_vals: CA, temp",
"Series tags={_field=temp, _measurement=o2, state=CA}\n IntegerPoints timestamps: [300], values: [1]",
"Group tag_keys: _field, _measurement, city, state partition_key_vals: MA, reading",
"Series tags={_field=reading, _measurement=o2, city=Boston, state=MA}\n IntegerPoints timestamps: [50], values: [1]",
"Group tag_keys: _field, _measurement, city, state partition_key_vals: MA, temp",
"Series tags={_field=temp, _measurement=o2, city=Boston, state=MA}\n IntegerPoints timestamps: [50], values: [1]",
];
run_read_group_test_case(
TwoMeasurementsManyFieldsOneChunk {},
predicate,
agg,
group_columns,
expected_results,
)
.await;
}