Browse Source

HPCC-12877 Use spilling sort by default when index building

Minor changes following review.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 years ago
parent
commit
d1412c0f2e

+ 2 - 0
ecl/hql/hqlatoms.cpp

@@ -390,6 +390,7 @@ IAtom * sort_AllAtom;
 IAtom * sort_KeyedAtom;
 IAtom * sortedAtom;
 IAtom * sourceAtom;
+IAtom * spillAtom;
 IAtom * stableAtom;
 IAtom * _state_Atom;
 IAtom * steppedAtom;
@@ -821,6 +822,7 @@ MODULE_INIT(INIT_PRIORITY_HQLATOM)
     sort_KeyedAtom = createLowerCaseAtom("SORT KEYED");
     MAKEATOM(sorted);
     MAKEATOM(source);
+    MAKEATOM(spill);
     MAKEATOM(stable);
     MAKESYSATOM(state);
     MAKEATOM(stepped);

+ 1 - 0
ecl/hql/hqlatoms.hpp

@@ -393,6 +393,7 @@ extern HQL_API IAtom * sort_AllAtom;
 extern HQL_API IAtom * sort_KeyedAtom;
 extern HQL_API IAtom * sortedAtom;
 extern HQL_API IAtom * sourceAtom;
+extern HQL_API IAtom * spillAtom;
 extern HQL_API IAtom * stableAtom;
 extern HQL_API IAtom * _state_Atom;
 extern HQL_API IAtom * steppedAtom;

+ 2 - 2
ecl/hql/hqlmeta.cpp

@@ -1574,8 +1574,8 @@ IHqlExpression * ensureSorted(IHqlExpression * dataset, IHqlExpression * order,
     }
 
     IHqlExpression * attr1 = isLocal ? createLocalAttribute() : (isGrouped(dataset) && ignoreGrouping) ? createAttribute(globalAtom) : NULL;
-    IHqlExpression * attr2 = requestSpilling ? createAttribute(internalAtom) : NULL;
-    return createDatasetF(no_sort, LINK(dataset), LINK(order), attr1 ? attr1 : attr2, attr1 ? attr2 : NULL, NULL);
+    IHqlExpression * attr2 = requestSpilling ? createAttribute(spillAtom) : NULL;
+    return createDatasetF(no_sort, LINK(dataset), LINK(order), createComma(attr1, attr2), NULL);
 }
 
 //-------------------------------

+ 0 - 2
ecl/hqlcpp/hqlcatom.cpp

@@ -89,7 +89,6 @@ IAtom * serializerInstanceMarkerAtom;
 IAtom * skipActionMarkerAtom;
 IAtom * skipReturnMarkerAtom;
 IAtom * speedAtom;
-IAtom * spillAtom;
 IAtom * _spill_Atom;
 IAtom * _spillReason_Atom;
 IAtom * _steppedMeta_Atom;
@@ -1470,7 +1469,6 @@ MODULE_INIT(INIT_PRIORITY_HQLATOM-1)
     MAKEATOM(skipActionMarker);
     MAKEATOM(skipReturnMarker);
     MAKEATOM(speed);
-    MAKEATOM(spill);
     MAKEATOM(subgraph);
     utf8Atom = createAtom("utf-8");
     MAKEATOM(wrapper);

+ 0 - 1
ecl/hqlcpp/hqlcatom.hpp

@@ -89,7 +89,6 @@ extern IAtom * serializerInstanceMarkerAtom;
 extern IAtom * skipActionMarkerAtom;
 extern IAtom * skipReturnMarkerAtom;
 extern IAtom * speedAtom;
-extern IAtom * spillAtom;
 extern IAtom * _spill_Atom;
 extern IAtom * _spillReason_Atom;
 extern IAtom * _steppedMeta_Atom;

+ 2 - 4
ecl/hqlcpp/hqlhtcpp.cpp

@@ -16368,7 +16368,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivitySort(BuildCtx & ctx, IHqlExpre
 
     IHqlExpression * stable = expr->queryAttribute(stableAtom);
     IHqlExpression * unstable = expr->queryAttribute(unstableAtom);
-    IHqlExpression * internal = expr->queryAttribute(internalAtom);
+    IHqlExpression * spill = expr->queryAttribute(spillAtom);
     IHqlExpression * method = NULL;
     StringBuffer flags;
     if (stable)
@@ -16381,10 +16381,8 @@ ABoundActivity * HqlCppTranslator::doBuildActivitySort(BuildCtx & ctx, IHqlExpre
         flags.append("|TAFunstable");
         method = unstable->queryChild(0);
     }
-    if (internal)
-    {
+    if (spill)
         flags.append("|TAFspill");
-    }
     if (!method || method->isConstant())
         flags.append("|TAFconstant");