浏览代码

HPCC-9990 Add an option to convert SORTED/DISTRIBUTED to ASSERT forms

Will create assertions for both SORTED and DISTRIBUTED i.e. as if the following
was used.

SORTED(ds, ..., ASSERT)
DISTRIBUTED(ds, ..., ASSERT)

Signed-off-by: jamienoss <james.noss@lexisnexis.com>
jamienoss 11 年之前
父节点
当前提交
edcdcdf706
共有 4 个文件被更改,包括 5 次插入1 次删除
  1. 1 0
      ecl/hqlcpp/hqlcpp.cpp
  2. 1 0
      ecl/hqlcpp/hqlcpp.ipp
  3. 2 1
      ecl/hqlcpp/hqlttcpp.cpp
  4. 1 0
      ecl/hqlcpp/hqlttcpp.ipp

+ 1 - 0
ecl/hqlcpp/hqlcpp.cpp

@@ -1544,6 +1544,7 @@ void HqlCppTranslator::cacheOptions()
         DebugOption(options.defaultExpiry, "defaultExpiry", DEFAULT_EXPIRY_PERIOD),
 
         DebugOption(options.checkAsserts,"checkAsserts", true),
+        DebugOption(options.assertSortedDistributed,"assertSortedDistributed", false),
         DebugOption(options.optimizeLoopInvariant,"optimizeLoopInvariant", false),      // doesn't fully work yet! and has little effect, and messes up the alias dependencies
         DebugOption(options.defaultImplicitKeyedJoinLimit, "defaultImplicitKeyedJoinLimit", 10000),
         DebugOption(options.defaultImplicitIndexReadLimit, "defaultImplicitIndexReadLimit", 0),

+ 1 - 0
ecl/hqlcpp/hqlcpp.ipp

@@ -577,6 +577,7 @@ struct HqlCppOptions
     bool                optimizeResourcedProjects;
     byte                notifyOptimizedProjects;
     bool                checkAsserts;
+    bool                assertSortedDistributed;
     bool                optimizeLoopInvariant;
     bool                warnOnImplicitJoinLimit;
     bool                warnOnImplicitReadLimit;

+ 2 - 1
ecl/hqlcpp/hqlttcpp.cpp

@@ -10526,6 +10526,7 @@ HqlTreeNormalizer::HqlTreeNormalizer(HqlCppTranslator & _translator) : NewHqlTra
     seenForceLocal = false;
     seenLocalUpload = false;
     const HqlCppOptions & translatorOptions = translator.queryOptions();
+    options.assertSortedDistributed = translatorOptions.assertSortedDistributed;
     options.removeAsserts = !translatorOptions.checkAsserts;
     options.commonUniqueNameAttributes = translatorOptions.commonUniqueNameAttributes;
     options.sortIndexPayload = translatorOptions.sortIndexPayload;
@@ -11381,7 +11382,7 @@ IHqlExpression * HqlTreeNormalizer::transformIfAssert(node_operator newOp, IHqlE
     unsigned max = expr->numChildren();
     HqlExprArray children;
     bool same = transformChildren(expr, children);
-    if (expr->hasAttribute(assertAtom) && !options.removeAsserts)
+    if ((expr->hasAttribute(assertAtom) || (options.assertSortedDistributed && (newOp != no_assertgrouped))) && !options.removeAsserts)
     {
         OwnedHqlExpr ret = createDataset(newOp, children);
         return expr->cloneAllAnnotations(ret);

+ 1 - 0
ecl/hqlcpp/hqlttcpp.ipp

@@ -1209,6 +1209,7 @@ protected:
     HqlExprArray defines;
     struct
     {
+        bool assertSortedDistributed;
         bool removeAsserts;
         bool commonUniqueNameAttributes;
         bool sortIndexPayload;