initial commit
This commit is contained in:
16
save_schema.py
Normal file
16
save_schema.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import duckdb
|
||||
|
||||
def save_schema():
|
||||
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';")
|
||||
|
||||
rows = conn.execute("DESCRIBE SELECT * FROM read_parquet('s3://nearle/parquet/deliveries/*.parquet')").fetchall()
|
||||
with open('live_schema.txt', 'w') as f:
|
||||
for row in rows:
|
||||
f.write(f"{row[0]} ({row[1]})\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
save_schema()
|
||||
Reference in New Issue
Block a user