瀏覽代碼

HPCC-16638 Improve option to regenerate ECL and add it to help

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 年之前
父節點
當前提交
9baf74e122
共有 5 個文件被更改,包括 11 次插入7 次删除
  1. 1 0
      ecl/eclcc/eclcc.hpp
  2. 7 4
      ecl/hql/hqlthql.cpp
  3. 1 1
      ecl/hqlcpp/hqlcpp.cpp
  4. 1 1
      ecl/hqlcpp/hqlcpp.ipp
  5. 1 1
      ecl/hqlcpp/hqlhtcpp.cpp

+ 1 - 0
ecl/eclcc/eclcc.hpp

@@ -124,6 +124,7 @@ const char * const helpText[] = {
     "?!  -fshowMetaInGraph       Add distribution/sort orders to the graph",
     "?!  -fshowRecordCountInGraph  Show estimates of record counts in the graph",
     "?!  -fspanMultipleCpp       Generate a work unit in multiple c++ files",
+    "?!  -fsubgraphToRegenerate=n Regenerate the ECL for a particular subgraph",
     "",
 };
 

+ 7 - 4
ecl/hql/hqlthql.cpp

@@ -894,7 +894,7 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
     {
         if (expr->isDataset() || expr->isDictionary())
         {
-            if (!isNamedSymbol && expandProcessed && no != no_field && no != no_rows && !isTargetSelector(expr))
+            if (!isNamedSymbol && (expandProcessed || tryToRegenerate) && no != no_field && no != no_rows && !isTargetSelector(expr))
             {
                 if (!expr->queryTransformExtra())
                 {
@@ -1926,8 +1926,11 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
         {
             s.append("DATASET(WORKUNIT(");
             toECL(child1, s, false, inType);
-            s.append(", ");
-            toECL(expr->queryChild(2), s, false, inType);
+            if (!isInternalAttribute(expr->queryChild(2)) || expandProcessed)
+            {
+                s.append(", ");
+                toECL(expr->queryChild(2), s, false, inType);
+            }
             if (expandProcessed)
                 childrenToECL(expr, s, false, true, 3);
             s.append("), ");
@@ -2549,7 +2552,7 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
             break;
         case no_getgraphresult:
         case no_setgraphresult:
-            if (expandProcessed)
+            if (expandProcessed || tryToRegenerate)
                 defaultToECL(expr, s, inType);
             else
             {

+ 1 - 1
ecl/hqlcpp/hqlcpp.cpp

@@ -1571,7 +1571,7 @@ void HqlCppTranslator::cacheOptions()
         DebugOption(options.optimizeBoolReturn,"optimizeBoolReturn", true),
         DebugOption(options.freezePersists,"freezePersists", false),
         DebugOption(options.maxRecordSize, "defaultMaxLengthRecord", MAX_RECORD_SIZE),
-        DebugOption(options.subgraphToRegeneate, "subgraphToRegeneate", 0),
+        DebugOption(options.subgraphToRegenerate, "subgraphToRegenerate", 0),
 
         DebugOption(options.checkRoxieRestrictions,"checkRoxieRestrictions", true),     // a debug aid for running regression suite
         DebugOption(options.checkThorRestrictions,"checkThorRestrictions", true),       // a debug aid for running regression suite

+ 1 - 1
ecl/hqlcpp/hqlcpp.ipp

@@ -578,7 +578,7 @@ struct HqlCppOptions
     unsigned            applyInstantEclTransformationsLimit;
     unsigned            complexClassesThreshold;
     unsigned            complexClassesActivityFilter;
-    unsigned            subgraphToRegeneate;
+    unsigned            subgraphToRegenerate;
     unsigned            defaultPersistExpiry;
     unsigned            defaultExpiry;
     int                 defaultNumPersistInstances;

+ 1 - 1
ecl/hqlcpp/hqlhtcpp.cpp

@@ -9221,7 +9221,7 @@ unsigned HqlCppTranslator::doBuildThorChildSubGraph(BuildCtx & ctx, IHqlExpressi
 
     OwnedHqlExpr idExpr = createConstant((__int64)thisId);
     ctx.associateExpr(expr, idExpr);
-    if (thisId == options.subgraphToRegeneate)
+    if (thisId == options.subgraphToRegenerate)
     {
         StringBuffer ecl;
         regenerateECL(expr, ecl);