Merge pull request #3208 from influxdata/er/fix/grpc_influxql_multiple_time

fix: ensure time column not returned
pull/24376/head
kodiakhq[bot] 2021-11-24 18:30:28 +00:00 committed by GitHub
commit a9db30cdd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View File

@ -895,6 +895,11 @@ impl InfluxRpcPlanner {
})
.collect::<Vec<_>>();
// If the projection is empty then there is no plan to execute.
if select_exprs.is_empty() {
return Ok(None);
}
let plan = plan_builder
.project(select_exprs)
.context(BuildingPlan)?

View File

@ -46,6 +46,15 @@ where
}
}
#[tokio::test]
async fn list_tag_columns_with_no_tags() {
let predicate = PredicateBuilder::default().build();
run_tag_keys_test_case(OneMeasurementNoTags {}, predicate, vec![]).await;
let predicate = PredicateBuilder::default().timestamp_range(0, 1000).build();
run_tag_keys_test_case(OneMeasurementNoTags {}, predicate, vec![]).await;
}
#[tokio::test]
async fn list_tag_columns_no_predicate() {
let predicate = PredicateBuilder::default().build();

View File

@ -223,6 +223,25 @@ impl DbSetup for OneMeasurementRealisticTimes {
}
}
#[derive(Debug)]
pub struct OneMeasurementNoTags {}
#[async_trait]
impl DbSetup for OneMeasurementNoTags {
async fn make(&self) -> Vec<DbScenario> {
let partition_key = "1970-01-01T00";
let lp_lines = vec![
"h2o temp=70.4 100",
"h2o temp=72.4 250",
"h2o temp=50.4 200",
"h2o level=200.0 300",
];
// return all possible scenarios a chunk: MUB open, MUB frozen, RUB, RUB & OS, OS
all_scenarios_for_one_chunk(vec![], vec![], lp_lines, "h2o", partition_key).await
}
}
#[derive(Debug)]
pub struct OneMeasurementManyNullTags {}
#[async_trait]