From f7ac8bf542273f082b74918a66a6e46b42b412a9 Mon Sep 17 00:00:00 2001 From: nikitamikhaylov Date: Tue, 8 Dec 2020 01:52:51 +0300 Subject: [PATCH] rebase and fix tests --- programs/client/Client.cpp | 11 +++-------- src/Formats/FormatFactory.cpp | 12 ++++-------- src/Storages/StorageFile.cpp | 4 ++-- src/Storages/StorageURL.cpp | 4 ++-- .../0_stateless/01246_insert_into_watch_live_view.py | 7 +++++++ 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index 6e2c11f9ca6..aa60503311a 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -1359,8 +1359,8 @@ private: if (with_output && with_output->settings_ast) apply_query_settings(*with_output->settings_ast); - if (context.getSettingsRef().output_format_parallel_formatting) - need_render_progress = false; + // if (context.getSettingsRef().output_format_parallel_formatting) + // need_render_progress = false; connection->forceConnected(connection_parameters.timeouts); @@ -1989,12 +1989,7 @@ private: written_first_block = true; } - // const auto & settings = context.getSettingsRef(); - // const auto parallel_formatting = settings.output_format_parallel_formatting; - - bool clear_progess = false; - // if (!parallel_formatting) - // clear_progess = std_out.offset() > 0; + bool clear_progess = std_out.offset() > 0; if (clear_progess) clearProgress(); diff --git a/src/Formats/FormatFactory.cpp b/src/Formats/FormatFactory.cpp index 5d8068c97f4..1962cf8218f 100644 --- a/src/Formats/FormatFactory.cpp +++ b/src/Formats/FormatFactory.cpp @@ -197,7 +197,7 @@ InputFormatPtr FormatFactory::getInput( } - auto format = getInputFormat(name, buf, sample, context, max_block_size, std::move(callback)); + auto format = getInputFormat(name, buf, sample, context, max_block_size, format_settings); return format; } @@ -222,17 +222,13 @@ BlockOutputStreamPtr FormatFactory::getOutput(const String & name, { const auto & output_getter = getCreators(name).output_processor_creator; - FormatSettings format_settings = getOutputFormatSetting(settings, context); - /** TODO: Materialization is needed, because formats can use the functions `IDataType`, * which only work with full columns. */ - - RowOutputFormatParams row_output_format_params{callback, ignore_no_row_delimiter}; - auto formatter_creator = [output_getter, sample, row_output_format_params, format_settings] + auto formatter_creator = [output_getter, sample, callback, format_settings] (WriteBuffer & output) -> OutputFormatPtr - { return output_getter(output, sample, row_output_format_params, format_settings);}; ///FIXME + { return output_getter(output, sample, {std::move(callback)}, format_settings);}; ParallelFormattingOutputFormat::Params params{buf, sample, formatter_creator, settings.max_threads}; auto format = std::make_shared(params); @@ -245,7 +241,7 @@ BlockOutputStreamPtr FormatFactory::getOutput(const String & name, } - auto format = getOutputFormat(name, buf, sample, context, std::move(callback), ignore_no_row_delimiter); + auto format = getOutputFormat(name, buf, sample, context, std::move(callback), format_settings); return std::make_shared(std::make_shared(format), sample); } diff --git a/src/Storages/StorageFile.cpp b/src/Storages/StorageFile.cpp index caf9c06e0ba..57ab17e156d 100644 --- a/src/Storages/StorageFile.cpp +++ b/src/Storages/StorageFile.cpp @@ -333,8 +333,8 @@ public: reader = std::make_shared(format); - if (!column_defaults.empty()) - reader = std::make_shared(reader, column_defaults, context); + if (columns_description.hasDefaults()) + reader = std::make_shared(reader, columns_description, context); reader->readPrefix(); } diff --git a/src/Storages/StorageURL.cpp b/src/Storages/StorageURL.cpp index 9533892d07a..8c69d9c0179 100644 --- a/src/Storages/StorageURL.cpp +++ b/src/Storages/StorageURL.cpp @@ -107,9 +107,9 @@ namespace compression_method); - auto input_format = FormatFactory::instance().getInput(format, *read_buf, sample_block, context, max_block_size); + auto input_format = FormatFactory::instance().getInput(format, *read_buf, sample_block, context, max_block_size, format_settings); reader = std::make_shared(input_format); - reader = std::make_shared(reader, column_defaults, context); + reader = std::make_shared(reader, columns, context); } String getName() const override diff --git a/tests/queries/0_stateless/01246_insert_into_watch_live_view.py b/tests/queries/0_stateless/01246_insert_into_watch_live_view.py index 0f7c6965b7b..f533573bfc7 100755 --- a/tests/queries/0_stateless/01246_insert_into_watch_live_view.py +++ b/tests/queries/0_stateless/01246_insert_into_watch_live_view.py @@ -18,6 +18,13 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo client2.expect(prompt) client3.expect(prompt) + client1.send('SET output_format_parallel_formatting=0') + client1.expect(prompt) + client2.send('SET output_format_parallel_formatting=0') + client2.expect(prompt) + client3.send('SET output_format_parallel_formatting=0') + client3.expect(prompt) + client1.send('SET allow_experimental_live_view = 1') client1.expect(prompt) client3.send('SET allow_experimental_live_view = 1')