[MonetDB-users] SQL-MAL correlation
Hallo MonetDB-Team, I have been trying to understand MonetDB-MAL better. I have prepared a table called TEST1. sql>SELECT * FROM TEST1; +-----+ | een | +=====+ +-----+ 0 tuples (1.452ms) In order to see the internal process I use the command EXPLAIN. sql>EXPLAIN SELECT * FROM TEST1; +---------------------------------------------------------------------------------------------------+ | mal | +===================================================================================================+ | function user.s3_2{autoCommit=true}():void; | | barrier _32 := language.dataflow(); | | _2 := sql.mvc(); | | _12:bat[:oid,:str] := sql.bind(_2,"sys","test1","een",0); | | _10:bat[:oid,:str] := sql.bind(_2,"sys","test1","een",2); | | _14 := algebra.kdifference(_12,_10); | | _15 := algebra.kunion(_14,_10); | | _9:bat[:oid,:str] := sql.bind(_2,"sys","test1","een",1); | | _16 := algebra.kunion(_15,_9); | | _5:bat[:oid,:oid] := sql.bind_dbat(_2,"sys","test1",1); | | _8 := bat.reverse(_5); | | _17 := algebra.kdifference(_16,_8); | | exit _32; | | _18 := sql.resultSet(1,1,_17); | | sql.rsColumn(_18,"sys.test1","een","char",2,0,_17); | | _22 := io.stdout(); | | sql.exportResult(_22,_18); | | end s3_2; | +---------------------------------------------------------------------------------------------------+ 18 tuples (1.240ms) Then I have tried to run the command from the lower level. Basically it is almost a copy of the above result. mal>function user.abc{autoCommit=true}():void; mal>barrier _32 := language.dataflow(); mal>_2 := sql.mvc(); mal>_12:bat[:oid,:str] := sql.bind(_2,"sys","test1","een",0); mal>_10:bat[:oid,:str] := sql.bind(_2,"sys","test1","een",2); mal>_14 := algebra.kdifference(_12,_10); mal>_15 := algebra.kunion(_14,_10); mal>_9:bat[:oid,:str] := sql.bind(_2,"sys","test1","een",1); mal>_16 := algebra.kunion(_15,_9); mal>_5:bat[:oid,:oid] := sql.bind_dbat(_2,"sys","test1",1); mal>_8 := bat.reverse(_5); mal>_17 := algebra.kdifference(_16,_8); mal>exit _32; mal>_18 := sql.resultSet(1,1,_17); mal>sql.rsColumn(_18,"sys.test1","een","char",2,0,_17); mal>_22 := io.stdout(); mal>sql.exportResult(_22,_18); mal>end abc; MAPI = (monetdb) /tmp/.s.monetdb.50000 QUERY = end abc; ERROR = !TypeException:user.abc[13]:'X17' may not be used before being initialized !TypeException:user.abc[14]:'X17' may not be used before being initialized I expected to get a result like this: +-----+ | een | +=====+ +-----+ But instead, I got an error message. Is there probably anyone who could tell me what the error message means and what I need to change in the MAL-syntax? Another question: Maybe you could give a hint where I can find good references about SQL-MAL correlation. Thank you in advance! Kind regards, Liang Bing -- View this message in context: http://old.nabble.com/SQL-MAL-correlation-tp32557812p32557812.html Sent from the monetdb-users mailing list archive at Nabble.com.
On 30-09-2011 04:06:34 -0700, Liang Bing wrote:
Hallo MonetDB-Team,
I have been trying to understand MonetDB-MAL better.
Not answering your question, but instead expressing a concern by posing you with a counter question. Why do you interface with MonetDB using MAL? MAL is not intended for users, and should basically only be generated by front-ends. Best, Fabian
participants (2)
-
Fabian Groffen
-
Liang Bing