| 103 | } |
| 104 | |
| 105 | void SourceStepWithFilter::describeActions(FormatSettings & format_settings) const |
| 106 | { |
| 107 | std::string prefix = format_settings.detail_prefix; |
| 108 | |
| 109 | if (format_settings.pretty) |
| 110 | QueryPlanFormat::formatOutputColumns(format_settings.pretty_names, format_settings.out, *this, prefix); |
| 111 | |
| 112 | if (!format_settings.pretty && (query_info.prewhere_info || query_info.row_level_filter)) |
| 113 | { |
| 114 | format_settings.out << prefix << "Prewhere info" << '\n'; |
| 115 | if (query_info.prewhere_info) |
| 116 | format_settings.out << prefix << "Need filter: " << query_info.prewhere_info->need_filter << '\n'; |
| 117 | |
| 118 | prefix.push_back(format_settings.indent_char); |
| 119 | prefix.push_back(format_settings.indent_char); |
| 120 | } |
| 121 | |
| 122 | if (query_info.prewhere_info) |
| 123 | { |
| 124 | const auto pretty_expression = format_settings.pretty |
| 125 | ? QueryPlanFormat::formatColumnPretty(query_info.prewhere_info->prewhere_column_name, format_settings.pretty_names) : String{}; |
| 126 | |
| 127 | if (!format_settings.pretty || !pretty_expression.empty()) |
| 128 | { |
| 129 | format_settings.out << prefix << "Prewhere filter" << '\n'; |
| 130 | format_settings.out << prefix << "Prewhere filter column: " << (format_settings.pretty ? pretty_expression : query_info.prewhere_info->prewhere_column_name); |
| 131 | if (!format_settings.pretty && query_info.prewhere_info->remove_prewhere_column) |
| 132 | format_settings.out << " (removed)"; |
| 133 | format_settings.out << '\n'; |
| 134 | } |
| 135 | |
| 136 | if (format_settings.pretty) |
| 137 | { |
| 138 | const auto annotation = QueryPlanFormat::getColumnAnnotation(query_info.prewhere_info->prewhere_column_name, format_settings); |
| 139 | if (!annotation.empty()) |
| 140 | format_settings.out << prefix << annotation << '\n'; |
| 141 | } |
| 142 | |
| 143 | if (!format_settings.compact) |
| 144 | { |
| 145 | auto expression = std::make_shared<ExpressionActions>(query_info.prewhere_info->prewhere_actions.clone()); |
| 146 | expression->describeActions(format_settings.out, prefix); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | if (query_info.row_level_filter) |
| 151 | { |
| 152 | const auto pretty_expression = format_settings.pretty |
| 153 | ? QueryPlanFormat::formatColumnPretty(query_info.row_level_filter->column_name, format_settings.pretty_names) : String{}; |
| 154 | |
| 155 | if (!format_settings.pretty || !pretty_expression.empty()) |
| 156 | { |
| 157 | format_settings.out << prefix << "Row level filter" << '\n'; |
| 158 | format_settings.out << prefix << "Row level filter column: " << (format_settings.pretty ? pretty_expression : query_info.row_level_filter->column_name); |
| 159 | if (!format_settings.pretty && query_info.row_level_filter->do_remove_column) |
| 160 | format_settings.out << " (removed)"; |
| 161 | format_settings.out << '\n'; |
| 162 | } |
nothing calls this directly
no test coverage detected