29-07-2020 07:54 PM - edited 31-07-2020 07:42 PM
The only working solution is using the IMPORT command over JDBC to connect to your Exasol database and wrap the LUA-scripts you want to execute in parallel in the STATEMENT-Clause.
You are using an enterprise version of Exasol, not the single node community edition.
The following small example shows this approach:
create or replace lua script cat_return returns table as --Lua script that returns resultset of select * from cat --used to test parallel call suc, res = pquery([[select * from cat]],{}) tab = {} for i=1, #res do tmp2 = {} for j=1, #res[i] do table.insert(tmp2, res[i][j]) end table.insert(tab, tmp2) end return tab, 'TABLE_NAME VARCHAR(200), TABLE_TYPE VARCHAR(200)' / create or replace lua script partest returns rowcount as --Parallel execution of other lua scripts --performed using import statement suc, res = pquery([[ IMPORT INTO (TABLE_NAME VARCHAR(200), TABLE_TYPE VARCHAR(200)) FROM JDBC AT 'jdbc:exa:192.148.120.16..20:8563;schema=MYUSER' USER 'myuser' IDENTIFIED BY 'xxxxxxxxx' STATEMENT 'execute script myuser.cat_return' STATEMENT 'execute script myuser.cat_return' STATEMENT 'execute script myuser.cat_return'; ]],{}) return {rows_affected = #res} / execute script partest;
Then it's time to become part of a unique family! Discover helpful tips and support other Community members with your knowledge.
Sign In