浏览代码

Merge pull request #12388 from ghalliday/issue21772

HPCC-21772 Track distribution from RIGHT for lightweight local join

Reviewed-By: Shamser Ahmed <shamser.ahmed@lexisnexis.co.uk>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 年之前
父节点
当前提交
090d9fd24a
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      ecl/hql/hqlmeta.cpp

+ 11 - 0
ecl/hql/hqlmeta.cpp

@@ -2360,6 +2360,17 @@ void calculateDatasetMeta(CHqlMetaInfo & meta, IHqlExpression * expr)
                     if (!getBoolAttribute(expr, orderedAtom, true))
                     if (!getBoolAttribute(expr, orderedAtom, true))
                         meta.removeAllSortOrders();
                         meta.removeAllSortOrders();
                     meta.applyProject(mapper);
                     meta.applyProject(mapper);
+                    if (!isKnownDistribution(meta.distribution) && !createDefaultRight)
+                    {
+                        IHqlExpression * rightDistributeInfo = queryDistribution(expr->queryChild(1));
+                        if (isKnownDistribution(rightDistributeInfo))
+                        {
+                            OwnedHqlExpr rightSelect = createSelector(no_right, expr->queryChild(1), expr->queryAttribute(_selectorSequence_Atom));
+                            OwnedHqlExpr mappedRight = mapJoinDistribution(mapper, rightDistributeInfo, rightSelect);
+                            if (mappedRight)
+                                meta.distribution.setown(mappedRight.getClear());
+                        }
+                    }
                 }
                 }
                 else
                 else
                 {
                 {