Przeglądaj źródła

HPCC-16142 Fix problems creating spills from dictionaries

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 lat temu
rodzic
commit
d6742af399
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      ecl/hqlcpp/hqlresource.cpp

+ 8 - 2
ecl/hqlcpp/hqlresource.cpp

@@ -2668,6 +2668,9 @@ IHqlExpression * SpillerInfo::createSpilledRead(IHqlExpression * spillReason)
             dataset.setown(createDataset(no_table, args));
         }
 
+        if (original->isDictionary() && !dataset->isDictionary())
+            dataset.setown(createDictionary(no_createdictionary, LINK(dataset)));
+
         loseDistribution = false;
     }
 
@@ -2716,16 +2719,19 @@ IHqlExpression * SpillerInfo::createSpilledWrite(IHqlExpression * transformed, b
     }
     else
     {
+        LinkedHqlExpr dataset = LINK(transformed);
+        if (dataset->isDictionary())
+            dataset.setown(createDataset(no_datasetfromdictionary, dataset.getClear()));
         if (options->createSpillAsDataset && allowCommonDataset)
         {
-            IHqlExpression * value = LINK(transformed);
+            IHqlExpression * value = dataset.getClear();
             if (value->isDatarow())
                 value = createDatasetFromRow(value);
             spilledDataset.setown(createDataset(no_commonspill, value));
             args.append(*LINK(spilledDataset));
         }
         else
-            args.append(*LINK(transformed));
+            args.append(*dataset.getClear());
 
         args.append(*createSpillName());
         addSpillFlags(args, false);