ClickHouse v.21.7.7.47

setting max_memory_usage doesnt work for 'create table .. as' queries

for example:
**this query works**
`create table test_table engine MergeTree order by a as
select a_table.a, b_table.b_arr
from (select arrayJoin(range(10000)) as a) a_table
         cross join (select range(10000) as b_arr) b_table
    settings max_memory_usage = 1;`

**this query doesnt work**
`insert into test_table
select a_table.a, b_table.b_arr
from (select arrayJoin(range(10000)) as a) a_table
         cross join (select range(10000) as b_arr) b_table
    settings max_memory_usage = 1;`
With error:
`DB::Exception: Memory limit (for query) exceeded: would use 4.09 MiB`

**Expected behavior**
**this query should NOT work, and setting max_memory_usage should work for all 'select'\'insert'\'create table' queries**
`create table test_table engine MergeTree order by a as
select a_table.a, b_table.b_arr
from (select arrayJoin(range(10000)) as a) a_table
         cross join (select range(10000) as b_arr) b_table
    settings max_memory_usage = 1;`
}
                if (auto opentelemetry_span_log = context->getOpenTelemetrySpanLog();
                    context->query_trace_context.trace_id != UUID()
                        && opentelemetry_span_log)
                {
                    OpenTelemetrySpanLogElement span;
                    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,