Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

HPCC-7975 Add std.system.thorlib.platform

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
  • Loading branch information...
commit 73875f8569713f24618a689474991d24ae219202 1 parent 0d3639c
@ghalliday ghalliday authored
View
7 ecllibrary/std/system/Thorlib.ecl
@@ -18,6 +18,7 @@ varstring daliServer() : once, ctxmethod, entrypoint='getDaliServers';
varstring cluster() : once, ctxmethod, entrypoint='getClusterName';
varstring getExpandLogicalName(const varstring name) : pure, ctxmethod, entrypoint='getExpandLogicalName';
varstring group() : once, ctxmethod, entrypoint='getGroupName';
+varstring platform() : pure ,ctxmethod, entrypoint='getPlatform';
END;
RETURN MODULE
@@ -68,6 +69,12 @@ export getExpandLogicalName(const varstring name) := externals.getExpandLogicalN
export cluster() := externals.cluster();
/*
+ * Returns the platform the query is currently executing on.
+ */
+
+export platform() := externals.platform();
+
+/*
* The following are either unused, or should be replaced with a different syntax.
export getenv(const varstring name, const varstring defaultValue) := externals.getenv(name, defaultValue);
View
10 testing/ecl/hthor/key/platform.xml
@@ -0,0 +1,10 @@
+<Dataset name='Result 1'>
+ <Row><Result_1>hthor</Result_1></Row>
+</Dataset>
+<Dataset name='Result 2'>
+ <Row><x>hthor1</x></Row>
+ <Row><x>hthor2</x></Row>
+ <Row><x>hthor3</x></Row>
+ <Row><x>hthor4</x></Row>
+ <Row><x>hthor5</x></Row>
+</Dataset>
View
10 testing/ecl/key/platform.xml
@@ -0,0 +1,10 @@
+<Dataset name='Result 1'>
+ <Row><Result_1>thor</Result_1></Row>
+</Dataset>
+<Dataset name='Result 2'>
+ <Row><x>thor1</x></Row>
+ <Row><x>thor2</x></Row>
+ <Row><x>thor3</x></Row>
+ <Row><x>thor4</x></Row>
+ <Row><x>thor5</x></Row>
+</Dataset>
View
27 testing/ecl/platform.ecl
@@ -0,0 +1,27 @@
+/*##############################################################################
+
+ 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.
+############################################################################## */
+
+import std.system.thorlib;
+
+output(thorlib.platform());
+
+pl := thorlib.platform() : independent;
+
+ds := NOFOLD(dataset([1,2,3,4,5],{ unsigned id; }));
+p := table(ds, { string x := thorlib.platform() + (string)id });
+output(p);
+
View
10 testing/ecl/roxie/key/platform.xml
@@ -0,0 +1,10 @@
+<Dataset name='Result 1'>
+ <Row><Result_1>roxie</Result_1></Row>
+</Dataset>
+<Dataset name='Result 2'>
+ <Row><x>roxie1</x></Row>
+ <Row><x>roxie2</x></Row>
+ <Row><x>roxie3</x></Row>
+ <Row><x>roxie4</x></Row>
+ <Row><x>roxie5</x></Row>
+</Dataset>
Please sign in to comment.
Something went wrong with that request. Please try again.