mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 03:52:15 +00:00
Fix progress rows and bytes read
This commit is contained in:
parent
88736a0d74
commit
2ae9490a68
@ -81,11 +81,11 @@ void JSONCompactWithProgressRowOutputFormat::writeExtremesElement(const char * t
|
|||||||
|
|
||||||
void JSONCompactWithProgressRowOutputFormat::onProgress(const Progress & value)
|
void JSONCompactWithProgressRowOutputFormat::onProgress(const Progress & value)
|
||||||
{
|
{
|
||||||
progress.incrementPiecewiseAtomically(value);
|
statistics.progress.incrementPiecewiseAtomically(value);
|
||||||
String progress_line;
|
String progress_line;
|
||||||
WriteBufferFromString buf(progress_line);
|
WriteBufferFromString buf(progress_line);
|
||||||
writeCString("{\"progress\":", buf);
|
writeCString("{\"progress\":", buf);
|
||||||
progress.writeJSON(buf);
|
statistics.progress.writeJSON(buf);
|
||||||
writeCString("}\n", buf);
|
writeCString("}\n", buf);
|
||||||
buf.finalize();
|
buf.finalize();
|
||||||
std::lock_guard lock(progress_lines_mutex);
|
std::lock_guard lock(progress_lines_mutex);
|
||||||
@ -127,7 +127,6 @@ void JSONCompactWithProgressRowOutputFormat::finalizeImpl()
|
|||||||
settings.write_statistics && exception_message.empty(),
|
settings.write_statistics && exception_message.empty(),
|
||||||
*ostr);
|
*ostr);
|
||||||
|
|
||||||
exception_message = "Test exception message.";
|
|
||||||
if (!exception_message.empty())
|
if (!exception_message.empty())
|
||||||
{
|
{
|
||||||
writeCString("\n", *ostr);
|
writeCString("\n", *ostr);
|
||||||
|
@ -46,7 +46,6 @@ private:
|
|||||||
void finalizeImpl() override;
|
void finalizeImpl() override;
|
||||||
|
|
||||||
|
|
||||||
Progress progress;
|
|
||||||
std::vector<String> progress_lines;
|
std::vector<String> progress_lines;
|
||||||
std::mutex progress_lines_mutex;
|
std::mutex progress_lines_mutex;
|
||||||
/// To not lock mutex and check progress_lines every row,
|
/// To not lock mutex and check progress_lines every row,
|
||||||
|
Loading…
Reference in New Issue
Block a user