Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory engine table can be inserted but select query gets no result in version 2.2.0b0 #288

Open
l1t1 opened this issue Dec 2, 2024 · 1 comment

Comments

@l1t1
Copy link

l1t1 commented Dec 2, 2024

Please make sure that the version you're using is still supported (you can find the list here).

You have to provide the following information whenever possible.

Describe what's wrong
I did as following in a docker container. and found memory engine table can be inserted but select query gets no result

pip install chdb==2.2.0b0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
(base) root@74f853bd04cb:/# python
Python 3.11.4 (main, Jul  5 2023, 13:36:48) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import chdb
>>> 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(sess.query("SELECT * FROM db_xxx.view_xxx"))
"a",1
"b",3
"c",2
"d",5

>>> sess.query("CREATE TABLE IF NOT EXISTS db_xxx.log_table_mem (x String, y Int) ENGINE = Memory;")

>>> sess.query("INSERT INTO db_xxx.log_table_mem VALUES ('a', 1), ('b', 3), ('c', 2), ('d', 5);")

>>> print(sess.query("SELECT * FROM db_xxx.log_table_mem"))

>>> 
@Daniel-Robbins
Copy link
Contributor

Daniel-Robbins commented Dec 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants