浏览代码

Merge branch 'candidate-7.0.x' into candidate-7.2.0

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 年之前
父节点
当前提交
bb9e5fcb10

+ 4 - 1
ecl/eclcc/eclcc.cpp

@@ -1589,7 +1589,10 @@ void EclCC::processXmlFile(EclCompileInstance & instance, const char *archiveXML
     //Items first in the list have priority -Dxxx=y overrides all
     processDefinitions(repositories);
     repositories.append(*LINK(pluginsRepository));
-    if (archiveTree->getPropBool("@useLocalSystemLibraries", false)) // Primarily for testing.
+
+    //Default to using the local system libraries so that updates are kept in sync with the plugins
+    bool useLocalSystemLibraries = archiveTree->getPropBool("@useLocalSystemLibraries", true);
+    if (useLocalSystemLibraries)
         repositories.append(*LINK(libraryRepository));
 
     Owned<IFileContents> contents;

+ 4 - 1
ecl/hqlcpp/hqliproj.cpp

@@ -916,7 +916,10 @@ bool isSensibleRecord(IHqlExpression * record)
                     IHqlExpression * limit = cur->queryAttribute(countAtom);
                     if (!limit)
                         limit = cur->queryAttribute(sizeAtom);
-                    if (limit && !limit->isConstant())
+                    //Previously constant counts were allowed, but that currently causes issues with the field translation code.
+                    //reinstate the following code once that is addressed
+                    //if (limit && !limit->isConstant())
+                    if (limit)
                         return false;
                     break;
                 }

+ 54 - 0
ecl/regress/ecllib.eclxml

@@ -0,0 +1,54 @@
+<Archive build="internal_7.2.1-closedown0"
+         eclVersion="7.2.1"
+         legacyImport="0"
+         legacyWhen="0">
+ <Query attributePath="_local_directory_.temp"/>
+ <Module key="_local_directory_" name="_local_directory_">
+  <Attribute key="temp"
+             name="temp"
+             sourcePath="/home/gavin/dev/hpcc/ecl/regress/temp.ecl"
+             ts="1553856593000000">
+   &#32;import Std.Str;
+
+output(Str.toUpperCase(&apos;zz&apos;));&#10;
+  </Attribute>
+ </Module>
+ <Module key="std" name="std">
+  <Attribute key="str"
+             name="Str"
+             sourcePath="/home/gavin/dev/hpcc/ecllibrary/std/Str.ecl"
+             ts="1545228834000000">
+EXPORT Str := MODULE
+
+
+/*
+  Since this is primarily a wrapper for a plugin, all the definitions for this standard library
+  module are included in a single file.  Generally I would expect them in individual files.
+  */
+
+IMPORT lib_stringlib;
+
+/**
+ * Return the argument string with all lower case characters converted to upper case.
+ *
+ * @param src           The string that is being converted.
+ */
+
+EXPORT STRING ToUpperCase(STRING src, unsigned newFromParam = 0, unsigned newToParam = -1) := lib_stringlib.StringLib.StringToUpperCase(src, newFromParam, unsigned newToParam);
+
+END;&#10;
+  </Attribute>
+ </Module>
+ <Module flags="5"
+         fullname="/home/gavin/buildr/RelWithDebInfo/libs/libstringlib.so"
+         key="lib_stringlib"
+         name="lib_stringlib"
+         plugin="libstringlib.so"
+         sourcePath="lib_stringlib"
+         ts="1553256631000000"
+         version="STRINGLIB 1.1.14">
+  <Text>export StringLib := SERVICE:fold
+  string StringToUpperCase(const string src) : c,pure,entrypoint=&apos;slStringToUpperCase&apos;;
+END;</Text>
+ </Module>
+</Archive>

+ 49 - 0
testing/regress/ecl/dsarray.ecl

@@ -0,0 +1,49 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2019 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.
+############################################################################## */
+
+
+pointRec := { real8 x, real8 y };
+
+shapeRecord :=
+            RECORD
+unsigned        id;
+pointRec        corners[4];
+unsigned        extra := 10;
+            END;
+
+
+mkSquare(real8 x, real8 y, real8 w) := dataset([{x,y},{x+w,y},{x+w,y+w},{x,y+w}], pointRec);
+mkRectangle(real8 x, real8 y, real8 w, real8 h) := dataset([{x,y},{x+w,y},{x+w,y+h},{x,y+h}], pointRec);
+
+shapesDs := DATASET([
+                {1, mkSquare(-1,-1,2)},
+                {2, mkSquare(0,4,2)},
+                {3, mkSquare(1,3,12)},
+                {4, mkRectangle(0,0,1000,0.001)},
+                {5, mkRectangle(1,2,3,4)},
+                {0, mkSquare(0,0,0)}
+                ], shapeRecord)(id != 0);
+
+spilledDs := global(nofold(shapesDs));
+
+projDs := PROJECT(spilledDs, shapeRecord - [extra]);
+
+sequential(
+    output(shapesDs,          { name := 'Area of ' + (string)id + ' = ', area := (corners[3].x-corners[1].x) * (corners[3].y-corners[1].y) });
+    output(nofold(spilledDs), { name := 'Area of ' + (string)id + ' = ', area := (corners[3].x-corners[1].x) * (corners[3].y-corners[1].y) });
+    output(nofold(projDs),    { name := 'Area of ' + (string)id + ' = ', area := (corners[3].x-corners[1].x) * (corners[3].y-corners[1].y) });
+);

