Comments (8)
Can you give me a example code with reproduce? You can use system.number as data
from clickhouse.
An easy way to reproduce is to try and insert to a table that doesn't exist:
const {ClickHouse} = require('clickhouse');
const ch = new ClickHouse({host: 'localhost'});
const stream = ch.insert('INSERT INTO BAD_TABLE').stream();
for (let i = 0; i < 10; i++) {
stream.writeRow([i, 'test: '+i]);
}
stream.exec().catch(err => {
console.log(err.code, err.message);
// outputs: undefined 404: Not Found
});
stream.ws.on('response', res => {
let body = '';
res.on('data', data => body += data);
res.on('end', () => {
console.log(body);
// outputs: Code: 60, e.displayText() = DB::Exception: Table default.BAD_TABLE doesn't exist. (version 20.3.8.53 (official build))
});
})
from clickhouse.
If you exec insert as stream then Clickhouse doesn't return body, only error code 500. In last realises Clickhouse sends error code in header, but text still missed
from clickhouse.
When I run the example above it returns 404 and the body is:
Code: 60, e.displayText() = DB::Exception: Table default.BAD_TABLE doesn't exist. (version 20.3.8.53 (official build))
I can get the error message by manually listening for the response and processing the body, but it would be good if this was rejected by exec() like other errors.
from clickhouse.
Ok, I will patch code like your example
from clickhouse.
That's great, thank you!
from clickhouse.
I published [email protected] with your suggestion. Enjoy!
from clickhouse.
That's fantastic, thank you so much!
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.