Update StorageMerge.cpp

This commit is contained in:
alexey-milovidov 2017-04-28 20:37:21 -07:00
parent 0e8c3b976f
commit fb01ef0132

View File

@ -178,6 +178,8 @@ BlockInputStreams StorageMerge::read(
throw Exception("Source tables for Merge table are processing data up to different stages",
ErrorCodes::INCOMPATIBLE_SOURCE_TABLES);
/// Subordinary tables could have different but convertible types, like numeric types of different width.
/// We must return streams with structure equals to structure of Merge table.
for (auto & stream : source_streams)
stream = std::make_shared<CastTypeBlockInputStream>(context, stream, table->getSampleBlock(), getSampleBlock());
}