Skip to content

Commit

Permalink
Merge pull request #17729 from JamesDeFabia/HPCC-30170Runnable3
Browse files Browse the repository at this point in the history
HPCC-30170 Add Runnable to more ECL examples

Reviewed-By: Richard Taylor <[email protected]>
Reviewed-By: Greg Panagiotatos <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Sep 8, 2023
2 parents 6fcf405 + 47803e6 commit 5a34bb0
Show file tree
Hide file tree
Showing 116 changed files with 1,597 additions and 1,065 deletions.
6 changes: 3 additions & 3 deletions docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-JOIN.xml
Original file line number Diff line number Diff line change
Expand Up @@ -999,12 +999,12 @@ SEQUENTIAL(PtblOut,Bld1,Bld2,OUTPUT(FilledRecs1),OUTPUT(FilledRecs2))
<emphasis>joincondition</emphasis> is duplicated between adjacent pairs of
datasets, which means that this <emphasis>joincondition</emphasis>:</para>

<programlisting> LEFT.field = RIGHT.field</programlisting>
<programlisting lang="ECL" role="fragment"> LEFT.field = RIGHT.field</programlisting>

<para>when applied against a <emphasis>setofdatasets </emphasis>containing
three datasets, is logically equivalent to:</para>

<programlisting> ds1.field = ds2.field AND ds2.field = ds3.field</programlisting>
<programlisting lang="ECL" role="fragment"> ds1.field = ds2.field AND ds2.field = ds3.field</programlisting>
</sect2>

<sect2 id="TRANSFORM_Function_Requirements_parameters">
Expand Down Expand Up @@ -1101,7 +1101,7 @@ SEQUENTIAL(PtblOut,Bld1,Bld2,OUTPUT(FilledRecs1),OUTPUT(FilledRecs2))

<para>Example:</para>

<programlisting id="ECL" role="runnable">Rec := RECORD,MAXLENGTH(4096)
<programlisting lang="ECL" role="runnable">Rec := RECORD,MAXLENGTH(4096)
STRING1 Letter;
UNSIGNED1 DS;
UNSIGNED1 Matches := 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@

<para>Example:</para>

