MCPcopy Create free account
hub / github.com/ByConity/ByConity / checkCalculated

Function checkCalculated

src/Processors/Transforms/AddingDefaultsTransform.cpp:54–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54static 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
70static void mixNumberColumns(
71 TypeIndex type_idx,

Callers 1

transformMethod · 0.85

Calls 3

ExceptionClass · 0.50
sizeMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected