mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
add total in system.one, test
This commit is contained in:
parent
c9bfff3934
commit
07fa798ffa
@ -41,7 +41,10 @@ Pipe StorageSystemOne::read(
|
||||
auto column = DataTypeUInt8().createColumnConst(1, 0u)->convertToFullColumnIfConst();
|
||||
Chunk chunk({ std::move(column) }, 1);
|
||||
|
||||
return Pipe(std::make_shared<SourceFromSingleChunk>(std::move(header), std::move(chunk)));
|
||||
auto source = std::make_shared<SourceFromSingleChunk>(std::move(header), std::move(chunk));
|
||||
source->addTotalRowsApprox(1);
|
||||
|
||||
return Pipe(source);
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,7 +86,7 @@ void StorageSystemViewRefreshes::fillData(
|
||||
|
||||
res_columns[i++]->insert(refresh.exception_message);
|
||||
res_columns[i++]->insert(refresh.refresh_count);
|
||||
res_columns[i++]->insert(std::min(Float64(refresh.progress.read_rows) / refresh.progress.total_rows_to_read, 1.0));
|
||||
res_columns[i++]->insert(Float64(refresh.progress.read_rows) / refresh.progress.total_rows_to_read);
|
||||
res_columns[i++]->insert(refresh.progress.elapsed_ns / 1e9);
|
||||
res_columns[i++]->insert(refresh.progress.read_rows);
|
||||
res_columns[i++]->insert(refresh.progress.read_bytes);
|
||||
|
@ -0,0 +1,2 @@
|
||||
0
|
||||
4 4 1
|
@ -0,0 +1,18 @@
|
||||
set allow_experimental_refreshable_materialized_view=1;
|
||||
|
||||
CREATE MATERIALIZED VIEW 03221_rmv
|
||||
REFRESH AFTER 1 SECOND
|
||||
(
|
||||
x UInt64
|
||||
)
|
||||
ENGINE = Memory
|
||||
AS SELECT number AS x
|
||||
FROM numbers(3)
|
||||
UNION ALL
|
||||
SELECT rand64() AS x;
|
||||
|
||||
SELECT sleep(2);
|
||||
|
||||
SELECT read_rows, total_rows, progress FROM system.view_refreshes WHERE view = '03221_rmv';
|
||||
|
||||
DROP TABLE 03221_rmv;
|
Loading…
Reference in New Issue
Block a user