mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
removing LC in AVRO input format if needed
This commit is contained in:
parent
46db8a2d51
commit
68b47f5f61
@ -1,4 +1,5 @@
|
||||
#include "AvroRowInputFormat.h"
|
||||
#include "DataTypes/DataTypeLowCardinality.h"
|
||||
#if USE_AVRO
|
||||
|
||||
#include <numeric>
|
||||
@ -174,7 +175,10 @@ static std::string nodeName(avro::NodePtr node)
|
||||
|
||||
AvroDeserializer::DeserializeFn AvroDeserializer::createDeserializeFn(avro::NodePtr root_node, DataTypePtr target_type)
|
||||
{
|
||||
WhichDataType target(target_type);
|
||||
const WhichDataType target = target_type->getTypeId() == TypeIndex::LowCardinality
|
||||
? removeLowCardinality(target_type)
|
||||
: target_type;
|
||||
|
||||
switch (root_node->type())
|
||||
{
|
||||
case avro::AVRO_STRING: [[fallthrough]];
|
||||
@ -384,7 +388,8 @@ AvroDeserializer::DeserializeFn AvroDeserializer::createDeserializeFn(avro::Node
|
||||
}
|
||||
|
||||
throw Exception(
|
||||
"Type " + target_type->getName() + " is not compatible with Avro " + avro::toString(root_node->type()) + ":\n" + nodeToJson(root_node),
|
||||
"Type " + target_type->getName() + " is not compatible with Avro " + avro::toString(root_node->type()) + ":\n"
|
||||
+ nodeToJson(root_node),
|
||||
ErrorCodes::ILLEGAL_COLUMN);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user