| 25 | } |
| 26 | |
| 27 | ColumnPtr ITTLAlgorithm::executeExpressionAndGetColumn( |
| 28 | const ExpressionActionsPtr & expression, const Block & block, const String & result_column) |
| 29 | { |
| 30 | if (!expression) |
| 31 | return nullptr; |
| 32 | |
| 33 | if (block.has(result_column)) |
| 34 | return block.getByName(result_column).column; |
| 35 | |
| 36 | Block block_copy; |
| 37 | for (const auto & column_name : expression->getRequiredColumns()) |
| 38 | block_copy.insert(block.getByName(column_name)); |
| 39 | |
| 40 | /// Keep number of rows for const expression. |
| 41 | size_t num_rows = block.rows(); |
| 42 | expression->execute(block_copy, num_rows); |
| 43 | |
| 44 | return block_copy.getByName(result_column).column; |
| 45 | } |
| 46 | |
| 47 | UInt32 ITTLAlgorithm::getTimestampByIndex(const IColumn * column, size_t index) const |
| 48 | { |