提交 42fcf148 编写于 作者: V Vitaliy Lyudvichenko 提交者: alexey-milovidov

Add column rows to system.parts table. [#CLICKHOUSE-2950]

上级 edcc1899
......@@ -24,6 +24,7 @@ StorageSystemParts::StorageSystemParts(const std::string & name_)
{"replicated", std::make_shared<DataTypeUInt8>()},
{"active", std::make_shared<DataTypeUInt8>()},
{"marks", std::make_shared<DataTypeUInt64>()},
{"rows", std::make_shared<DataTypeUInt64>()},
{"bytes", std::make_shared<DataTypeUInt64>()},
{"modification_time", std::make_shared<DataTypeDateTime>()},
{"remove_time", std::make_shared<DataTypeDateTime>()},
......@@ -231,6 +232,7 @@ BlockInputStreams StorageSystemParts::read(
block.getByPosition(i++).column->insert(replicated);
block.getByPosition(i++).column->insert(static_cast<UInt64>(!need[replicated][0] || active_parts.count(part)));
block.getByPosition(i++).column->insert(part->size);
block.getByPosition(i++).column->insert(part->getExactSizeRows());
block.getByPosition(i++).column->insert(static_cast<size_t>(part->size_in_bytes));
block.getByPosition(i++).column->insert(part->modification_time);
block.getByPosition(i++).column->insert(part->remove_time);
......
......@@ -63,6 +63,8 @@ SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r1' AND ac
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r2' AND active; -- 4
SELECT count() FROM system.parts WHERE database = 'test' AND table = 'r3' AND active; -- 4
SELECT sum(rows) FROM system.parts WHERE database = 'test' AND table = 'r1' AND active; -- 4
DROP TABLE test.r1;
DROP TABLE test.r2;
DROP TABLE test.r3;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册