<programlisting>Vehicles := DATASET('vehicles',
<programlisting lang="ECL">Vehicles := DATASET('vehicles',
{STRING2 st,
STRING20 city,
STRING20 lname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@

<para>Example:</para>

<programlisting>Vehicles := DATASET('vehicles',
<programlisting lang="ECL">Vehicles := DATASET('vehicles',
{STRING2 st,
STRING20 city,
STRING20 lname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<para>Example:</para>

<programlisting>//where you might do this:
<programlisting lang="ECL">//where you might do this:
my_record := RECORD
UNICODE_en_US str;
END;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@

<para>Example:</para>

<programlisting>INTEGER MyLength := LENGTH('XYZ' + 'ABC');
//MyLength is 6</programlisting>
<programlisting lang="ECL" role="runnable">INTEGER MyLength := LENGTH('XYZ' + 'ABC');
OUTPUT(MyLength); //MyLength is 6</programlisting>

<para>See Also: <link linkend="String_Operators">String Operators</link>, <link linkend="STRING">STRING</link></para>
<para>See Also: <link linkend="String_Operators">String Operators</link>,
<link linkend="STRING">STRING</link></para>
</sect1>
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

<para>Example:</para>

<programlisting>NamesRec := RECORD
<programlisting lang="ECL" role="notrunnable">NamesRec := RECORD
INTEGER1 NameID;
STRING20 FName;
STRING20 LName;
Expand Down
129 changes: 79 additions & 50 deletions docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-LIMIT.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
</indexterm></emphasis><emphasis> </emphasis><emphasis role="bold">] ]
[</emphasis><emphasis>, </emphasis><emphasis role="bold">SKIP<indexterm>
<primary>SKIP</primary>
</indexterm></emphasis> <emphasis role="bold">[, UNORDERED | ORDERED(</emphasis> <emphasis>bool </emphasis><emphasis role="bold">) ] [, STABLE | UNSTABLE ] [, PARALLEL [ (</emphasis> <emphasis>numthreads </emphasis><emphasis role="bold">) ] ] [, ALGORITHM(</emphasis> <emphasis>name </emphasis><emphasis role="bold">) ] )</emphasis></para>
</indexterm></emphasis> <emphasis role="bold">[, UNORDERED |
ORDERED(</emphasis> <emphasis>bool </emphasis><emphasis role="bold">) ] [,
STABLE | UNSTABLE ] [, PARALLEL [ (</emphasis> <emphasis>numthreads
</emphasis><emphasis role="bold">) ] ] [, ALGORITHM(</emphasis>
<emphasis>name </emphasis><emphasis role="bold">) ] )</emphasis></para>

<para><emphasis role="bold">LIMIT(</emphasis><emphasis>recset,
maxrecs</emphasis><emphasis role="bold"> [</emphasis><emphasis>,
Expand All @@ -34,8 +38,12 @@
role="bold">[</emphasis><emphasis>, </emphasis><emphasis
role="bold">COUNT<indexterm>
<primary>COUNT</primary>
</indexterm></emphasis><emphasis> </emphasis><emphasis role="bold">] ]
[, UNORDERED | ORDERED(</emphasis> <emphasis>bool </emphasis><emphasis role="bold">) ] [, STABLE | UNSTABLE ] [, PARALLEL [ (</emphasis> <emphasis>numthreads </emphasis><emphasis role="bold">) ] ] [, ALGORITHM(</emphasis> <emphasis>name </emphasis><emphasis role="bold">) ]</emphasis></para>
</indexterm></emphasis><emphasis> </emphasis><emphasis role="bold">] ] [,
UNORDERED | ORDERED(</emphasis> <emphasis>bool </emphasis><emphasis
role="bold">) ] [, STABLE | UNSTABLE ] [, PARALLEL [ (</emphasis>
<emphasis>numthreads </emphasis><emphasis role="bold">) ] ] [,
ALGORITHM(</emphasis> <emphasis>name </emphasis><emphasis role="bold">)
]</emphasis></para>

<informaltable colsep="1" frame="all" rowsep="1">
<tgroup cols="2">
Expand Down Expand Up @@ -99,52 +107,70 @@
<entry>The TRANSFORM function to call to produce the single output
record.</entry>
</row>
<row>
<entry><emphasis role="bold">UNORDERED</emphasis></entry>

<entry>Optional. Specifies the output record order is not significant.</entry>
</row>
<row>
<entry><emphasis role="bold">ORDERED</emphasis></entry>

<entry>Specifies the significance of the output record order.</entry>
</row>
<row>
<entry><emphasis>bool</emphasis></entry>

<entry>When False, specifies the output record order is not significant. When True, specifies the default output record order.</entry>
</row>
<row>
<entry><emphasis role="bold">STABLE</emphasis></entry>

<entry>Optional. Specifies the input record order is significant.</entry>
</row>
<row>
<entry><emphasis role="bold">UNSTABLE</emphasis></entry>

<entry>Optional. Specifies the input record order is not significant.</entry>
</row>
<row>
<entry><emphasis role="bold">PARALLEL</emphasis></entry>

<entry>Optional. Try to evaluate this activity in parallel.</entry>
</row>
<row>
<entry><emphasis>numthreads</emphasis></entry>

<entry>Optional. Try to evaluate this activity using <emphasis>numthreads</emphasis> threads.</entry>
</row>
<row>
<entry><emphasis role="bold">ALGORITHM</emphasis></entry>

<entry>Optional. Override the algorithm used for this activity.</entry>
</row>
<row>
<entry><emphasis>name</emphasis></entry>

<entry>The algorithm to use for this activity. Must be from the list of supported algorithms for the SORT function's STABLE and UNSTABLE options.</entry>
</row>


<row>
<entry><emphasis role="bold">UNORDERED</emphasis></entry>

<entry>Optional. Specifies the output record order is not
significant.</entry>
</row>

<row>
<entry><emphasis role="bold">ORDERED</emphasis></entry>

<entry>Specifies the significance of the output record
order.</entry>
</row>

<row>
<entry><emphasis>bool</emphasis></entry>

<entry>When False, specifies the output record order is not
significant. When True, specifies the default output record
order.</entry>
</row>

<row>
<entry><emphasis role="bold">STABLE</emphasis></entry>

<entry>Optional. Specifies the input record order is
significant.</entry>
</row>

<row>
<entry><emphasis role="bold">UNSTABLE</emphasis></entry>

<entry>Optional. Specifies the input record order is not
significant.</entry>
</row>

<row>
<entry><emphasis role="bold">PARALLEL</emphasis></entry>

<entry>Optional. Try to evaluate this activity in parallel.</entry>
</row>

<row>
<entry><emphasis>numthreads</emphasis></entry>

<entry>Optional. Try to evaluate this activity using
<emphasis>numthreads</emphasis> threads.</entry>
</row>

<row>
<entry><emphasis role="bold">ALGORITHM</emphasis></entry>

<entry>Optional. Override the algorithm used for this
activity.</entry>
</row>

<row>
<entry><emphasis>name</emphasis></entry>

<entry>The algorithm to use for this activity. Must be from the list
of supported algorithms for the SORT function's STABLE and UNSTABLE
options.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
Expand All @@ -160,7 +186,7 @@

<para>Example:</para>

<programlisting>RecStruct := RECORD
<programlisting lang="ECL" role="runnable">RecStruct := RECORD
INTEGER1 Number;
STRING1 Letter;
END;
Expand All @@ -178,6 +204,9 @@ Y := LIMIT(SomeFile,10,
SELF := ROW({0,''},RecStruct))));
//no exception, just no record
Z := LIMIT(SomeFile,10,SKIP);
// OUTPUT(X); //This one will throw an exception
OUTPUT(Y);
OUTPUT(Z);
</programlisting>

