mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Fixed tests
This commit is contained in:
parent
dafb0ef4e9
commit
d194294d0b
@ -13,7 +13,7 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
void formatWithBlock(BlockOutputStreamPtr & out, Block block)
|
||||
void formatWithBlock(BlockOutputStreamPtr & out, const Block & block)
|
||||
{
|
||||
out->writePrefix();
|
||||
out->write(block);
|
||||
@ -23,14 +23,14 @@ void formatWithBlock(BlockOutputStreamPtr & out, Block block)
|
||||
|
||||
/// For simple key
|
||||
|
||||
Block blockForIds(const std::vector<UInt64> & ids)
|
||||
Block blockForIds(
|
||||
const DictionaryStructure & dict_struct,
|
||||
const std::vector<UInt64> & ids)
|
||||
{
|
||||
auto column = ColumnUInt64::create(ids.size());
|
||||
memcpy(column->getData().data(), ids.data(), ids.size() * sizeof(ids.front()));
|
||||
|
||||
Block block{{std::move(column), std::make_shared<DataTypeUInt64>(), "id"}};
|
||||
|
||||
std::cerr << "Block for IDs size " << ids.size() << std::endl;
|
||||
Block block{{std::move(column), std::make_shared<DataTypeUInt64>(), (*dict_struct.id).name}};
|
||||
|
||||
return block;
|
||||
}
|
||||
|
@ -20,11 +20,13 @@ class Context;
|
||||
|
||||
/// Write keys to block output stream.
|
||||
|
||||
void formatWithBlock(BlockOutputStreamPtr & out, Block block);
|
||||
void formatWithBlock(BlockOutputStreamPtr & out, const Block & block);
|
||||
|
||||
/// For simple key
|
||||
|
||||
Block blockForIds(const std::vector<UInt64> & ids);
|
||||
Block blockForIds(
|
||||
const DictionaryStructure & dict_struct,
|
||||
const std::vector<UInt64> & ids);
|
||||
|
||||
/// For composite key
|
||||
|
||||
|
@ -267,7 +267,7 @@ BlockInputStreamPtr ExecutableDictionarySource::loadIds(const std::vector<UInt64
|
||||
{
|
||||
LOG_TRACE(log, "loadIds {} size = {}", toString(), ids.size());
|
||||
|
||||
auto block = blockForIds(ids);
|
||||
auto block = blockForIds(dict_struct, ids);
|
||||
|
||||
auto stream = std::make_unique<BlockInputStreamWithBackgroundThread>(
|
||||
context, format, sample_block, command, log,
|
||||
|
@ -131,7 +131,7 @@ BlockInputStreamPtr HTTPDictionarySource::loadIds(const std::vector<UInt64> & id
|
||||
{
|
||||
LOG_TRACE(log, "loadIds {} size = {}", toString(), ids.size());
|
||||
|
||||
auto block = blockForIds(ids);
|
||||
auto block = blockForIds(dict_struct, ids);
|
||||
|
||||
ReadWriteBufferFromHTTP::OutStreamCallback out_stream_callback = [block, this](std::ostream & ostr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user