From 96fb595cc0a4dde98451eb923c2e4300e4af9622 Mon Sep 17 00:00:00 2001 From: Edd Robinson Date: Mon, 14 Jun 2021 10:22:05 +0100 Subject: [PATCH] refactor: read_filter debugging --- query/src/exec.rs | 35 ++++++++++++++++++++++++ src/influxdb_ioxd/rpc/storage/service.rs | 3 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/query/src/exec.rs b/query/src/exec.rs index 6c79a99c20..f5dabe1e40 100644 --- a/query/src/exec.rs +++ b/query/src/exec.rs @@ -11,6 +11,7 @@ pub mod stringset; mod task; pub use context::{DEFAULT_CATALOG, DEFAULT_SCHEMA}; use futures::{future, Future}; +use observability_deps::tracing::debug; use std::sync::Arc; @@ -190,6 +191,40 @@ impl Executor { results.extend(handle?.into_iter()); } + // TEMP(edd): attempting to get more insight into series frame + // construction. + // + // Consider removing as very noisy + // + for (i, result) in results.iter().enumerate() { + if let SeriesSetItem::Data(item) = result { + if i == 0 { + // emit batch used across the series set. + // + // TEMP(edd): clones record batch. + // + if let Ok(rb) = + arrow::util::pretty::pretty_format_batches(&[item.batch.clone()]) + { + debug!("record batch {}", rb); + } + } + + let tags = item + .tags + .iter() + .map(|(k, v)| format!(" ({}, {})", k, v)) + .collect::>(); + debug!( + table_name = item.table_name.as_ref(), + ?tags, + start_row = item.start_row, + num_rows = item.num_rows, + "series set item" + ); + } + } + // Ok(results) } diff --git a/src/influxdb_ioxd/rpc/storage/service.rs b/src/influxdb_ioxd/rpc/storage/service.rs index f8a58fcfd9..74296f1283 100644 --- a/src/influxdb_ioxd/rpc/storage/service.rs +++ b/src/influxdb_ioxd/rpc/storage/service.rs @@ -24,7 +24,7 @@ use generated_types::{ TimestampRange, }; use metrics::KeyValue; -use observability_deps::tracing::{error, info}; +use observability_deps::tracing::{debug, error, info}; use query::{ exec::fieldlist::FieldList, exec::seriesset::Error as SeriesSetError, predicate::PredicateBuilder, DatabaseStore, @@ -251,6 +251,7 @@ where .map(Ok) .collect::>(); + debug!(?results, "read_filter response"); ob.ok_with_labels(labels); Ok(tonic::Response::new(futures::stream::iter(results))) }