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

Method printTableScanStep

src/QueryPlan/GraphvizPrinter.cpp:1955–2082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1953
1954
1955String StepPrinter::printTableScanStep(const TableScanStep & step)
1956{
1957 // auto distributed_table = dynamic_cast<StorageDistributed *>(step->getStorage().get());
1958 const String & database = step.getDatabase();
1959 const String & table = step.getTable();
1960 std::stringstream details;
1961 details << database << "." << table << "|";
1962
1963 // if (step.getStorage()->isBucketTable())
1964 // {
1965 // auto & storage = dynamic_cast<MergeTreeMetaBase &>(*(step.getStorage()));
1966 // details << "cluster by ";
1967 // for (const auto & item : storage.cluster_by_columns)
1968 // {
1969 // details << item << " ";
1970 // }
1971 // details << "into " << storage.cluster_by_total_bucket_number << '|';
1972 // }
1973 //
1974 const auto & query_info = step.getQueryInfo();
1975 auto * query = query_info.query->as<ASTSelectQuery>();
1976 if (query->getWhere())
1977 {
1978 details << "Filter : \\n";
1979 details << printFilter(query->refWhere());
1980 details << "|";
1981 }
1982
1983 if (query->getPrewhere())
1984 {
1985 details << "Prewhere : \\n";
1986 details << printFilter(query->refPrewhere());
1987 details << "|";
1988 }
1989
1990 if (step.getQueryInfo().input_order_info)
1991 {
1992 const auto & input_order_info = step.getQueryInfo().input_order_info;
1993 details << "Input Order Info: \\n";
1994 const auto & prefix_descs = input_order_info->order_key_prefix_descr;
1995 if (!prefix_descs.empty())
1996 {
1997 details << "prefix desc: \\n";
1998 for (const auto & desc : prefix_descs)
1999 {
2000 details << desc.column_name << " " << desc.direction << " " << desc.nulls_direction << "\\n";
2001 }
2002 }
2003 details << "direction: " << input_order_info->direction << "\\n";
2004
2005 details << "|";
2006 }
2007
2008 if (query->getLimitLength())
2009 {
2010 details << "Limit : \\n";
2011 Field converted = convertFieldToType(query->refLimitLength()->as<ASTLiteral>()->value, DataTypeUInt64());
2012 details << converted.safeGet<UInt64>();

Callers

nothing calls this directly

Calls 15

convertFieldToTypeFunction · 0.85
getQueryInfoMethod · 0.80
getWhereMethod · 0.80
sampleSizeMethod · 0.80
sampleOffsetMethod · 0.80
getPushdownFilterCastMethod · 0.80
toStringFunction · 0.50
serializeASTFunction · 0.50
getDatabaseMethod · 0.45
getTableMethod · 0.45

Tested by

no test coverage detected