From 7791cd8800df622549d07d269a1e8c1f58f8f3bc Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Thu, 5 Jan 2023 15:11:57 -0500 Subject: [PATCH 1/8] HPCC-28428 Fix typo in PG code Signed-off-by: Jim DeFabia --- .../ECLProgrammersGuide/PRG_Mods/PrG_Using_Group_Function.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/EN_US/ECLProgrammersGuide/PRG_Mods/PrG_Using_Group_Function.xml b/docs/EN_US/ECLProgrammersGuide/PRG_Mods/PrG_Using_Group_Function.xml index cb2b39930a1..db1128433d0 100644 --- a/docs/EN_US/ECLProgrammersGuide/PRG_Mods/PrG_Using_Group_Function.xml +++ b/docs/EN_US/ECLProgrammersGuide/PRG_Mods/PrG_Using_Group_Function.xml @@ -110,7 +110,7 @@ OUTPUT(i2); TRANSFORM(RECORDOF(ProgGuide.Accounts), SELF := LEFT)); ds0 := DISTRIBUTE(bf,RANDOM()) : PERSIST('~PROGGUIDE::PERSIST::TestGroupSort'); -ds1 := DISTRIBUTE(ds,HASH32(personid)); +ds1 := DISTRIBUTE(ds0,HASH32(personid)); // do a global sort s1 := SORT(ds0,personid,opendate,-balance); From f916a77fdeebc2e784d4ee5cf46fc4478d011002 Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Wed, 18 Jan 2023 12:41:11 -0500 Subject: [PATCH 2/8] HPCC-25205 Clarify Std.File.Copy forcePush parameter Signed-off-by: Jim DeFabia --- docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Copy.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Copy.xml b/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Copy.xml index 7b3f3ecded5..4ed996c323f 100644 --- a/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Copy.xml +++ b/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Copy.xml @@ -164,8 +164,9 @@ Optional. A boolean TRUE or FALSE flag indicating whether to execute the copy process on the source nodes and push to the targets - instead of executing on the targets and pulling from the source. If - omitted, the default is FALSE. + instead of executing on the targets and pulling from the source. + This option is only valid within the same environment. If omitted, + the default is FALSE. From fee7b84d1d9df874e8867bdb34550a6b879126a3 Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Fri, 20 Jan 2023 12:05:29 -0500 Subject: [PATCH 3/8] HPCC-24982 Clarify how to conditionally compile using __TARGET_PLATFORM__ Signed-off-by: Jim DeFabia --- .../ECLR_mods/Basics-Constants.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/Basics-Constants.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/Basics-Constants.xml index a04ce43d03e..3bdea78508b 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/Basics-Constants.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/Basics-Constants.xml @@ -256,7 +256,18 @@ MyDec2 := 3.14159265358979323846d // value of MyDec2 is the DECIMAL Example: - IMPORT STD; + // Any modules referenced inside the condition must be declared outside of the condition +// This will avoid syntax errors +prod_thor_dali := _Control.IPAddress.prod_thor_dali; + #IF(_TARGET_PLATFORM_ in ['thorlcr']) + Output('thor'); + prod_thor_dali; + #ELSE + Output('not thor'); + #END + +//Second example +IMPORT STD; STRING14 fGetDateTimeString() := #IF(__ECL_VERSION_MAJOR__ > 5) or ((__ECL_VERSION_MAJOR__ = 5) AND (__ECL_VERSION_MINOR__ >= 2)) STD.Date.SecondsToString(STD.Date.CurrentSeconds(true), '%Y%m%d%H%M%S'); From 625587234a516b3236fca91be7c3bc320046e54f Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Fri, 20 Jan 2023 12:10:31 -0500 Subject: [PATCH 4/8] HPCC-20804 Clarify the use of Boolean logic in a RECORD structure Signed-off-by: Jim DeFabia --- docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml index a530aaa64a9..839fa7e929c 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml @@ -132,7 +132,8 @@ records. If the condition expression references fields in the RECORD preceding the IFBLOCK, those references must use SELF. prepended to the fieldname to - disambiguate the reference. + disambiguate the reference. This is only for use in RECORD + structures that define files on disk. From 61e34918e4defce23f01a1a7aa0f1c561ff52208 Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Fri, 20 Jan 2023 12:17:58 -0500 Subject: [PATCH 5/8] HPCC-23892 Clarify how trailing spaces are considered when comparing Signed-off-by: Jim DeFabia --- .../ECLR_mods/ExpressionsandOperatos.xml | 8 +++++--- docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Find.xml | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/ExpressionsandOperatos.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/ExpressionsandOperatos.xml index ccbf1398889..c53726577c9 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/ExpressionsandOperatos.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/ExpressionsandOperatos.xml @@ -20,7 +20,7 @@ Standard arithmetic operators arithmetic operators are supported for use in expressions, listed here in their - evaluation precedence. + evaluation precedence. @@ -324,7 +324,9 @@ The Greater Than or Equal operator must have the Greater Than (>) sign first. For the expression a <=> b, the Equivalence Comparison operator - returns -1 if a<b, 0 if a=b, and 1 if a>b. When STRINGs are compared - for equivalence, trailing spaces are ignored. + returns -1 if a<b, 0 if a=b, and 1 if a>b. When STRINGs are + compared, trailing spaces are generally ignored. Standard library + functions, such as Std.Str.Find(), may consider trailing spaces. See the + Standard Library Reference for specific details. diff --git a/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Find.xml b/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Find.xml index 43e839380d5..4ea0d129fd5 100644 --- a/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Find.xml +++ b/docs/EN_US/ECLStandardLibraryReference/SLR-Mods/Find.xml @@ -79,7 +79,8 @@ specified instance is greater than the number of occurrences of the target in the source, Find returns - zero (0). + zero (0). Trailing spaces are considered to be significant when + comparing. Example: From e4aae8ce1b841bd2d9fdc8b1f55c682d613893f0 Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Fri, 20 Jan 2023 11:20:32 -0500 Subject: [PATCH 6/8] HPCC-16628 Improve the example code of AGGREGATE in the ECL Lang Ref Signed-off-by: Jim DeFabia --- .../ECLR_mods/BltInFunc-AGGREGATE.xml | 100 ++++++++++++------ 1 file changed, 67 insertions(+), 33 deletions(-) diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-AGGREGATE.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-AGGREGATE.xml index c643242e673..71f95741919 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-AGGREGATE.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/BltInFunc-AGGREGATE.xml @@ -15,14 +15,18 @@ RIGHT1 ,RIGHT2 RIGHT2 - ) ] [, groupingfields - ] [, LOCAL + ) | groupingfields ] [, LOCAL LOCAL | FEW FEW | MANY MANY - ] [, UNORDERED | ORDERED( bool ) ] [, STABLE | UNSTABLE ] [, PARALLEL [ ( numthreads ) ] ] [, ALGORITHM( name ) ] ) + ] [, UNORDERED | ORDERED( bool + ) ] [, STABLE | UNSTABLE ] [, PARALLEL [ + ( numthreads ) ] ] [, + ALGORITHM( name ) ] + ) @@ -93,50 +97,70 @@ Optional. Indicates that the expression will result in more than 10,000 records. + UNORDERED - Optional. Specifies the output record order is not significant. + Optional. Specifies the output record order is not + significant. + ORDERED - Specifies the significance of the output record order. + Specifies the significance of the output record + order. + bool - When False, specifies the output record order is not significant. When True, specifies the default output record order. + When False, specifies the output record order is not + significant. When True, specifies the default output record + order. + STABLE - Optional. Specifies the input record order is significant. + Optional. Specifies the input record order is + significant. + UNSTABLE - Optional. Specifies the input record order is not significant. + Optional. Specifies the input record order is not + significant. + PARALLEL - Optional. Try to evaluate this activity in parallel. + Optional. Try to evaluate this activity in + parallel. + numthreads - Optional. Try to evaluate this activity using numthreads threads. + Optional. Try to evaluate this activity using + numthreads threads. + ALGORITHM - Optional. Override the algorithm used for this activity. + Optional. Override the algorithm used for this + activity. + name - The algorithm to use for this activity. Must be from the list of supported algorithms for the SORT function's STABLE and UNSTABLE options. + The algorithm to use for this activity. Must be from the + list of supported algorithms for the SORT function's STABLE and + UNSTABLE options. @@ -159,7 +183,7 @@ The operation is implicitly local, in that the maintransform is called to process records locally on each node, and the result records on each node are then merged to produce - the global result. + the global result. TRANSFORM Function Requirements - AGGREGATE @@ -216,38 +240,48 @@ maintransform. If it can't, then the user will need to specify one. - inRecord := RECORD + //Example 1: Produce a list of box contents by concatenating a string: +IMPORT Std; +inRec := RECORD UNSIGNED box; - STRING text{MAXLENGTH(10)}; + STRING text{MAXLENGTH(100)}; END; -inTable := DATASET([{1,'Fred'},{1,'Freddy'}, - {2,'Freddi'},{3,'Fredrik'},{1,'FredJon'}], inRecord); - -//Example 1: Produce a list of box contents by concatenating a string: - -outRecord1 := RECORD +inds := DATASET([{1,'Fred1'},{1,'Freddy1'},{1,'FredJon1'}, + {3,'Fred3'},{3,'Freddy3'},{3,'FredJon3'}, + {4,'Fred4'},{4,'Freddy4'},{4,'FredJon4'}, + {2,'Freddi'},{2,'Fredrik'}], inRec,DISTRIBUTED); +outRec := RECORD UNSIGNED box; STRING contents{MAXLENGTH(200)}; END; -outRecord1 t1(inRecord l, outRecord1 r) := TRANSFORM +outRec t1(inds l, outRec r) := TRANSFORM SELF.box := l.box; - SELF.contents := r.contents + IF(r.contents <> '', ',', '') + l.text; + SELF.contents:= r.contents +IF(r.contents <> '', ',', '') +l.text +'-' +(Std.System.ThorLib.Node()+1); END; -outRecord1 t2(outRecord1 r1, outRecord1 r2) := TRANSFORM +outRec t2(outRec r1, outRec r2) := TRANSFORM SELF.box := r1.box; - SELF.contents := r1.contents + ',' + r2.contents; + SELF.contents := r1.contents + '::' + r2.contents; END; -OUTPUT(AGGREGATE(inTable, outRecord1, t1(LEFT, RIGHT), t2(RIGHT1, RIGHT2), LEFT.box)); - -//This example could eliminate the merge transform if the SELF.contents expression in -//the t1 TRANSFORM were simpler, like this: -// SELF.contents := r.contents + ',' + l.text; -//which would make the AGGREGATE function like this: -// OUTPUT(AGGREGATE(inTable, outRecord1, t1(LEFT, RIGHT), LEFT.box)); - +OUTPUT(AGGREGATE(inds, outRec, t1(LEFT, RIGHT), t2(RIGHT1, RIGHT2), LEFT.box)); +//because there is a "group by" field, this will never call the second TRANSFORM +//because "group by" puts all grouped recs on a single node +//and it produces one result rec for each unique "group by" value + +OUTPUT(AGGREGATE(inds, outRec, t1(LEFT, RIGHT), t2(RIGHT1, RIGHT2))); +//without the "group by" field, this calls the second TRANSFORM on a multi-node cluster +//and the second TRANSFORM produces a single result record after merging the results from +//each node + //Example 2: A PIGMIX style grouping operation: +inRecord := RECORD + UNSIGNED box; + STRING text{MAXLENGTH(10)}; +END; +inTable := DATASET([{1,'Fred'},{1,'Freddy'}, + {2,'Freddi'},{3,'Fredrik'},{1,'FredJon'}], inRecord); + outRecord2 := RECORD UNSIGNED box; DATASET(inRecord) items; From 5180668bb1d33a3fbf4784fdf307143c3659e013 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Tue, 24 Jan 2023 13:31:48 +0000 Subject: [PATCH 7/8] HPCC-28833 Fix Ubuntu 22.10 build warning reported as error Signed-off-by: Gavin Halliday --- esp/services/ws_esdlconfig/ws_esdlconfigservice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp/services/ws_esdlconfig/ws_esdlconfigservice.cpp b/esp/services/ws_esdlconfig/ws_esdlconfigservice.cpp index 4202f84c3bc..a71843d2b99 100644 --- a/esp/services/ws_esdlconfig/ws_esdlconfigservice.cpp +++ b/esp/services/ws_esdlconfig/ws_esdlconfigservice.cpp @@ -291,7 +291,7 @@ bool CWsESDLConfigEx::onPublishESDLDefinition(IEspContext &context, IEspPublishE userdesc->set(user, password, context.querySignature()); } - DBGLOG("CWsESDLConfigEx::onPublishESDLDefinition User=%s",user); + DBGLOG("CWsESDLConfigEx::onPublishESDLDefinition User=%s",user ? user : "(null)"); resp.updateStatus().setCode(0); From d1fcf25ff7b3262df4ac900fc5ffbb297fec7547 Mon Sep 17 00:00:00 2001 From: Russ Whitehead Date: Mon, 23 Jan 2023 10:22:51 -0500 Subject: [PATCH 8/8] HPCC-28825 App core if no root_access map in configuration Check for root_access specification before dereferencing IPropertyTree pointer Signed-off-by: Russ Whitehead --- esp/platform/application_config.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/esp/platform/application_config.cpp b/esp/platform/application_config.cpp index 9e04b3de553..fa4228651a8 100644 --- a/esp/platform/application_config.cpp +++ b/esp/platform/application_config.cpp @@ -210,11 +210,14 @@ void bindAuthResources(IPropertyTree *legacyAuthenticate, IPropertyTree *app, co if (!appAuth) throw MakeStringException(-1, "Can't find application Auth settings. To run without security set 'auth: none'"); IPropertyTree *root_access = appAuth->queryPropTree("root_access"); - StringAttr required(root_access->queryProp("@required")); - StringAttr description(root_access->queryProp("@description")); - StringAttr resource(root_access->queryProp("@resource")); - VStringBuffer locationXml("", resource.str(), required.str(), description.str()); - legacyAuthenticate->addPropTree("Location", createPTreeFromXMLString(locationXml)); + if (root_access)//root_access (feature map, auth map) not required for simple security managers + { + StringAttr required(root_access->queryProp("@required")); + StringAttr description(root_access->queryProp("@description")); + StringAttr resource(root_access->queryProp("@resource")); + VStringBuffer locationXml("", resource.str(), required.str(), description.str()); + legacyAuthenticate->addPropTree("Location", createPTreeFromXMLString(locationXml)); + } VStringBuffer featuresPath("resource_map/%s/Feature", service); Owned features = appAuth->getElements(featuresPath);