Przeglądaj źródła

HPCC-16843 Ensure ,DISTRIBUTE has an effect on constant inline datasets

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 lat temu
rodzic
commit
8a860cd2da

+ 1 - 1
ecl/hqlcpp/hqlhtcpp.cpp

@@ -17295,7 +17295,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityInlineTable(BuildCtx & ctx, IH
         return doBuildActivityCreateRow(ctx, row, true);
     }
 
-    if (values->isConstant())
+    if (values->isConstant() && !expr->hasAttribute(distributedAtom))
     {
         CHqlBoundExpr bound;
         if (doBuildConstantDatasetInlineTable(expr, bound, FormatNatural))

+ 32 - 0
testing/regress/ecl/distributeddataset.ecl

@@ -0,0 +1,32 @@
+zero := 0 : stored('zero');
+d := dataset([
+        {0},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9},
+        {1},{1},{2},{3},{4},{8},{9}
+        ], { unsigned r; }, DISTRIBUTED);
+p2 := TABLE(NOFOLD(d), { COUNT(group) }, LOCAL);
+output(count(p2) = CLUSTERSIZE);

+ 3 - 0
testing/regress/ecl/key/distributeddataset.xml

@@ -0,0 +1,3 @@
+<Dataset name='Result 1'>
+ <Row><Result_1>true</Result_1></Row>
+</Dataset>