-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
how to query postgre table? #225
Comments
I tested, but:
I want to use chdb to speed up postgre, calculate in chdb and then write the result back to postgre. |
Try use session 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")
print(sess.query("SELECT * FROM db_xxx.view_xxx", "Pretty")) |
Thank you, this way can query greenplum table now, but how to query temp table ?
how to do in chdb? and how to write chdb result back to gp? thanks! |
There are also some full examples: |
then I query gp table is OK,
but how to create table in chdb?
chdb.ChdbError: Code: 60. DB::Exception: Table _local.tmp does not exist. (UNKNOWN_TABLE) |
The default _local db is not persist, you should create a new one to save your modifications. Lines 26 to 38 in 50fd104
|
data may stock in rdb,like postgre,and how to query it by chdb?
The text was updated successfully, but these errors were encountered: