You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-10-31 18:30:33 +03:00
chore(execplan): MCOL: 6144 prerry print filters and havings as a tree (#3712)
* MCOL-6144: print Filters and Having indented for better CSEP visualization
This commit is contained in:
@@ -152,13 +152,49 @@ const string AggregateColumn::toString() const
|
||||
return output.str();
|
||||
}
|
||||
|
||||
const string AggregateColumn::toString(bool compact) const
|
||||
{
|
||||
if (!compact)
|
||||
{
|
||||
return toString();
|
||||
}
|
||||
|
||||
ostringstream output;
|
||||
|
||||
// Compact format for tree display - let tree printer handle indentation
|
||||
output << "AggregateColumn:";
|
||||
output << endl << "Function: " << (int)fAggOp << ", Distinct: " << fDistinct;
|
||||
|
||||
if (fAlias.length() > 0)
|
||||
output << endl << "Alias: " << fAlias;
|
||||
|
||||
if (fAggParms.size() > 0)
|
||||
{
|
||||
for (uint32_t i = 0; i < fAggParms.size(); ++i)
|
||||
{
|
||||
SimpleColumn* sc = dynamic_cast<SimpleColumn*>(fAggParms[i].get());
|
||||
if (sc)
|
||||
{
|
||||
output << endl << sc->toString(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
output << endl << "Param: " << fAggParms[i]->data();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output.str();
|
||||
}
|
||||
|
||||
string AggregateColumn::toCppCode(IncludeSet& includes) const
|
||||
{
|
||||
includes.insert("aggregatecolumn.h");
|
||||
stringstream ss;
|
||||
auto fContent = fData.substr(fFunctionName.size() + 1, fData.size() - fFunctionName.size() - 2);
|
||||
|
||||
ss << "AggregateColumn(" << std::quoted(fFunctionName) << ", " << std::quoted(fContent) << ", " << sessionID() << ")";
|
||||
ss << "AggregateColumn(" << std::quoted(fFunctionName) << ", " << std::quoted(fContent) << ", "
|
||||
<< sessionID() << ")";
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
@@ -588,15 +624,15 @@ void AggregateColumn::evaluate(Row& row, bool& isNull)
|
||||
|
||||
case CalpontSystemCatalog::VARBINARY:
|
||||
case CalpontSystemCatalog::BLOB:
|
||||
{
|
||||
auto const str = row.getConstString(fInputIndex);
|
||||
fResult.strVal.dropString();
|
||||
if (!str.isNull())
|
||||
fResult.strVal.assign((const uint8_t*)str.str(), str.length());
|
||||
{
|
||||
auto const str = row.getConstString(fInputIndex);
|
||||
fResult.strVal.dropString();
|
||||
if (!str.isNull())
|
||||
fResult.strVal.assign((const uint8_t*)str.str(), str.length());
|
||||
|
||||
isNull = isNull || fResult.strVal.isNull();
|
||||
}
|
||||
break;
|
||||
isNull = isNull || fResult.strVal.isNull();
|
||||
}
|
||||
break;
|
||||
|
||||
default: // treat as int64
|
||||
if (row.equals<8>(BIGINTNULL, fInputIndex))
|
||||
|
||||
Reference in New Issue
Block a user