Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use limit() function instead of show_limit() in the first example #4369

Merged
merged 1 commit into from
Nov 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use limit() function instead of show_limit() in the first example
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Nov 25, 2022
commit 37ba07e20d3c5cd69a1a0fa4abc775b066885b2d
10 changes: 6 additions & 4 deletions docs/source/user-guide/example-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ async fn main() -> datafusion::error::Result<()> {
let df = ctx.read_csv("tests/example.csv", CsvReadOptions::new()).await?;

let df = df.filter(col("a").lt_eq(col("b")))?
.aggregate(vec![col("a")], vec![min(col("b"))])?;
.aggregate(vec![col("a")], vec![min(col("b"))])?
.limit(0, Some(100))?;

// execute and print results
df.show_limit(100).await?;
df.show().await?;
Ok(())
}
```
Expand Down Expand Up @@ -118,10 +119,11 @@ async fn main() -> datafusion::error::Result<()> {
let df = ctx.read_csv("tests/capitalized_example.csv", CsvReadOptions::new()).await?;

let df = df.filter(col("A").lt_eq(col("c")))?
.aggregate(vec![col("A")], vec![min(col("b"))])?;
.aggregate(vec![col("A")], vec![min(col("b"))])?
.limit(0, Some(100))?;

// execute and print results
df.show_limit(100).await?;
df.show().await?;
Ok(())
}
```
Expand Down