initial commit
This commit is contained in:
18
test_s3.py
Normal file
18
test_s3.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import duckdb
|
||||
|
||||
def test_s3():
|
||||
try:
|
||||
conn = duckdb.connect()
|
||||
conn.execute("INSTALL httpfs; LOAD httpfs;")
|
||||
conn.execute("SET s3_region='sgp1';")
|
||||
conn.execute("SET s3_endpoint='sgp1.digitaloceanspaces.com';")
|
||||
conn.execute("SET s3_url_style='path';")
|
||||
|
||||
# Test if we can see the files
|
||||
res = conn.execute("SELECT count(*) FROM read_parquet('s3://nearle/parquet/deliveries/*.parquet')").fetchall()
|
||||
print(f"S3 Count: {res[0][0]}")
|
||||
except Exception as e:
|
||||
print(f"Error accessing S3: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_s3()
|
||||
Reference in New Issue
Block a user