From d05ab65745fd6e3587eaa6632e6bb9f6f5c60be1 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Thu, 27 Jun 2024 10:19:22 +0100 Subject: [PATCH] HPCC-32164 Minor improvements to new filename gathering code Signed-off-by: Gavin Halliday --- common/workunit/workunit.cpp | 23 ++++++++++++++++------- ecl/hqlcpp/hqlcpp.ipp | 30 +++++++++++++++++------------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/common/workunit/workunit.cpp b/common/workunit/workunit.cpp index 1337d27a276..4b5b7223a9d 100644 --- a/common/workunit/workunit.cpp +++ b/common/workunit/workunit.cpp @@ -8745,12 +8745,20 @@ static const char *summaryTypeName(SummaryType type) bool CLocalWorkUnit::getSummary(SummaryType type, SummaryMap &map) const { VStringBuffer xpath("Summaries/%s", summaryTypeName(type)); - CriticalBlock block(crit); - const char *list = p->queryProp(xpath); - if (!list) - return false; StringArray s; - s.appendList(list, "\n"); + { + CriticalBlock block(crit); + IPropertyTree * match = p->queryPropTree(xpath); + //If there is not entry then the information is not recorded in the workunit + if (!match) + return false; + + const char *list = match->queryProp(nullptr); + //If the information was recorded return true, even if ther are no results + if (!list) + return true; + s.appendList(list, "\n"); + } ForEachItemIn(idx, s) { const char *name = s.item(idx); @@ -8761,10 +8769,11 @@ bool CLocalWorkUnit::getSummary(SummaryType type, SummaryMap &map) const if (*end!=':') return false; // unrecognized format name = end+1; - if (map.find(name) == map.end()) + auto match = map.find(name); + if (match == map.end()) map[name] = flags; else - map[name] = map[name] & flags; + match->second &= flags; } } return true; diff --git a/ecl/hqlcpp/hqlcpp.ipp b/ecl/hqlcpp/hqlcpp.ipp index 0607c583892..ce13dba6eef 100644 --- a/ecl/hqlcpp/hqlcpp.ipp +++ b/ecl/hqlcpp/hqlcpp.ipp @@ -2146,19 +2146,23 @@ protected: SummaryMap summaries[(int) SummaryType::NumItems]; void noteSummaryInfo(const char *name, SummaryType type, bool isOpt, bool isSigned) { - if (type != SummaryType::None) - { - SummaryMap &map = summaries[(int) type]; - SummaryFlags flags = SummaryFlags::None; - if (isOpt) - flags |= SummaryFlags::IsOpt; - if (isSigned) - flags |= SummaryFlags::IsSigned; - if (map.find(name) == map.end()) - map[name] = flags; - else - map[name] = map[name] & flags; - } + if (type == SummaryType::None) + return; + //Spill files are meaningless in roxie, and no current benefit in recording them for hthor/thor + if (type == SummaryType::SpillFile) + return; + + SummaryMap &map = summaries[(int) type]; + SummaryFlags flags = SummaryFlags::None; + if (isOpt) + flags |= SummaryFlags::IsOpt; + if (isSigned) + flags |= SummaryFlags::IsSigned; + auto match = map.find(name); + if (match == map.end()) + map[name] = flags; + else + match->second &= flags; } };