+ 50 - 0
testing/regress/ecl/dsarray2.ecl

@@ -0,0 +1,50 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2019 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.
+############################################################################## */
+
+
+pointRec := { real8 x, real8 y };
+
+shapeRecord :=
+            RECORD
+unsigned        id;
+unsigned        numCorners;
+dataset(pointRec, count(SELF.numCorners)) corners;
+unsigned        extra := 10;
+            END;
+
+
+mkSquare(real8 x, real8 y, real8 w) := dataset([{x,y},{x+w,y},{x+w,y+w},{x,y+w}], pointRec);
+mkRectangle(real8 x, real8 y, real8 w, real8 h) := dataset([{x,y},{x+w,y},{x+w,y+h},{x,y+h}], pointRec);
+
+shapesDs := DATASET([
+                {1, 4, mkSquare(-1,-1,2)},
+                {2, 4, mkSquare(0,4,2)},
+                {3, 4, mkSquare(1,3,12)},
+                {4, 4, mkRectangle(0,0,1000,0.001)},
+                {5, 4, mkRectangle(1,2,3,4)},
+                {0, 4, mkSquare(0,0,0)}
+                ], shapeRecord)(id != 0);
+
+spilledDs := global(nofold(shapesDs));
+
+projDs := PROJECT(spilledDs, shapeRecord - [extra]);
+
+sequential(
+    output(shapesDs,          { name := 'Area of ' + (string)id + ' = ', area := (corners[3].x-corners[1].x) * (corners[3].y-corners[1].y) });
+    output(nofold(spilledDs), { name := 'Area of ' + (string)id + ' = ', area := (corners[3].x-corners[1].x) * (corners[3].y-corners[1].y) });
+    output(nofold(projDs),    { name := 'Area of ' + (string)id + ' = ', area := (corners[3].x-corners[1].x) * (corners[3].y-corners[1].y) });
+);

+ 21 - 0
testing/regress/ecl/key/dsarray.xml

@@ -0,0 +1,21 @@
+<Dataset name='Result 1'>
+ <Row><name>Area of 1 = </name><area>4.0</area></Row>
+ <Row><name>Area of 2 = </name><area>4.0</area></Row>
+ <Row><name>Area of 3 = </name><area>144.0</area></Row>
+ <Row><name>Area of 4 = </name><area>1.0</area></Row>
+ <Row><name>Area of 5 = </name><area>12.0</area></Row>
+</Dataset>
+<Dataset name='Result 2'>
+ <Row><name>Area of 1 = </name><area>4.0</area></Row>
+ <Row><name>Area of 2 = </name><area>4.0</area></Row>
+ <Row><name>Area of 3 = </name><area>144.0</area></Row>
+ <Row><name>Area of 4 = </name><area>1.0</area></Row>
+ <Row><name>Area of 5 = </name><area>12.0</area></Row>
+</Dataset>
+<Dataset name='Result 3'>
+ <Row><name>Area of 1 = </name><area>4.0</area></Row>
+ <Row><name>Area of 2 = </name><area>4.0</area></Row>
+ <Row><name>Area of 3 = </name><area>144.0</area></Row>
+ <Row><name>Area of 4 = </name><area>1.0</area></Row>
+ <Row><name>Area of 5 = </name><area>12.0</area></Row>
+</Dataset>

+ 21 - 0
testing/regress/ecl/key/dsarray2.xml

@@ -0,0 +1,21 @@
+<Dataset name='Result 1'>
+ <Row><name>Area of 1 = </name><area>4.0</area></Row>
+ <Row><name>Area of 2 = </name><area>4.0</area></Row>
+ <Row><name>Area of 3 = </name><area>144.0</area></Row>
+ <Row><name>Area of 4 = </name><area>1.0</area></Row>
+ <Row><name>Area of 5 = </name><area>12.0</area></Row>
+</Dataset>
+<Dataset name='Result 2'>
+ <Row><name>Area of 1 = </name><area>4.0</area></Row>
+ <Row><name>Area of 2 = </name><area>4.0</area></Row>
+ <Row><name>Area of 3 = </name><area>144.0</area></Row>
+ <Row><name>Area of 4 = </name><area>1.0</area></Row>
+ <Row><name>Area of 5 = </name><area>12.0</area></Row>
+</Dataset>
+<Dataset name='Result 3'>
+ <Row><name>Area of 1 = </name><area>4.0</area></Row>
+ <Row><name>Area of 2 = </name><area>4.0</area></Row>
+ <Row><name>Area of 3 = </name><area>144.0</area></Row>
+ <Row><name>Area of 4 = </name><area>1.0</area></Row>
+ <Row><name>Area of 5 = </name><area>12.0</area></Row>
+</Dataset>