Closed djouallah closed 1 year ago
!pip install databend > /dev/null 2>&1
import os
os.environ["DATABEND_DATA_PATH"] = "/lakehouse/default/Files"
from databend import SessionContext
ctx_bend = SessionContext("TPCH")
pwd = os.getcwd()
ctx_bend.sql(f"""create table if not exists t1(a int)""").collect()
ctx_bend.sql(f"""insert into t1 values(1)""").collect()
print(ctx_bend.sql(f"""select * from t1""").collect())
Error:
thread '<unnamed>' panicked at src/meta/sled-store/src/db.rs:47:34:
open global sled::Db: Io(NotFound, "io error")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---------------------------------------------------------------------------
PanicException Traceback (most recent call last)
Cell In[8], line 9
5 import os
6 os.environ["DATABEND_DATA_PATH"] = "/lakehouse/default/Files"
----> 9 from databend import SessionContext
10 ctx_bend = SessionContext("TPCH")
11 pwd = os.getcwd()
File ~/cluster-env/trident_env/lib/python3.10/site-packages/databend/__init__.py:1
----> 1 from .databend import *
3 __doc__ = databend.__doc__
4 if hasattr(databend, "__all__"):
PanicException: open global sled::Db: Io(NotFound, "io error")
Does the Databend python binding we can not do write? @sundy-li
Python do write, but here I am trying to write to a remote storage, Fabric notebook uses blob fuse
The latest version Databend now works in Fabric with the code:
!pip install databend > /dev/null 2>&1
import os
os.environ["DATABEND_DATA_PATH"] = "/lakehouse/default/Files"
from databend import SessionContext
ctx_bend = SessionContext("TPCH")
pwd = os.getcwd()
ctx_bend.sql(f"""create table if not exists t1(a int)""").collect()
ctx_bend.sql(f"""insert into t1 values(1)""").collect()
print(ctx_bend.sql(f"""select * from t1""").collect())
Does this address this issue?
this is perfect !!!
@BohuTANG it seems os.environ["CACHE_DATA_CACHE_STORAGE"] = "disk" does not work, I thought disk cache should be supported for native storage ?
Disk cache should be the local disk.
yes, but it does not seems to be working ? second run don't make much difference
I think we do not export cache
ENV for python binding. cc @sundy-li
This looks work for me:
!pip install databend > /dev/null 2>&1
import os
from os import listdir
os.environ["DATABEND_DATA_PATH"] = "/lakehouse/default/"
os.environ["CACHE_DATA_CACHE_STORAGE"] = "disk"
from databend import SessionContext
ctx_bend = SessionContext("TPCH")
pwd = os.getcwd()
ctx_bend.sql(f"""create table if not exists t1(a int)""").collect()
ctx_bend.sql(f"""insert into t1 values(1)""").collect()
print(ctx_bend.sql(f"""select * from t1""").collect())
print(ctx_bend.sql(f"""select * from system.configs where name like '%cache%'""").collect())
listdir('./.databend/_cache')
Restart the Fabric session and run:
@BohuTANG it seems os.environ["CACHE_DATA_CACHE_STORAGE"] = "disk" does not work, I thought disk cache should be supported for native storage ?
Local disk cache now works but only for FUSE native table.
trying to write to Onelake Storage, I get errors