-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Unable to insert rows if table has many columns #45
Comments
In this line query string is created and it's too long for http URL in my case. |
Do you have a reproduction example I can put in a test? (fix is already in, but I'd like to cover it) |
Here you are. var host = "localhost";
var port = 8123;
var tblName = "default.test_long_insert_tbl";
int columnCount = 600;
var con =new ClickHouseConnection($"Host={host};Port={port}");
//Generating create tbl statement with a lot of columns
var query = $"CREATE TABLE IF NOT EXISTS {tblName}(\n";
var columns = Enumerable.Range(1, columnCount)
.Select(x => $" some_loooooooooooooonnnnnnnnnnnngggggggg_column_name_{x} Int32");
query += string.Join(",\n", columns);
query += ")\n ENGINE = MergeTree()\n ORDER BY (some_loooooooooooooonnnnnnnnnnnngggggggg_column_name_1)";
//Create tbl in db
await con.ExecuteStatementAsync(query);
var bulkCopy = new ClickHouseBulkCopy(con) {DestinationTableName = tblName};
var rowToInsert = new[] {Enumerable.Range(1, columnCount).Select(x => (object) x).ToArray()};
await bulkCopy.WriteToServerAsync(rowToInsert); |
Fix released in |
I had to pull Reopening this to track fix in next version (@santolex ) |
* Backward-compatible fix for "wide table" bulk copy issue (#45) * Added feature flags for tests (DateTime64, Decimal, IPv6) to disable them on incompatible version * Switched feature support flag methods to internal
Closing again, as has been properly fixed in |
I use
ClickHouseBulkCopy
to insert rows and it throws some http exception.In my opinion the problem is that query is too long about 22k symbols long.
The text was updated successfully, but these errors were encountered: