Open DanielMao1 opened 2 months ago
Can't reproduce on my Linux. Please open debug log by using:
sess.query("INSERT INTO db_xxx.log_table_xxx VALUES ('a', 1), ('b', 3), ('c', 2), ('d', 5);", "Debug")
and give me the log
good in my environment
root@localhost:~# python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from chdb import session as chs
>>>
>>> ## Create DB, Table, View in temp session, auto cleanup when session is deleted.
>>> sess = chs.Session()
>>> sess.query("CREATE DATABASE IF NOT EXISTS db_xxx ENGINE = Atomic")
>>> sess.query("CREATE TABLE IF NOT EXISTS db_xxx.log_table_xxx (x String, y Int) ENGINE = Log;")
>>> sess.query("INSERT INTO db_xxx.log_table_xxx VALUES ('a', 1), ('b', 3), ('c', 2), ('d', 5);")
>>> sess.query(
... "CREATE VIEW db_xxx.view_xxx AS SELECT * FROM db_xxx.log_table_xxx LIMIT 4;"
... )
>>> print("Select from view:\n")
Select from view:
>>> print(sess.query("SELECT * FROM db_xxx.view_xxx", "Pretty"))
โโโโโณโโโโ
โ x โ y โ
โกโโโโโโโโฉ
1. โ a โ 1 โ
โโโโโผโโโโค
2. โ b โ 3 โ
โโโโโผโโโโค
3. โ c โ 2 โ
โโโโโผโโโโค
4. โ d โ 5 โ
โโโโโดโโโโ
@auxten @l1t1 Thank you for your apply! I tested it again and I found the "stuck" only appears when I using jupyter notebook in vscode (jupyter notebook in web interface is OK, strange to me):
Oh, I see. It's a known issue #152
(you don't have to strictly follow this form)
Describe the situation What exactly works slower than expected?
How to reproduce
Create DB, Table, View in temp session, auto cleanup when session is deleted.
sess = chs.Session() sess.query("CREATE DATABASE IF NOT EXISTS db_xxx ENGINE = Atomic") sess.query("CREATE TABLE IF NOT EXISTS db_xxx.log_table_xxx (x String, y Int) ENGINE = Log;") sess.query("INSERT INTO db_xxx.log_table_xxx VALUES ('a', 1), ('b', 3), ('c', 2), ('d', 5);") sess.query( "CREATE VIEW db_xxx.view_xxx AS SELECT FROM db_xxx.log_table_xxx LIMIT 4;" ) print("Select from view:\n") print(sess.query("SELECT FROM db_xxx.view_xxx", "Pretty"))
Linux ip-172-xx-xx-xx 5.19.0-1029-aws #30~22.04.1-Ubuntu SMP Thu Jul 13 17:17:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux