File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,20 +116,21 @@ s3 = AmazonS3(
116116)
117117
118118path = f " s3:// { bucket_name} / "
119- ctx.register_object_store(" s3://" , s3, host = bucket_name )
119+ ctx.register_object_store(" s3://" , s3, None )
120120
121121ctx.register_parquet(" trips" , path)
122122
123123ctx.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
135136ctx.sql(
You can’t perform that action at this time.
0 commit comments