MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / updateContextForSubqueryExecution

Function updateContextForSubqueryExecution

src/Analyzer/Utils.cpp:1056–1071  ·  view source on GitHub ↗

There are no limits on the maximum size of the result for the subquery. * Since the result of the query is not the result of the entire query. */

Source from the content-addressed store, hash-verified

1054 * Since the result of the query is not the result of the entire query.
1055 */
1056void updateContextForSubqueryExecution(ContextMutablePtr & mutable_context)
1057{
1058 /** The subquery in the IN / JOIN section does not have any restrictions on the maximum size of the result.
1059 * Because the result of this query is not the result of the entire query.
1060 * Constraints work instead
1061 * max_rows_in_set, max_bytes_in_set, set_overflow_mode,
1062 * max_rows_in_join, max_bytes_in_join, join_overflow_mode,
1063 * which are checked separately (in the Set, Join objects).
1064 */
1065 Settings subquery_settings = mutable_context->getSettingsCopy();
1066 subquery_settings[Setting::max_result_rows] = 0;
1067 subquery_settings[Setting::max_result_bytes] = 0;
1068 /// The calculation of extremes does not make sense and is not necessary (if you do it, then the extremes of the subquery can be taken for whole query).
1069 subquery_settings[Setting::extremes] = false;
1070 mutable_context->setSettings(subquery_settings);
1071}
1072
1073QueryTreeNodePtr buildQueryToReadColumnsFromTableExpression(const NamesAndTypes & columns,
1074 const QueryTreeNodePtr & table_expression,

Calls 2

getSettingsCopyMethod · 0.80
setSettingsMethod · 0.45

Tested by

no test coverage detected