rebase and fix tests

This commit is contained in:
nikitamikhaylov 2020-12-08 01:52:51 +03:00
parent 3c683b1d86
commit f7ac8bf542
5 changed files with 18 additions and 20 deletions

View File

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

View File

@ -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<ParallelFormattingOutputFormat>(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<MaterializingBlockOutputStream>(std::make_shared<OutputStreamToOutputFormat>(format), sample);
}

View File

@ -333,8 +333,8 @@ public:
reader = std::make_shared<InputStreamFromInputFormat>(format);
if (!column_defaults.empty())
reader = std::make_shared<AddingDefaultsBlockInputStream>(reader, column_defaults, context);
if (columns_description.hasDefaults())
reader = std::make_shared<AddingDefaultsBlockInputStream>(reader, columns_description, context);
reader->readPrefix();
}

View File

@ -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<InputStreamFromInputFormat>(input_format);
reader = std::make_shared<AddingDefaultsBlockInputStream>(reader, column_defaults, context);
reader = std::make_shared<AddingDefaultsBlockInputStream>(reader, columns, context);
}
String getName() const override

View File

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