How to reproduce:

```sql
EXPLAIN SYNTAX
SELECT x
FROM 
(
    SELECT 1 AS x
    UNION DISTINCT
    SELECT 1
)

Query id: e777bc02-5d1b-4d49-ba89-4ebe31172387


Exception on client:
Code: 32. DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000

```

span.trace_id = context.query_trace_context.trace_id;
                    span.span_id = context.query_trace_context.span_id;
                    span.parent_span_id = context.getClientInfo().client_trace_context.span_id;
                    span.operation_name = "query";
                    span.start_time_us = elem.query_start_time_microseconds;
                    span.finish_time_us = time_in_microseconds(finish_time);
                    
                    span.attribute_names.push_back("clickhouse.query_status");
                    span.attribute_values.push_back("QueryFinish");
                    span.attribute_names.push_back("db.statement");
                    span.attribute_values.push_back(elem.query);
                    span.attribute_names.push_back("clickhouse.query_id");
                    span.attribute_values.push_back(elem.client_info.current_query_id);
                    if (!context.query_trace_context.tracestate.empty())
                    {
                        span.attribute_names.push_back("clickhouse.tracestate");
                        span.attribute_values.push_back(
                            context.query_trace_context.tracestate);
                    }
                    opentelemetry_span_log->add(span);
                }
            };
            auto exception_callback = [elem, &context, ast,
                 log_queries,
                 log_queries_min_type = settings.log_queries_min_type,
                 log_queries_min_query_duration_ms = settings.log_queries_min_query_duration_ms.totalMilliseconds(),
                 quota(quota), status_info_to_query_log] () mutable
            {
                if (quota)
                    quota->used(Quota::ERRORS, 1,  false);