Fix rabbitmq

This commit is contained in:
Nikolai Kochetov 2021-10-12 13:05:20 +03:00
parent 88b1807434
commit 93b3fcc195
2 changed files with 6 additions and 3 deletions

View File

@ -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);

View File

@ -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;