Comments (8)
You need parallel query with own session? Or you need pass some specific session_id in each query?
from clickhouse.
You need parallel query with own session
--- This is not possible by the design of ClickHouse. If it is I would love to know.
you need pass some specific session_id in each query?
-- YES! Exactly!
from clickhouse.
added a PR #52 for the same as well. Please let me know if I am doing something fundamentally wrong here.
from clickhouse.
Just checked the test are added by you at line 300, thanks for looking into the issue however this is not what I meant, as we all know in JS most of the variables are referred apart from numbers and some other.. so the issue is that the same ClickHouse connection is used across multiple routes and connections and requests that are served by the http server at node as well! Now due to same session name the queries will get locked!
But I am sure this was taken care and random sessions are created, however this defeats the purpose of creating a temporary table and serving user the data from this temporary table to prevent further querying the main table over which we won't like to put stress on!
Use Case
I have a complex query that consumes a lot of time, and I simply create a session for one of my user and provide a session id such as sess_${userId}
now when this user queries I would use this session_id to access the temporary table I built for this specific user in the specific session.
This can enable people using this driver to create destroy and persist session as per the requirement.
(PS: I upgraded from 19.6 to 20.3 as I got to know about fixed session locking issues, but they still persist, concurrent HTTP calls lock session. I am shifting my code base to build actual memory engine tables and then destroying them over the time by analysing system.tables
, hope our discussion helps someone else.)
from clickhouse.
Do you mean interface like this:
// init
const clickhouse = new ClickHouse(...);
// route
const userCH = clickhouse.getSession();
const rows = await userCH.quiery...
const rows2 = await userCH.query...
?
from clickhouse.
Possibly yes, that's another way to put it, in short isolating one request and session name. However, if User A
sends me a request, I would like to create a session as session_user_a
and for User B
I would create sess_user_b
and ensure they don't lock each other out at any point in time.
from clickhouse.
I published version with your MR
from clickhouse.
Thanks a ton!
from clickhouse.
Related Issues (20)
- Query times out with ETIMEDOUT
- clickhouse dialect HOT 1
- Passing an apostrophe to values causes error HOT 5
- When the dynamic parameter of Uint64 exists in SQL, it returns null HOT 1
- "data.every is not a function" error HOT 2
- can not insert with lower case of 'insert into ...' query. Error: insert query wasnt parsed field list after TABLE_NAME HOT 2
- Pipe readable stream across writable stream HOT 3
- Bad Request 400, big select query HOT 7
- Document the client options better
- [email protected]: Please upgrade to version 7 or higher. HOT 1
- Documentaion :: TSV , CSV data insertion is not mentioned in docs HOT 1
- Error: read ECONNRESET
- Access management queries fail because of obligatory FORMAT HOT 1
- Parse error when running cluster queries HOT 1
- Unable to insert data of Map.
- config receive_timeout and send_timeout not work
- Error: Scalar doesn't exist
- Unable to insert object with utf8mb4
- npm audit says there is a security issue for request package HOT 2
- Can not insert with value = null HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse.