Объявление массива и доступ во внешних словарях в Clickhouse

Я подключаюсь к mongodb, используя внешние словари в clickhouse. Он отлично работает с целыми числами и строками, но когда дело доходит до Array (UInt8), он выдает ошибку, говоря, что таблица не существует

Ошибка:

Код: 50, e.displayText () = DB :: Exception: массив неизвестного типа (UInt8), e.what () = DB :: Exception

Есть ли способ объявить массив (UInt8) как атрибут во внешнем словаре и массиве доступа mongodb?


person kaivalya    schedule 30.07.2018    source источник


Ответы (1)


В настоящее время использование составного типа для словарей не поддерживается. Вот все поддерживаемые типы.

AttributeUnderlyingType getAttributeUnderlyingType(const std::string & type)
{
    static const std::unordered_map<std::string, AttributeUnderlyingType> dictionary{
        { "UInt8", AttributeUnderlyingType::UInt8 },
        { "UInt16", AttributeUnderlyingType::UInt16 },
        { "UInt32", AttributeUnderlyingType::UInt32 },
        { "UInt64", AttributeUnderlyingType::UInt64 },
        { "UUID", AttributeUnderlyingType::UInt128 },
        { "Int8", AttributeUnderlyingType::Int8 },
        { "Int16", AttributeUnderlyingType::Int16 },
        { "Int32", AttributeUnderlyingType::Int32 },
        { "Int64", AttributeUnderlyingType::Int64 },
        { "Float32", AttributeUnderlyingType::Float32 },
        { "Float64", AttributeUnderlyingType::Float64 },
        { "String", AttributeUnderlyingType::String },
        { "Date", AttributeUnderlyingType::UInt16 },
        { "DateTime", AttributeUnderlyingType::UInt32 },
    };

    const auto it = dictionary.find(type);
    if (it != std::end(dictionary))
        return it->second;

    throw Exception{"Unknown type " + type, ErrorCodes::UNKNOWN_TYPE};
}
person Amos    schedule 31.07.2018