| 52 | |
| 53 | |
| 54 | static void checkCalculated(const ColumnWithTypeAndName & col_read, |
| 55 | const ColumnWithTypeAndName & col_defaults, |
| 56 | size_t defaults_needed) |
| 57 | { |
| 58 | size_t column_size = col_read.column->size(); |
| 59 | |
| 60 | if (column_size != col_defaults.column->size()) |
| 61 | throw Exception("Mismatch column sizes while adding defaults", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH); |
| 62 | |
| 63 | if (column_size < defaults_needed) |
| 64 | throw Exception("Unexpected defaults count", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH); |
| 65 | |
| 66 | if (!col_read.type->equals(*col_defaults.type)) |
| 67 | throw Exception("Mismatch column types while adding defaults", ErrorCodes::TYPE_MISMATCH); |
| 68 | } |
| 69 | |
| 70 | static void mixNumberColumns( |
| 71 | TypeIndex type_idx, |