| 118 | } |
| 119 | |
| 120 | InterpreterInsertQuery::InterpreterInsertQuery( |
| 121 | const ASTPtr & query_ptr_, ContextMutablePtr context_, bool allow_materialized_, bool no_squash_, bool no_destination_, bool async_insert_) |
| 122 | : WithMutableContext(context_) |
| 123 | , logger(getLogger("InterpreterInsertQuery")) |
| 124 | , query_ptr(query_ptr_) |
| 125 | , allow_materialized(allow_materialized_) |
| 126 | , no_squash(no_squash_) |
| 127 | , no_destination(no_destination_) |
| 128 | , async_insert(async_insert_) |
| 129 | { |
| 130 | checkStackSize(); |
| 131 | if (auto quota = getContext()->getQuota()) |
| 132 | quota->checkExceeded(QuotaType::WRITTEN_BYTES); |
| 133 | |
| 134 | const Settings & settings = getContext()->getSettingsRef(); |
| 135 | max_threads = getMaxThreadsForAvailableMemory( |
| 136 | std::max<size_t>(1, settings[Setting::max_threads]), |
| 137 | settings[Setting::max_threads_min_free_memory_per_thread]); |
| 138 | max_insert_threads = getMaxThreadsForAvailableMemory( |
| 139 | std::min(std::max<size_t>(1, settings[Setting::max_insert_threads]), max_threads), |
| 140 | settings[Setting::max_insert_threads_min_free_memory_per_thread]); |
| 141 | } |
| 142 | |
| 143 | StoragePtr InterpreterInsertQuery::getTable(ASTInsertQuery & query) |
| 144 | { |
nothing calls this directly
no test coverage detected