Skip to content

Commit 978e671

Browse files
committed
docs: simplify S3 SQL example wording
1 parent 0d0a29e commit 978e671

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

docs/source/user-guide/data-sources.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,21 @@ s3 = AmazonS3(
116116
)
117117

118118
path = f"s3://{bucket_name}/"
119-
ctx.register_object_store("s3://", s3, host=bucket_name)
119+
ctx.register_object_store("s3://", s3, None)
120120

121121
ctx.register_parquet("trips", path)
122122

123123
ctx.table("trips").show()
124124
```
125125

126-
### Use S3 in SQL
126+
### Query S3 data with SQL
127127

128-
Use `CREATE EXTERNAL TABLE` to give an S3 path a table name that you can query
129-
with SQL. The statement uses the object store registered for the bucket on the
130-
same {py:class}`~datafusion.context.SessionContext`.
128+
To reach the same data from SQL, give the S3 path a table name with
129+
`CREATE EXTERNAL TABLE`. The registered object store carries the credentials and
130+
the region, so the statement itself needs only the location.
131131

132-
After registering the object store above, create and query an external table:
132+
Register the store for the bucket as shown above, then use that same
133+
{py:class}`~datafusion.context.SessionContext` to create and query the table:
133134

134135
```python
135136
ctx.sql(

0 commit comments

Comments
 (0)