viirya commented on code in PR #5071: URL: https://github.com/apache/arrow-datafusion/pull/5071#discussion_r1087336452
########## datafusion/core/src/dataframe.rs: ########## @@ -361,6 +364,35 @@ impl DataFrame { Ok(DataFrame::new(self.session_state, plan)) } + /// Run a count aggregate on the DataFrame and execute the DataFrame to collect this + /// count and return it as a usize. + /// ``` + /// # use datafusion::prelude::*; + /// # use datafusion::error::Result; + /// # #[tokio::main] + /// # async fn main() -> Result<()> { + /// let ctx = SessionContext::new(); + /// let df = ctx.read_csv("tests/data/example.csv", CsvReadOptions::new()).await?; + /// let length = df.len().await?; + /// # Ok(()) + /// # } + /// ``` + pub async fn len(self) -> Result<usize> { Review Comment: Hmm, could it be `count`? For DataFrame-like API (pandas, Spark, etc.), there is commonly `count` for this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org