MCPcopy Create free account
hub / github.com/ByConity/ByConity / getRequiredColumns

Method getRequiredColumns

src/QueryPlan/TableScanStep.cpp:1979–2006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1977}
1978
1979Names TableScanStep::getRequiredColumns(GetFlags flags) const
1980{
1981 LinkedHashSet<String> result;
1982
1983 auto add_columns_in_expr = [&](const auto & expr) {
1984 auto columns = SymbolsExtractor::extract(expr);
1985 result.insert(columns.begin(), columns.end());
1986 };
1987
1988 if (flags & GetFlags::Output)
1989 result.insert(column_names.begin(), column_names.end());
1990
1991 if (flags & GetFlags::Prewhere)
1992 if (auto prewhere = getPrewhere())
1993 add_columns_in_expr(prewhere);
1994
1995 if (flags & GetFlags::BitmapIndex)
1996 {
1997 for (const auto & item : inline_expressions)
1998 {
1999 const auto * func = item.second->as<ASTFunction>();
2000 if (func && functionCanUseBitmapIndex(*func))
2001 add_columns_in_expr(item.second);
2002 }
2003 }
2004
2005 return {result.begin(), result.end()};
2006}
2007
2008bool TableScanStep::hasPrewhere() const
2009{

Callers 3

canReadInPartitionOrderFunction · 0.45
initializePipelineMethod · 0.45
TableScanExecutorMethod · 0.45

Calls 5

extractFunction · 0.85
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected