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
|
namespace DB
|
||||||
{
|
{
|
||||||
|
|
||||||
void formatWithBlock(BlockOutputStreamPtr & out, Block block)
|
void formatWithBlock(BlockOutputStreamPtr & out, const Block & block)
|
||||||
{
|
{
|
||||||
out->writePrefix();
|
out->writePrefix();
|
||||||
out->write(block);
|
out->write(block);
|
||||||
@ -23,14 +23,14 @@ void formatWithBlock(BlockOutputStreamPtr & out, Block block)
|
|||||||
|
|
||||||
/// For simple key
|
/// 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());
|
auto column = ColumnUInt64::create(ids.size());
|
||||||
memcpy(column->getData().data(), ids.data(), ids.size() * sizeof(ids.front()));
|
memcpy(column->getData().data(), ids.data(), ids.size() * sizeof(ids.front()));
|
||||||
|
|
||||||
Block block{{std::move(column), std::make_shared<DataTypeUInt64>(), "id"}};
|
Block block{{std::move(column), std::make_shared<DataTypeUInt64>(), (*dict_struct.id).name}};
|
||||||
|
|
||||||
std::cerr << "Block for IDs size " << ids.size() << std::endl;
|
|
||||||
|
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,13 @@ class Context;
|
|||||||
|
|
||||||
/// Write keys to block output stream.
|
/// Write keys to block output stream.
|
||||||
|
|
||||||
void formatWithBlock(BlockOutputStreamPtr & out, Block block);
|
void formatWithBlock(BlockOutputStreamPtr & out, const Block & block);
|
||||||
|
|
||||||
/// For simple key
|
/// For simple key
|
||||||
|
|
||||||
Block blockForIds(const std::vector<UInt64> & ids);
|
Block blockForIds(
|
||||||
|
const DictionaryStructure & dict_struct,
|
||||||
|
const std::vector<UInt64> & ids);
|
||||||
|
|
||||||
/// For composite key
|
/// For composite key
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ BlockInputStreamPtr ExecutableDictionarySource::loadIds(const std::vector<UInt64
|
|||||||
{
|
{
|
||||||
LOG_TRACE(log, "loadIds {} size = {}", toString(), ids.size());
|
LOG_TRACE(log, "loadIds {} size = {}", toString(), ids.size());
|
||||||
|
|
||||||
auto block = blockForIds(ids);
|
auto block = blockForIds(dict_struct, ids);
|
||||||
|
|
||||||
auto stream = std::make_unique<BlockInputStreamWithBackgroundThread>(
|
auto stream = std::make_unique<BlockInputStreamWithBackgroundThread>(
|
||||||
context, format, sample_block, command, log,
|
context, format, sample_block, command, log,
|
||||||
|
@ -130,8 +130,8 @@ BlockInputStreamPtr HTTPDictionarySource::loadUpdatedAll()
|
|||||||
BlockInputStreamPtr HTTPDictionarySource::loadIds(const std::vector<UInt64> & ids)
|
BlockInputStreamPtr HTTPDictionarySource::loadIds(const std::vector<UInt64> & ids)
|
||||||
{
|
{
|
||||||
LOG_TRACE(log, "loadIds {} size = {}", toString(), ids.size());
|
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)
|
ReadWriteBufferFromHTTP::OutStreamCallback out_stream_callback = [block, this](std::ostream & ostr)
|
||||||
{
|
{
|
||||||
|
@ -5,4 +5,4 @@ Check implicit_key option
|
|||||||
Value
|
Value
|
||||||
Value
|
Value
|
||||||
Value
|
Value
|
||||||
Value
|
Value
|
||||||
|
Loading…
Reference in New Issue
Block a user