From eac59f523e08b12746ecf48a67446c4330e85215 Mon Sep 17 00:00:00 2001 From: Michael Gattozzi Date: Tue, 9 Jan 2024 12:07:53 -0500 Subject: [PATCH] fix: warnings for influxdb3 build This commit fixes the warnings emitted by `cargo build` when compiling influxdb3. Mainly it adds needed lifetimes and removes uneccesary imports and functions calls. --- iox_query_influxql/src/window/derivative.rs | 4 ++-- query_functions/src/window.rs | 2 +- service_grpc_flight/src/request.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iox_query_influxql/src/window/derivative.rs b/iox_query_influxql/src/window/derivative.rs index 4a486275c5a..42730d532c5 100644 --- a/iox_query_influxql/src/window/derivative.rs +++ b/iox_query_influxql/src/window/derivative.rs @@ -4,7 +4,7 @@ use arrow::datatypes::{DataType, TimeUnit}; use datafusion::common::{Result, ScalarValue}; use datafusion::logical_expr::{PartitionEvaluator, Signature, TypeSignature, Volatility}; use once_cell::sync::Lazy; -use std::borrow::Borrow; + use std::sync::Arc; /// The name of the derivative window function. @@ -99,7 +99,7 @@ impl PartitionEvaluator for DifferencePartitionEvaluator { } fn delta(curr: &ScalarValue, prev: &ScalarValue) -> Result { - match (curr.borrow(), prev.borrow()) { + match (curr, prev) { (ScalarValue::Float64(Some(curr)), ScalarValue::Float64(Some(prev))) => Ok(*curr - *prev), (ScalarValue::Int64(Some(curr)), ScalarValue::Int64(Some(prev))) => { Ok(*curr as f64 - *prev as f64) diff --git a/query_functions/src/window.rs b/query_functions/src/window.rs index 02cc1114348..ceabcdee633 100644 --- a/query_functions/src/window.rs +++ b/query_functions/src/window.rs @@ -1,6 +1,6 @@ mod internal; -pub use internal::{Duration, Window}; +pub use internal::{Duration}; use schema::TIME_DATA_TYPE; use std::sync::Arc; diff --git a/service_grpc_flight/src/request.rs b/service_grpc_flight/src/request.rs index d6afbdfa48a..2be07f2801e 100644 --- a/service_grpc_flight/src/request.rs +++ b/service_grpc_flight/src/request.rs @@ -130,7 +130,7 @@ impl Display for RunQuery { } impl IoxGetRequest { - const READ_INFO_TYPE_URL: &str = "type.googleapis.com/influxdata.iox.querier.v1.ReadInfo"; + const READ_INFO_TYPE_URL: &'static str = "type.googleapis.com/influxdata.iox.querier.v1.ReadInfo"; /// Create a new request to run the specified query pub fn new(database: impl Into, query: RunQuery, is_debug: bool) -> Self {