瀏覽代碼

Merge pull request #15717 from ghalliday/issue27112

HPCC-27112 Add a flag to a workunit if query is simple

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 年之前
父節點
當前提交
fff2508bcc
共有 4 個文件被更改,包括 19 次插入1 次删除
  1. 1 1
      ecl/agentexec/agentexec.cpp
  2. 1 0
      ecl/hqlcpp/hqlcpp.ipp
  3. 14 0
      ecl/hqlcpp/hqlhtcpp.cpp
  4. 3 0
      ecl/hqlcpp/hqlttcpp.cpp

+ 1 - 1
ecl/agentexec/agentexec.cpp

@@ -245,7 +245,7 @@ public:
                 wuid.set(sArray.item(0));
                 graphName.set(sArray.item(1));
 
-                // JCSMORE - idealy apptype, image and executable name would all be same.
+                // JCSMORE - ideally apptype, image and executable name would all be same.
                 jobSpecName.set("thormanager");
                 processName.set("thormaster_lcr");
             }

+ 1 - 0
ecl/hqlcpp/hqlcpp.ipp

@@ -2036,6 +2036,7 @@ public:
     unsigned nextLibrarySequence() { return librarySequence++; }
     unsigned queryMaxWfid() { return maxWfid; }
     void setMaxWfid(unsigned wfid) { maxWfid = wfid; }
+    bool isLightweightQuery(WorkflowArray & workflow);
 
 public:
     void traceExpression(const char * title, IHqlExpression * expr, unsigned level=500);

+ 14 - 0
ecl/hqlcpp/hqlhtcpp.cpp

@@ -19872,6 +19872,20 @@ void HqlCppTranslator::pickBestEngine(WorkflowArray & workflow)
     }
 }
 
+bool HqlCppTranslator::isLightweightQuery(WorkflowArray & workflow)
+{
+    ForEachItemIn(idx2, workflow)
+    {
+        HqlExprArray & exprs = workflow.item(idx2).queryExprs();
+        ForEachItemIn(idx, exprs)
+        {
+            if (needsRealThor(&exprs.item(idx), 0))
+                return false;
+        }
+    }
+    return true;
+}
+
 unsigned getVirtualFieldSize(IHqlExpression * record)
 {
     unsigned size = 0;

+ 3 - 0
ecl/hqlcpp/hqlttcpp.cpp

@@ -14356,6 +14356,9 @@ bool HqlCppTranslator::transformGraphForGeneration(HqlQueryContext & query, Work
 #endif
     updateClusterType();
 
+    if (isLightweightQuery(workflow))
+        wu()->setDebugValueInt("isLightweightQuery", 1, true);
+
     ForEachItemIn(i2, workflow)
     {
         WorkflowItem & curWorkflow = workflow.item(i2);