Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-3.10.0' into candidate…
Browse files Browse the repository at this point in the history
…-3.10.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
  • Loading branch information
richardkchapman committed Nov 30, 2012
2 parents 9ad4505 + adc6a75 commit 33cdd43
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 44 deletions.
6 changes: 5 additions & 1 deletion esp/bindings/SOAP/Platform/soapparam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,11 @@ bool EspBaseArrayParam::unmarshallItems(IEspContext* ctx, CSoapValue *sv, const
if (ctx && optGroup)
ctx->addOptGroup(optGroup);
ForEachItemIn(i, *children)
append(ctx, children->item(i));
{
CSoapValue &child = children->item(i);
child.setEncodeXml(false);
append(ctx, child);
}
return true;
}
return false;
Expand Down
44 changes: 24 additions & 20 deletions esp/files/ecl/DENORMALIZE_Example.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
STRING1 Value1;
STRING1 Value2;
END;

ParentFile := DATASET([{'C','A'},
{'B','B'},
{'A','C'}],MyRec);
{'B','B'},
{'A','C'}],MyRec);
ChildFile := DATASET([{'C','X'},
{'B','S'},
{'C','W'},
{'B','Y'},
{'A','Z'},
{'A','T'}],MyRec);
{'B','S'},
{'C','W'},
{'B','Y'},
{'A','Z'},
{'A','T'}],MyRec);

MyOutRec := RECORD
ParentFile.Value1;
ParentFile.Value2;
Expand All @@ -21,22 +23,24 @@ END;
P_Recs := TABLE(ParentFile, MyOutRec);
OUTPUT(P_Recs,NAMED('ParentDataReady'));
/* P_Recs result set is:
Rec# Value1 PVal2 CVal2_1 CVal2_2
1 C A
2 B B
3 A C */
Rec# Value1 PVal2 CVal2_1 CVal2_2
1 C A
2 B B
3 A C */

MyOutRec DeNormThem(MyOutRec L, MyRec R, INTEGER C) := TRANSFORM
SELF.CVal2_1 := IF(C = 1, R.Value2, L.CVal2_1);
SELF.CVal2_2 := IF(C = 2, R.Value2, L.CVal2_2);
SELF := L;
SELF.CVal2_1 := IF(C = 1, R.Value2, L.CVal2_1);
SELF.CVal2_2 := IF(C = 2, R.Value2, L.CVal2_2);
SELF := L;
END;
DeNormedRecs := DENORMALIZE(P_Recs, ChildFile,
LEFT.Value1 = RIGHT.Value1,
DeNormThem(LEFT,RIGHT,COUNTER));
LEFT.Value1 = RIGHT.Value1,
DeNormThem(LEFT,RIGHT,COUNTER));
OUTPUT(DeNormedRecs,NAMED('NestedChildDataset'));

/* DeNormedRecs result set is:
Rec# Value1 PVal2 CVal2_1 CVal2_2
1 A C Z T
2 B B Y S
3 C A X W
Rec# Value1 PVal2 CVal2_1 CVal2_2
1 A C Z T
2 B B S Y
3 C A X W
*/
42 changes: 21 additions & 21 deletions esp/files/ecl/MACRO_Example.ecl
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
MyRec := RECORD
STRING1 Value1;
STRING1 Value2;
STRING1 Value1;
STRING1 Value2;
END;
SomeFile := DATASET([{'C','G'},
{'C','C'}],MyRec);
{'C','C'}],MyRec);
OtherFile := DATASET([{'A','X'},
{'B','G'},
{'A','B'}],MyRec);
{'B','G'},
{'A','B'}],MyRec);

MAC_AddCat(AttrName,FirstArg,SecondArg) := MACRO
AttrName := FirstArg + SecondArg;
OUTPUT(AttrName);
AttrName := FirstArg + SecondArg;
OUTPUT(AttrName);
ENDMACRO;

MAC_AddCat(AddValues,5,10)
/*generates this code:
AddValues := 5 + 10;
OUTPUT(AddValues);
AddValues := 5 + 10;
OUTPUT(AddValues);
which results in: 15
*/

MAC_AddCat(CatValues,'5','10')
/*generates this code:
CatValues := '5' + '10';
OUTPUT(CatValues);
CatValues := '5' + '10';
OUTPUT(CatValues);
which results in: '510'
*/

MAC_AddCat(JoinFiles,SORT(SomeFile,Value1,Value2),SORT(OtherFile,Value1,Value2))
/*generates this code:
JoinFiles := SORT(SomeFile,Value1,Value2) + SORT(OtherFile,Value1,Value2);
OUTPUT(JoinFiles);
JoinFiles := SORT(SomeFile,Value1,Value2) + SORT(OtherFile,Value1,Value2);
OUTPUT(JoinFiles);
which results in:
Rec# Value1 Value2
1 A B
2 A X
3 B G
4 C C
5 C G
Rec# Value1 Value2
1 C C
2 C G
3 A B
4 A X
5 B G
*/
2 changes: 1 addition & 1 deletion thorlcr/activities/hashdistrib/thhashdistribslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ class CDistributorBase : public CSimpleInterface, implements IHashDistributor, i
}
}
}
const void *row = input->nextRow();
const void *row = input->ungroupedNextRow();
if (!row)
break;
unsigned dest = owner.ihash->hash(row)%owner.numnodes;
Expand Down
5 changes: 4 additions & 1 deletion thorlcr/activities/lookupjoin/thlookupjoinslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ class CSendItem : public CSimpleInterface
{
CMessageBuffer msg;
broadcast_code code;
unsigned origin;
unsigned origin, headerLen;
public:
CSendItem(broadcast_code _code, unsigned _origin) : code(_code), origin(_origin)
{
msg.append((unsigned)code);
msg.append(origin);
headerLen = msg.length();
}
CSendItem(CMessageBuffer &_msg)
{
Expand All @@ -59,6 +60,7 @@ class CSendItem : public CSimpleInterface
msg.read(origin);
}
unsigned length() const { return msg.length(); }
void reset() { msg.setLength(headerLen); }
CMessageBuffer &queryMsg() { return msg; }
broadcast_code queryCode() const { return code; }
unsigned queryOrigin() const { return origin; }
Expand Down Expand Up @@ -1128,6 +1130,7 @@ class CLookupJoinActivity : public CSlaveActivity, public CThorDataLink, impleme
if (!broadcaster.send(sendItem))
break;
mb.clear();
sendItem->reset();
}
}
catch (IException *e)
Expand Down

0 comments on commit 33cdd43

Please sign in to comment.