| 200 | } |
| 201 | |
| 202 | String formatConstant(const ActionsDAG::Node * node) |
| 203 | { |
| 204 | if (!node->column) |
| 205 | return node->result_name; |
| 206 | |
| 207 | if (node->result_type && WhichDataType(node->result_type).isSet()) |
| 208 | return node->result_name; |
| 209 | |
| 210 | /// node->column is a size-0 ColumnConst; read the value from its data column. |
| 211 | const auto & data_col = node->column->getDataColumnPtr(); |
| 212 | WhichDataType data_type(node->result_type); |
| 213 | |
| 214 | if (data_type.isDateOrDate32OrTimeOrTime64OrDateTimeOrDateTime64()) |
| 215 | { |
| 216 | WriteBufferFromOwnString buf; |
| 217 | writeChar('\'', buf); |
| 218 | node->result_type->getDefaultSerialization()->serializeText(*data_col, 0, buf, {}); |
| 219 | writeChar('\'', buf); |
| 220 | return buf.str(); |
| 221 | } |
| 222 | |
| 223 | Field value; |
| 224 | data_col->get(0, value); |
| 225 | return applyVisitor(FieldVisitorToString(), value); |
| 226 | } |
| 227 | |
| 228 | String getRuntimeFilterId(const ActionsDAG::Node * node) |
| 229 | { |
no test coverage detected