From c6ef592ed3d39a21c871c226f44a88acca3813a0 Mon Sep 17 00:00:00 2001 From: Matt Green Date: Mon, 12 Aug 2024 10:43:01 -0700 Subject: [PATCH] add schema method --- crates/core/src/datastream.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/core/src/datastream.rs b/crates/core/src/datastream.rs index 4ce9451..8c31342 100644 --- a/crates/core/src/datastream.rs +++ b/crates/core/src/datastream.rs @@ -1,7 +1,7 @@ use futures::StreamExt; use std::{sync::Arc, time::Duration}; -use datafusion::common::{DataFusionError, Result}; +use datafusion::common::{DFSchema, DataFusionError, Result}; pub use datafusion::dataframe::DataFrame; use datafusion::dataframe::DataFrameWriteOptions; use datafusion::execution::SendableRecordBatchStream; @@ -19,7 +19,8 @@ pub struct DataStream { } impl DataStream { - pub fn schema(&self) -> Result { + pub fn schema(&self) -> &DFSchema { + self.df.schema() } pub fn filter(&self, predicate: Expr) -> Result {