Skip to content

clickhouse-client --print-profile-events not working for insert in non-interactive mode? #37241

@zhicwu

Description

@zhicwu

It seems --print-profile-events --profile-events-delay-ms=-1 only works for select query but not insert.

For instance, clickhouse-client --query="select 1" --print-profile-events --profile-events-delay-ms=-1 prints profile events like below.

[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] ContextLock: 12 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] MemoryTrackerUsage: 8704 (gauge)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] NetworkSendBytes: 57 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] NetworkSendElapsedMicroseconds: 84 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] Query: 1 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] RWLockAcquiredReadLocks: 1 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] RealTimeMicroseconds: 139 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] SelectQuery: 1 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] SelectedBytes: 1 (increment)
[node1.some.cluster] 2022.05.14 07:07:55 [ 0 ] SelectedRows: 1 (increment)

However, echo -e "1\t2" | clickhouse-client --query="insert into aaa format TSV" --print-profile-events --profile-events-delay-ms=-1 shows nothing.
Note: you can use create table aaa(a String, b String)engine=Memory to create the test table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unexpected behaviourResult is unexpected, but not entirely wrong at the same time.usabilitywarmup taskThe task for new ClickHouse team members. Low risk, moderate complexity, no urgency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions