浏览代码

Merge remote-tracking branch 'origin/candidate-3.8.x' into candidate-3.10.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 年之前
父节点
当前提交
ee68bda0d8
共有 2 个文件被更改,包括 57 次插入2 次删除
  1. 8 2
      ecl/hqlcpp/hqliproj.cpp
  2. 49 0
      ecl/regress/nested12.ecl

+ 8 - 2
ecl/hqlcpp/hqliproj.cpp

@@ -290,10 +290,16 @@ IHqlExpression * UsedFieldSet::createFilteredAssign(IHqlExpression * field, IHql
                 {
                     newTransform.setown(match->used.createFilteredTransform(value->queryChild(0), exceptionFields));
                 }
-                else
+                else if (value->getOperator() == no_select)
                 {
                     newTransform.setown(match->used.createRowTransform(value, exceptionFields));
                 }
+                else
+                {
+                    OwnedHqlExpr row = createRow(no_newrow, LINK(value));
+                    newTransform.setown(match->used.createRowTransform(row, exceptionFields));
+                }
+
 
                 newValue.setown(createRow(no_createrow, newTransform.getClear()));
 #if defined(PRESERVE_TRANSFORM_ANNOTATION)
@@ -369,7 +375,7 @@ IHqlExpression * UsedFieldSet::createRowTransform(IHqlExpression * row, const Us
     ForEachItemIn(i, fields)
     {
         IHqlExpression & field = fields.item(i);
-        OwnedHqlExpr value = createNewSelectExpr(LINK(row), LINK(&field));
+        OwnedHqlExpr value = createSelectExpr(LINK(row), LINK(&field));
         OwnedHqlExpr assign = createFilteredAssign(&field, value, self, exceptions);
         if (assign)
             assigns.append(*assign.getClear());

+ 49 - 0
ecl/regress/nested12.ecl

@@ -0,0 +1,49 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+#option ('targetClusterType', 'thorlcr');
+
+level1Rec := RECORD
+    UNSIGNED a;
+    UNSIGNED b;
+    UNSIGNED c;
+END;
+
+level2Rec := RECORD
+    unsigned id;
+    level1Rec a;
+END;
+
+ds1 := DATASET('ds1', level2Rec, thor);
+ds2 := DATASET('ds2', level1Rec, thor);
+
+j := JOIN(ds1, ds2, LEFT.id = right.a, transform(level2Rec, self.a := RIGHT; SELF := LEFT));
+
+d := DEDUP(j, a.b, a.c);
+
+c := table(d, { d, cnt := count(group) },  a.b);
+
+xRec := record
+    unsigned id;
+    unsigned a;
+END;
+
+ds3 := dataset('ds3', xRec, thor);
+
+j2 := JOIN(ds3, c(cnt=1), left.id=right.a.b, transform(xRec, SELF.a := RIGHT.a.c; SELF := LEFT));
+output(j2);
+