:) create table a engine=Memory as select 1 a;
0.11995077133178711
:) select * from a;
Code: 60. DB::Exception: Table _local.a does not exist. (UNKNOWN_TABLE)
0.11473512649536133 |
Answered by
auxten
Feb 8, 2024
Replies: 5 comments 2 replies
|
CHDB VERSION: 1.1.0 |
0 replies
|
the mergetree engine table is ok, memory engine table is wrong. >>> from chdb import session as chs
>>>
>>> sess = chs.Session()
>>>
>>> sess.query("CREATE DATABASE test_db ENGINE = Atomic;")
>>> sess.query("CREATE TABLE test_db.test_table (x String, y String) ENGINE = MergeTree ORDER BY tuple()")
>>> sess.query("INSERT INTO test_db.test_table (x, y) VALUES ('A', 'B')")
>>>
>>> print("Original values:")
Original values:
>>> print(sess.query("SELECT * FROM test_db.test_table"))
"A","B"
>>>
>>> sess.query("ALTER TABLE test_db.test_table UPDATE y = 'updated' WHERE x = 'A' AND y = 'B'")
>>>
>>> print('Values after UPDATE (expected "A", "updated"):')
Values after UPDATE (expected "A", "updated"):
>>> print(sess.query("SELECT * FROM test_db.test_table"))
"A","updated"
>>> sess.query("create table a engine=Memory as select 1 a;")
>>> sess.query("select * from a")
Code: 60. DB::Exception: Table _local.a does not exist. (UNKNOWN_TABLE)
>>> sess.query("create table test_db.a engine=Memory as select 1 a;")
>>> sess.query("select * from test_db.a")
>>> print(sess.query("select * from test_db.a"))
|
0 replies
|
the memory engine table is created, but can not select it's data. Log engine table is ok too. >>> sess.query("create table test_db.a engine=Log as select 1 a;")
Code: 57. DB::Exception: Table test_db.a already exists. (TABLE_ALREADY_EXISTS)
>>> sess.query("create table test_db.a2 engine=Log as select 1 a;")
>>> print(sess.query("select * from test_db.a2"))
1 |
1 reply
|
I use Python cli |
0 replies
|
Current chDB session relys on temp disk storage to keep the session data. Possible fix could be re-implement the session with "interactive mode" of clickhouse-local. |
1 reply
Answer selected by
l1t1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current chDB session relys on temp disk storage to keep the session data.
As a consequence, Memory engine could not keep state in session.
Possible fix could be re-implement the session with "interactive mode" of clickhouse-local.
It's not an easy fix. I will think about it.