From aacc33d9b206f6403ade0fa21c1b6ba0c9768fe1 Mon Sep 17 00:00:00 2001 From: "Heres, Daniel" Date: Tue, 22 Dec 2020 00:07:38 +0100 Subject: [PATCH 1/3] Add logger --- rust/arrow-flight/src/arrow.flight.protocol.rs | 5 +++-- rust/benchmarks/Cargo.toml | 3 ++- rust/benchmarks/src/bin/tpch.rs | 2 ++ rust/datafusion/Cargo.toml | 1 + rust/datafusion/src/execution/context.rs | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/rust/arrow-flight/src/arrow.flight.protocol.rs b/rust/arrow-flight/src/arrow.flight.protocol.rs index 871eb506b26..1ede9c5f269 100644 --- a/rust/arrow-flight/src/arrow.flight.protocol.rs +++ b/rust/arrow-flight/src/arrow.flight.protocol.rs @@ -498,8 +498,9 @@ pub mod flight_service_server { #[async_trait] pub trait FlightService: Send + Sync + 'static { #[doc = "Server streaming response type for the Handshake method."] - type HandshakeStream: Stream> - + Send + type HandshakeStream: Stream< + Item = Result, + > + Send + Sync + 'static; #[doc = ""] diff --git a/rust/benchmarks/Cargo.toml b/rust/benchmarks/Cargo.toml index 6017d88e1e0..617c1c5d02b 100644 --- a/rust/benchmarks/Cargo.toml +++ b/rust/benchmarks/Cargo.toml @@ -31,4 +31,5 @@ parquet = { path = "../parquet" } datafusion = { path = "../datafusion" } structopt = { version = "0.3", default-features = false } tokio = { version = "0.2", features = ["macros", "rt-core", "rt-threaded"] } -futures = "0.3" \ No newline at end of file +futures = "0.3" +env_logger = "^0.8" \ No newline at end of file diff --git a/rust/benchmarks/src/bin/tpch.rs b/rust/benchmarks/src/bin/tpch.rs index 37eb0bcb61f..16048365291 100644 --- a/rust/benchmarks/src/bin/tpch.rs +++ b/rust/benchmarks/src/bin/tpch.rs @@ -109,6 +109,8 @@ async fn main() -> Result<()> { } async fn benchmark(opt: BenchmarkOpt) -> Result<()> { + env_logger::init(); + println!("Running benchmarks with the following options: {:?}", opt); let config = ExecutionConfig::new() .with_concurrency(opt.concurrency) diff --git a/rust/datafusion/Cargo.toml b/rust/datafusion/Cargo.toml index 9ca36108d35..d39cb33e346 100644 --- a/rust/datafusion/Cargo.toml +++ b/rust/datafusion/Cargo.toml @@ -59,6 +59,7 @@ chrono = "0.4" async-trait = "0.1.41" futures = "0.3" pin-project-lite= "^0.2.0" +log = "^0.4" tokio = { version = "0.2", features = ["macros", "rt-core", "rt-threaded"] } [dev-dependencies] diff --git a/rust/datafusion/src/execution/context.rs b/rust/datafusion/src/execution/context.rs index 33d84e1c310..9e98617d7dd 100644 --- a/rust/datafusion/src/execution/context.rs +++ b/rust/datafusion/src/execution/context.rs @@ -16,7 +16,7 @@ // under the License. //! ExecutionContext contains methods for registering data sources and executing queries - +use log::debug; use crate::optimizer::hash_build_probe_order::HashBuildProbeOrder; use std::fs; use std::path::Path; @@ -316,9 +316,11 @@ impl ExecutionContext { /// Optimize the logical plan by applying optimizer rules pub fn optimize(&self, plan: &LogicalPlan) -> Result { // Apply standard rewrites and optimizations + debug!("Logical plan:\n {:?}", plan); let mut plan = ProjectionPushDown::new().optimize(&plan)?; plan = FilterPushDown::new().optimize(&plan)?; plan = HashBuildProbeOrder::new().optimize(&plan)?; + debug!("Optimized logical plan:\n {:?}", plan); self.state .lock() From 09d2d52d5ec1b2dab368cbc0e783a8c347b01d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Heres?= Date: Tue, 22 Dec 2020 00:32:50 +0100 Subject: [PATCH 2/3] Format --- rust/datafusion/src/execution/context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/datafusion/src/execution/context.rs b/rust/datafusion/src/execution/context.rs index 9e98617d7dd..eddefb11005 100644 --- a/rust/datafusion/src/execution/context.rs +++ b/rust/datafusion/src/execution/context.rs @@ -16,8 +16,8 @@ // under the License. //! ExecutionContext contains methods for registering data sources and executing queries -use log::debug; use crate::optimizer::hash_build_probe_order::HashBuildProbeOrder; +use log::debug; use std::fs; use std::path::Path; use std::string::String; From d4fb3b1e3e4e6800bf48e7c72fb7d480acbdbf2d Mon Sep 17 00:00:00 2001 From: "Heres, Daniel" Date: Tue, 22 Dec 2020 13:37:27 +0100 Subject: [PATCH 3/3] Add log back --- rust/datafusion/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/datafusion/Cargo.toml b/rust/datafusion/Cargo.toml index 3108f0c5cee..8148565cb7e 100644 --- a/rust/datafusion/Cargo.toml +++ b/rust/datafusion/Cargo.toml @@ -60,6 +60,7 @@ async-trait = "0.1.41" futures = "0.3" pin-project-lite= "^0.2.0" tokio = { version = "0.2", features = ["macros", "rt-core", "rt-threaded", "sync"] } +log = "^0.4" [dev-dependencies] rand = "0.7"