mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Get marks from first non-alias column in Log storage
This commit is contained in:
parent
a47c52a909
commit
894c451cf0
@ -540,8 +540,16 @@ void StorageLog::truncate(const ASTPtr &, const Context &, TableStructureWriteLo
|
||||
|
||||
const StorageLog::Marks & StorageLog::getMarksWithRealRowCount() const
|
||||
{
|
||||
const String & column_name = getColumns().begin()->name;
|
||||
const IDataType & column_type = *getColumns().begin()->type;
|
||||
/// There should be at least one physical column
|
||||
auto begin = getColumns().begin();
|
||||
while (begin != getColumns().end() && begin->default_desc == ColumnDefaultKind::Alias)
|
||||
++begin;
|
||||
|
||||
if (begin == getColumns().end())
|
||||
throw Exception("No physical columns found!", ErrorCodes::LOGICAL_ERROR);
|
||||
|
||||
const String & column_name = begin->name;
|
||||
const IDataType & column_type = *begin->type;
|
||||
String filename;
|
||||
|
||||
/** We take marks from first column.
|
||||
|
@ -0,0 +1 @@
|
||||
0
|
@ -0,0 +1,7 @@
|
||||
DROP TABLE IF EXISTS test_alias;
|
||||
|
||||
CREATE TABLE test_alias (a UInt8 ALIAS b, b UInt8) ENGINE Log;
|
||||
|
||||
SELECT count() FROM test_alias;
|
||||
|
||||
DROP TABLE test_alias;
|
Loading…
Reference in New Issue
Block a user