Skip to content

Commit

Permalink
fix ExecutionContext to SessionContext (#7903)
Browse files Browse the repository at this point in the history
Co-authored-by: ZENOTME <st810918843@gmail.com>
  • Loading branch information
ZENOTME and ZENOTME authored Oct 23, 2023
1 parent e57dd22 commit e34dd76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/library-user-guide/custom-table-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ For filters that can be pushed down, they'll be passed to the `scan` method as t

## Using the Custom Table Provider

In order to use the custom table provider, we need to register it with DataFusion. This is done by creating a `TableProvider` and registering it with the `ExecutionContext`.
In order to use the custom table provider, we need to register it with DataFusion. This is done by creating a `TableProvider` and registering it with the `SessionContext`.

```rust
let mut ctx = ExecutionContext::new();
let mut ctx = SessionContext::new();

let custom_table_provider = CustomDataSource::new();
ctx.register_table("custom_table", Arc::new(custom_table_provider));
Expand All @@ -160,7 +160,7 @@ To recap, in order to implement a custom table provider, you need to:

1. Implement the `TableProvider` trait
2. Implement the `ExecutionPlan` trait
3. Register the `TableProvider` with the `ExecutionContext`
3. Register the `TableProvider` with the `SessionContext`

## Next Steps

Expand Down

0 comments on commit e34dd76

Please sign in to comment.