Skip to content

Commit

Permalink
HPCC-7975 Add std.system.thorlib.platform
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
  • Loading branch information
ghalliday committed Oct 23, 2012
1 parent 0d3639c commit 73875f8
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ecllibrary/std/system/Thorlib.ecl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ varstring daliServer() : once, ctxmethod, entrypoint='getDaliServers';
varstring cluster() : once, ctxmethod, entrypoint='getClusterName'; varstring cluster() : once, ctxmethod, entrypoint='getClusterName';
varstring getExpandLogicalName(const varstring name) : pure, ctxmethod, entrypoint='getExpandLogicalName'; varstring getExpandLogicalName(const varstring name) : pure, ctxmethod, entrypoint='getExpandLogicalName';
varstring group() : once, ctxmethod, entrypoint='getGroupName'; varstring group() : once, ctxmethod, entrypoint='getGroupName';
varstring platform() : pure ,ctxmethod, entrypoint='getPlatform';
END; END;


RETURN MODULE RETURN MODULE
Expand Down Expand Up @@ -67,6 +68,12 @@ export getExpandLogicalName(const varstring name) := externals.getExpandLogicalN


export cluster() := externals.cluster(); 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. * The following are either unused, or should be replaced with a different syntax.
Expand Down
10 changes: 10 additions & 0 deletions testing/ecl/hthor/key/platform.xml
Original file line number Original file line Diff line number Diff line change
@@ -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>
10 changes: 10 additions & 0 deletions testing/ecl/key/platform.xml
Original file line number Original file line Diff line number Diff line change
@@ -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>
27 changes: 27 additions & 0 deletions testing/ecl/platform.ecl
Original file line number Original file line Diff line number Diff line change
@@ -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);

10 changes: 10 additions & 0 deletions testing/ecl/roxie/key/platform.xml
Original file line number Original file line Diff line number Diff line change
@@ -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>

0 comments on commit 73875f8

Please sign in to comment.