Skip to content

INSERT ... SETTINGS syntax does not work with bulk insertion #173

@vphoenix1972

Description

@vphoenix1972

Description

I am trying to set query level settings with bulk insertion:

using var command = connection.CreateCommand();
            
command.CommandText =
@"insert into traffic
    (column1, column2, column3)
settings parallel_view_processing = true
values @bulk";

command.Parameters.Add(new ClickHouseParameter
{
    ParameterName = "bulk",
    Value = new MyBulkInsertObject(traffic)
});

command.ExecuteNonQuery();

But it returns with error:

ClickHouse.Ado.ClickHouseException: DB::ParsingException: Cannot parse input: expected '(' before: '\'val1\',\'val2\',\'val3\':  at row 0: While executing ValuesBlockInputFormat
2024-06-04 16:30:24    at ClickHouse.Ado.Impl.ProtocolFormatter.ReadAndThrowException(CancellationToken cToken)
2024-06-04 16:30:24    at ClickHouse.Ado.Impl.ProtocolFormatter.ReadPacket(Response rv, CancellationToken cToken)
2024-06-04 16:30:24    at ClickHouse.Ado.Impl.ProtocolFormatter.ReadResponse(CancellationToken cToken)
2024-06-04 16:30:24    at ClickHouse.Ado.ClickHouseCommand.Execute(Boolean readResponse, ClickHouseConnection connection, CancellationToken cToken)
2024-06-04 16:30:24    at ClickHouse.Ado.ClickHouseCommand.ExecuteNonQueryAsync(CancellationToken cToken)
2024-06-04 16:30:24    at ClickHouse.Ado.ClickHouseCommand.ExecuteNonQuery()

What should be done

It looks like a bug. Is 'INSERT ... SETTINGS' syntax supported with bulk insertion functionality?

v2.0.5
Clickhouse 23.11.3.23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions