| 191 | } |
| 192 | |
| 193 | void sanitizeDataType(const DataTypePtr & type) |
| 194 | { |
| 195 | if (!type) |
| 196 | throw Exception("Invalid null type for filter:, must be UInt8 or Nullable(UInt8)", |
| 197 | ErrorCodes::ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER); |
| 198 | |
| 199 | if (type->getTypeId() == TypeIndex::Nullable) |
| 200 | { |
| 201 | const auto * nullable = dynamic_cast<const DataTypeNullable *>(type.get()); |
| 202 | sanitizeDataType(nullable->getNestedType()); |
| 203 | return; |
| 204 | } |
| 205 | |
| 206 | if (type->getTypeId() == TypeIndex::LowCardinality) |
| 207 | { |
| 208 | const auto * lc = dynamic_cast<const DataTypeLowCardinality *>(type.get()); |
| 209 | sanitizeDataType(lc->getDictionaryType()); |
| 210 | return; |
| 211 | } |
| 212 | |
| 213 | if(type->getTypeId() == TypeIndex::UInt8) |
| 214 | return; |
| 215 | |
| 216 | throw Exception("Invalid type for filter: " + type->getName() + ", must be UInt8 or Nullable(UInt8)", |
| 217 | ErrorCodes::ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER); |
| 218 | } |
| 219 | |
| 220 | ExpressionAnalyzerData::~ExpressionAnalyzerData() = default; |
| 221 |
no test coverage detected