mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Fix rabbitmq
This commit is contained in:
parent
88b1807434
commit
93b3fcc195
@ -1,5 +1,6 @@
|
|||||||
#include <Storages/RabbitMQ/RabbitMQSource.h>
|
#include <Storages/RabbitMQ/RabbitMQSource.h>
|
||||||
|
|
||||||
|
#include <Formats/FormatFactory.h>
|
||||||
#include <Interpreters/Context.h>
|
#include <Interpreters/Context.h>
|
||||||
#include <Processors/Formats/InputStreamFromInputFormat.h>
|
#include <Processors/Formats/InputStreamFromInputFormat.h>
|
||||||
#include <Processors/Executors/StreamingFormatExecutor.h>
|
#include <Processors/Executors/StreamingFormatExecutor.h>
|
||||||
@ -118,8 +119,8 @@ Chunk RabbitMQSource::generateImpl()
|
|||||||
is_finished = true;
|
is_finished = true;
|
||||||
|
|
||||||
MutableColumns virtual_columns = virtual_header.cloneEmptyColumns();
|
MutableColumns virtual_columns = virtual_header.cloneEmptyColumns();
|
||||||
auto input_format = context->getInputFormat(
|
auto input_format = FormatFactory::instance().getInputFormat(
|
||||||
storage.getFormatName(), *buffer, non_virtual_header, max_block_size);
|
storage.getFormatName(), *buffer, non_virtual_header, context, max_block_size);
|
||||||
|
|
||||||
StreamingFormatExecutor executor(non_virtual_header, input_format);
|
StreamingFormatExecutor executor(non_virtual_header, input_format);
|
||||||
|
|
||||||
|
@ -463,11 +463,13 @@ def test_rabbitmq_big_message(rabbitmq_cluster):
|
|||||||
for message in messages:
|
for message in messages:
|
||||||
channel.basic_publish(exchange='big', routing_key='', body=message)
|
channel.basic_publish(exchange='big', routing_key='', body=message)
|
||||||
|
|
||||||
while True:
|
for _ in range(300):
|
||||||
result = instance.query('SELECT count() FROM test.view')
|
result = instance.query('SELECT count() FROM test.view')
|
||||||
if int(result) == batch_messages * rabbitmq_messages:
|
if int(result) == batch_messages * rabbitmq_messages:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
connection.close()
|
connection.close()
|
||||||
instance.query('''
|
instance.query('''
|
||||||
DROP TABLE test.consumer;
|
DROP TABLE test.consumer;
|
||||||
|
Loading…
Reference in New Issue
Block a user