Wed Oct 28, 2020 7:41 pm
Login Register Lost Password? Contact Us


Executing Roxie query

Questions and comments regarding the Online Lessons should be posted here.

Mon Sep 30, 2013 11:28 am Change Time Zone

In 'Intro to Roxie' online training, we published a function to Roxie and executed it from ws-ECL.

In this scenario, the function didn't accept any parameters - all were defined in the form of local variables within the function and exposed through STORED services.

My question is this:
How do I execute this function from within ECL IDE? During the course of development, I may want to test it at every build stage to ensure correctness and publish to Roxie only when all is well and complete.

Thanks,
Gayathri
Gayathri_Jayaraman
 
Posts: 75
Joined: Wed May 08, 2013 5:03 am

Mon Sep 30, 2013 2:02 pm Change Time Zone

Hi Gayathri,

In the OSS HPCC, you can now publish your query to hTHOR and THOR, and test it in WS_ECL just like you would for ROXIE. Or if you just want to test the query directly in the ECL IDE, add default values to the search parameters like this:

Code: Select all
STRING15 fname_value := '' : STORED('FirstName');
STRING25 lname_value := 'SMITH' : STORED('LastName');
STRING2 state_value  := '' : STORED('State');
STRING1 sex_value    := '' : STORED('Sex');


...and then call the function from a builder window or BWR file in your repository folder. For example, I created a file named BWR_TestService, and then in the file simply do this:

Code: Select all
IMPORT $;

$.PeopleFileSearchService();



Works great! Just remember after testing to reset the STORED definitions back to blanks when you are ready to publish.

In the Advanced ROXIE we also introduce INTERFACES, which help to make these defaults even easier to use and seed.

Regards,

Bob
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm

Tue Oct 01, 2013 4:55 am Change Time Zone

Thanks Bob! That clarifies it.

If underlying ECL code changes, does it have to be re-published to Roxie or is it sufficient to just recompile it?
Gayathri_Jayaraman
 
Posts: 75
Joined: Wed May 08, 2013 5:03 am

Tue Oct 01, 2013 11:44 am Change Time Zone

If the underlying ECL code changes, yes, the query would have to be republished. If the data behind the query was the only thing that changed, you could use packages to update the data without the need to republish (packages are covered in the Advanced ROXIE online course).

The strategy and best practice for deployment and production is to configure multiple ROXIEs. Use one for development and updating the queries and then periodically they can switch over to use the new cluster.

Regards,

Bob
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm


Return to Online Classroom

Who is online

Users browsing this forum: No registered users and 1 guest

cron