Merge pull request #15422 from ClickHouse/query-plan-header-remove-columns

Remove column from header descriotion for EXPLAIN PLAN
This commit is contained in:
Nikolai Kochetov 2020-09-29 15:51:09 +03:00 committed by GitHub
commit 33487c0e4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 3 deletions

View File

@ -27,7 +27,7 @@ bool ColumnWithTypeAndName::operator==(const ColumnWithTypeAndName & other) cons
}
void ColumnWithTypeAndName::dumpStructure(WriteBuffer & out) const
void ColumnWithTypeAndName::dumpNameAndType(WriteBuffer & out) const
{
out << name;
@ -35,6 +35,11 @@ void ColumnWithTypeAndName::dumpStructure(WriteBuffer & out) const
out << ' ' << type->getName();
else
out << " nullptr";
}
void ColumnWithTypeAndName::dumpStructure(WriteBuffer & out) const
{
dumpNameAndType(out);
if (column)
out << ' ' << column->dumpStructure();

View File

@ -33,6 +33,7 @@ struct ColumnWithTypeAndName
ColumnWithTypeAndName cloneEmpty() const;
bool operator==(const ColumnWithTypeAndName & other) const;
void dumpNameAndType(WriteBuffer & out) const;
void dumpStructure(WriteBuffer & out) const;
String dumpStructure() const;
};

View File

@ -45,7 +45,7 @@ static void doDescribeHeader(const Block & header, size_t count, IQueryPlanStep:
settings.out << prefix;
first = false;
elem.dumpStructure(settings.out);
elem.dumpNameAndType(settings.out);
settings.out << '\n';
}
}

View File

@ -225,7 +225,7 @@ static void explainStep(
settings.out << "\n" << prefix << " ";
first = false;
elem.dumpStructure(settings.out);
elem.dumpNameAndType(settings.out);
}
}

View File

@ -0,0 +1,7 @@
Expression (Projection)
Header: x UInt8
Expression (Before ORDER BY and SELECT)
Header: _dummy UInt8
1 UInt8
ReadFromStorage (Read from SystemOne)
Header: dummy UInt8

View File

@ -0,0 +1 @@
explain header = 1 select 1 as x;