<para>See Also: <link linkend="FAIL">FAIL</link>, <link
Expand Down
7 changes: 5 additions & 2 deletions docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-LN.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@

<para>Example:</para>

<programlisting>MyLogPI := LN(3.14159); //1.14473</programlisting>
<programlisting lang="ECL" role="runnable">MyLogPI := LN(3.14159); //1.144729041185178
OUTPUT(MyLogPI);</programlisting>

<para>See Also: <link linkend="EXP">EXP</link>, <link linkend="SQRT">SQRT</link>, <link linkend="POWER">POWER</link>, <link linkend="LOG">LOG</link></para>
<para>See Also: <link linkend="EXP">EXP</link>, <link
linkend="SQRT">SQRT</link>, <link linkend="POWER">POWER</link>, <link
linkend="LOG">LOG</link></para>
</sect1>
6 changes: 4 additions & 2 deletions docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-LOCAL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@

<para>Example:</para>

<programlisting>ds := JOIN(SomeData,LOCAL(SomeIndex), LEFT.ID = RIGHT.ID);</programlisting>
<programlisting lang="ECL" role="notrunnable">ds := JOIN(SomeData,LOCAL(SomeIndex), LEFT.ID = RIGHT.ID);</programlisting>

<para>See Also: <link linkend="ALLNODES">ALLNODES</link>, <link linkend="THISNODE">THISNODE</link>, <link linkend="NOLOCAL">NOLOCAL</link></para>
<para>See Also: <link linkend="ALLNODES">ALLNODES</link>, <link
linkend="THISNODE">THISNODE</link>, <link
linkend="NOLOCAL">NOLOCAL</link></para>
</sect1>
7 changes: 5 additions & 2 deletions docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-LOG.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@

<para>Example:</para>

<programlisting>MyLogPI := LOG(3.14159); //0.49715</programlisting>
<programlisting lang="ECL" role="runnable">MyLogPI := LOG(3.14159); // 0.4971495058611233
OUTPUT(MyLogPI);</programlisting>

<para>See Also: <link linkend="EXP">EXP</link>, <link linkend="SQRT">SQRT</link>, <link linkend="POWER">POWER</link>, <link linkend="LN">LN</link></para>
<para>See Also: <link linkend="EXP">EXP</link>, <link
linkend="SQRT">SQRT</link>, <link linkend="POWER">POWER</link>, <link
linkend="LN">LN</link></para>
</sect1>
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@

<para>Example:</para>

<para><programlisting>namesRec := RECORD
<para><programlisting lang="ECL" role="runnable">namesRec := RECORD
STRING20 lname;
STRING10 fname;
UNSIGNED2 age := 25;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<para>Example:</para>

<programlisting>LOADXML('&lt;section&gt;&lt;item type="count"&gt;&lt;set&gt;person&lt;/set&gt;&lt;/item&gt;&lt;/section&gt;')
<programlisting lang="ECL" role="notrunnable">LOADXML('&lt;section&gt;&lt;item type="count"&gt;&lt;set&gt;person&lt;/set&gt;&lt;/item&gt;&lt;/section&gt;');
//this macro receives in-line XML as its parameter
//and demonstrates the code for multiple row drilldown
EXPORT id(xmlRow) := MACRO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

<para>Example:</para>

<programlisting>Attr01 := MAP(EXISTS(Person(Person.EyeColor = 'Blue')) =&gt; 1,
<programlisting lang="ECL" role="notrunnable">Attr01 := MAP(EXISTS(Person(Person.EyeColor = 'Blue')) =&gt; 1,
EXISTS(Person(Person.Haircolor = 'Brown')) =&gt; 2,
3);
//If there are any blue-eyed people, Attr01 gets 1
Expand Down
Loading

0 comments on commit 5a34bb0

Please sign in to comment.