-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathduckdb_tests.py
27 lines (24 loc) · 990 Bytes
/
duckdb_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import duckdb
import requests
with open("azure.duckdb_extension.gz", "wb") as f:
f.write(
requests.get(
"http://extensions.duckdb.org/v0.10.0/windows_amd64/azure.duckdb_extension.gz"
).content
)
emulator_con_str = "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;"
with duckdb.connect() as con:
con.execute(
f"""FORCE INSTALL azure;
INSTALL azure;
LOAD azure;
CREATE SECRET secret2 (
TYPE AZURE,
CONNECTION_STRING '{emulator_con_str}'
);"""
)
with con.cursor() as cur:
cur.execute(
"SELECT count(*) FROM read_parquet('azure://testlake/td/faker.parquet')"
)
print(cur.fetchall())