[SOL-42] Parallel script execution inside a Lua script Created: 27.01.2014  Updated: 29.07.2020  Resolved: 29.07.2020

Status: Obsolete
Project: Solution Center
Component/s: EXASolution
Affects Version/s: EXASolution 4.2.5, EXASolution 5.0, EXASOL 6.0.0, Exasol 6.1.0, Exasol 6.2.x
Fix Version/s: None

Type: How To
Reporter: Captain EXASOL Assignee: Captain EXASOL
Labels: None

Issue Links:
Causing
Related
Solution:

Note: This solution is no longer maintained. For the latest information, please refer to our documentation:

https://community.exasol.com/t5/database-features/parallel-script-execution-inside-a-lua-script/ta-p/1480

Background

The only working solution is using the IMPORT command over JDBC to connect to your EXASolution database and wrap the LUA-scripts you want to execute in parallel in the STATEMENT-Clause.

Prerequisites

You are using an enterprise version of Exasol, not the single node community edition. 

How to run Import in parallel using JDBC and LUA

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;

Category 1: Scripting

 Comments   
Comment by Stefan Reich [ 11.02.2014 ]

Please note that due to internal processing, no guarantees about the received row ordering can be given.

Generated at Tue Dec 07 20:15:11 CET 2021 using Jira 7.13.18#713018-sha1:e1230154f8ff8cc9272975bf568fc732e806fd68.