Closed KOLANICH closed 8 months ago
Hey @KOLANICH sorry for the late reply. @metadaddy has worked with the backblaze tutorial. Pat, is there anything extra a python connection would need for B2?
Hi @KOLANICH - we're not running a Trino server at Backblaze - you have to run Trino yourself in Docker, following the instructions in the README. You use those credentials in this step, instead of creating your own bucket and application key.
If you wanted to access the data directly from Python, without running your own Trino instance, you could use DuckDB like this:
import duckdb
cursor = duckdb.connect()
cursor.execute("INSTALL httpfs");
cursor.execute("LOAD httpfs");
cursor.execute("SET s3_endpoint='s3.us-west-004.backblazeb2.com'");
cursor.execute("SET s3_region='us-west-004'");
cursor.execute("SET s3_access_key_id='0045f0571db506a0000000007'");
cursor.execute("SET s3_secret_access_key='K004cogT4GIeHHfhCyPPLsPBT4NyY1A'");
results = cursor.execute("SELECT COUNT(*) FROM 's3://drivestats-parquet/drivestats/*/*/*.parquet' WHERE year=2023 AND month=3 AND day=29").fetchall();
print(results)
@KOLANICH let me know if this solved your issue. Feel free to reopen if it doesn't.
I have tried
I guess it can be because I haven't filled the credentials:
Where should I put them?