Merge branch 'main' into ntran/table_names

pull/24376/head
kodiakhq[bot] 2021-10-19 17:53:25 +00:00 committed by GitHub
commit 254a842eed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -1182,6 +1182,8 @@ impl InfluxRpcPlanner {
.sort(sort_exprs)
.context(BuildingPlan)?;
let plan_builder = cast_aggregates(plan_builder, agg, &field_columns)?;
// and finally create the plan
let plan = plan_builder.build().context(BuildingPlan)?;

View File

@ -166,6 +166,34 @@ async fn test_read_window_aggregate_nanoseconds_measurement_pred() {
.await;
}
#[tokio::test]
async fn test_read_window_aggregate_nanoseconds_measurement_count() {
// Expect that the type of `Count` is Integer
let predicate = PredicateBuilder::default()
.timestamp_range(100, 450)
.build();
let agg = Aggregate::Count;
let every = WindowDuration::from_nanoseconds(200);
let offset = WindowDuration::from_nanoseconds(0);
let expected_results = vec![
"Series tags={_field=temp, _measurement=h2o, city=Boston, state=MA}\n IntegerPoints timestamps: [200, 400, 600], values: [1, 2, 1]",
"Series tags={_field=temp, _measurement=h2o, city=Cambridge, state=MA}\n IntegerPoints timestamps: [200, 400, 600], values: [1, 2, 1]",
"Series tags={_field=temp, _measurement=h2o, city=LA, state=CA}\n IntegerPoints timestamps: [200, 400, 600], values: [1, 2, 1]",
];
run_read_window_aggregate_test_case(
MeasurementForWindowAggregate {},
predicate,
agg,
every,
offset,
expected_results,
)
.await;
}
struct MeasurementForWindowAggregateMonths {}
#[async_trait]
impl DbSetup for MeasurementForWindowAggregateMonths {