Performing a direct access to MonetDB's BAT tables via MAL

Good Morning/Evening everyone. My aim is to direcly access to the BAT column store representation of MonetDB through the standard libraries (MAPI/JDBC) - if possible. I know that each SQL query gets rewrited into a BAT algebra expression, but in my case I want to access to a single value per time (e.g. I want to access to the value stored in the i-th row and in the column labelled "j" of a given table) and maybe in this case the direct access is quicker than performing the whole SQL query. I've already tried to use the mclient with the MAL language and read the documentation, and I tried to use the client with something like this: mdb.start(); bbp.open(); bbp.prelude(); a := bbp.bind("fx", "size"); where "fx" should be the name of the table and "size" one of its attributes. But unfortunately I do not know how to search for a specific row-key and to get the correspondant value, and AFAIK i have to get the id of the column "size". Thanks in advance, Giacomo Bergami ____________________________ Giacomo Bergami, Ph.D Student University of Bologna https://www.unibo.it/sitoweb/giacomo.bergami2

Hi, in the MAL level the fastest and best access to a BAT is still subselect if you are looking for a value and fetch if you are interested in the value to a specific position (aka oid). Lefteris On Wed, Dec 16, 2015 at 4:45 PM, Giacomo Bergami <giacomo.bergami2@unibo.it> wrote:
Good Morning/Evening everyone.
My aim is to direcly access to the BAT column store representation of MonetDB through the standard libraries (MAPI/JDBC) - if possible. I know that each SQL query gets rewrited into a BAT algebra expression, but in my case I want to access to a single value per time (e.g. I want to access to the value stored in the i-th row and in the column labelled "j" of a given table) and maybe in this case the direct access is quicker than performing the whole SQL query.
I've already tried to use the mclient with the MAL language and read the documentation, and I tried to use the client with something like this:
mdb.start(); bbp.open(); bbp.prelude(); a := bbp.bind("fx", "size");
where "fx" should be the name of the table and "size" one of its attributes. But unfortunately I do not know how to search for a specific row-key and to get the correspondant value, and AFAIK i have to get the id of the column "size".
Thanks in advance, Giacomo Bergami ____________________________ Giacomo Bergami, Ph.D Student University of Bologna https://www.unibo.it/sitoweb/giacomo.bergami2 _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list

Now I'm trying to follow the example given in this wiki: https://www.monetdb.org/wiki/TPCH_Example and https://www.monetdb.org/Documentation/Manuals/SQLreference/Explain. I tried to perform in the mclient the following query, where with the first statement I try to initialize the sql module. mal>s := sql.start(); mal>_2 := sql.mvc(); but after the second command, the client hangs and does not me allow to perform the query. Is there any way to overcome this problem? Thanks again. ________________________________ Da: users-list [users-list-bounces+giacomo.bergami2=unibo.it@monetdb.org] per conto di Lefteris [lsidir@gmail.com] Inviato: mercoledì 16 dicembre 2015 17.20 A: Communication channel for MonetDB users Oggetto: Re: Performing a direct access to MonetDB's BAT tables via MAL Hi, in the MAL level the fastest and best access to a BAT is still subselect if you are looking for a value and fetch if you are interested in the value to a specific position (aka oid). Lefteris On Wed, Dec 16, 2015 at 4:45 PM, Giacomo Bergami <giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it>> wrote: Good Morning/Evening everyone. My aim is to direcly access to the BAT column store representation of MonetDB through the standard libraries (MAPI/JDBC) - if possible. I know that each SQL query gets rewrited into a BAT algebra expression, but in my case I want to access to a single value per time (e.g. I want to access to the value stored in the i-th row and in the column labelled "j" of a given table) and maybe in this case the direct access is quicker than performing the whole SQL query. I've already tried to use the mclient with the MAL language and read the documentation, and I tried to use the client with something like this: mdb.start(); bbp.open(); bbp.prelude(); a := bbp.bind("fx", "size"); where "fx" should be the name of the table and "size" one of its attributes. But unfortunately I do not know how to search for a specific row-key and to get the correspondant value, and AFAIK i have to get the id of the column "size". Thanks in advance, Giacomo Bergami ____________________________ Giacomo Bergami, Ph.D Student University of Bologna https://www.unibo.it/sitoweb/giacomo.bergami2 _______________________________________________ users-list mailing list users-list@monetdb.org<mailto:users-list@monetdb.org> https://www.monetdb.org/mailman/listinfo/users-list

Hi Giacomo, 1) Which version of MonetDB are you using? Environment? 2) What do you mean by "the client hangs"? Best, Wenjian On Tue, Dec 22, 2015 at 10:46 PM, Giacomo Bergami <giacomo.bergami2@unibo.it
wrote:
Now I'm trying to follow the example given in this wiki: https://www.monetdb.org/wiki/TPCH_Example and https://www.monetdb.org/Documentation/Manuals/SQLreference/Explain.
I tried to perform in the mclient the following query, where with the first statement I try to initialize the sql module.
mal>s := sql.start(); mal>_2 := sql.mvc();
but after the second command, the client hangs and does not me allow to perform the query. Is there any way to overcome this problem? Thanks again.
________________________________ Da: users-list [users-list-bounces+giacomo.bergami2=unibo.it@monetdb.org] per conto di Lefteris [lsidir@gmail.com] Inviato: mercoledì 16 dicembre 2015 17.20 A: Communication channel for MonetDB users Oggetto: Re: Performing a direct access to MonetDB's BAT tables via MAL
Hi,
in the MAL level the fastest and best access to a BAT is still subselect if you are looking for a value and fetch if you are interested in the value to a specific position (aka oid).
Lefteris
On Wed, Dec 16, 2015 at 4:45 PM, Giacomo Bergami < giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it>> wrote: Good Morning/Evening everyone.
My aim is to direcly access to the BAT column store representation of MonetDB through the standard libraries (MAPI/JDBC) - if possible. I know that each SQL query gets rewrited into a BAT algebra expression, but in my case I want to access to a single value per time (e.g. I want to access to the value stored in the i-th row and in the column labelled "j" of a given table) and maybe in this case the direct access is quicker than performing the whole SQL query.
I've already tried to use the mclient with the MAL language and read the documentation, and I tried to use the client with something like this:
mdb.start(); bbp.open(); bbp.prelude(); a := bbp.bind("fx", "size");
where "fx" should be the name of the table and "size" one of its attributes. But unfortunately I do not know how to search for a specific row-key and to get the correspondant value, and AFAIK i have to get the id of the column "size".
Thanks in advance, Giacomo Bergami ____________________________ Giacomo Bergami, Ph.D Student University of Bologna https://www.unibo.it/sitoweb/giacomo.bergami2 _______________________________________________ users-list mailing list users-list@monetdb.org<mailto:users-list@monetdb.org> https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list

Hi, 1) I am using "MonetDB Database Server Toolkit v1.1 (Jul2015-SP1)" (monetdb -v) on MacOSX El Capitain, and I am trying to run the commands in mclient: mclient -v "mclient, the MonetDB interactive terminal (Jul2015-SP1) support for command-line editing compiled-in character encoding: UTF-8" 2) After that command mclient is "blocked". Best, gb ________________________________ Da: users-list [users-list-bounces+giacomo.bergami2=unibo.it@monetdb.org] per conto di Xu,Wenjian [zeroxwj@gmail.com] Inviato: mercoledì 23 dicembre 2015 4.37 A: Communication channel for MonetDB users Oggetto: Re: Performing a direct access to MonetDB's BAT tables via MAL Hi Giacomo, 1) Which version of MonetDB are you using? Environment? 2) What do you mean by "the client hangs"? Best, Wenjian On Tue, Dec 22, 2015 at 10:46 PM, Giacomo Bergami <giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it>> wrote: Now I'm trying to follow the example given in this wiki: https://www.monetdb.org/wiki/TPCH_Example and https://www.monetdb.org/Documentation/Manuals/SQLreference/Explain. I tried to perform in the mclient the following query, where with the first statement I try to initialize the sql module. mal>s := sql.start(); mal>_2 := sql.mvc(); but after the second command, the client hangs and does not me allow to perform the query. Is there any way to overcome this problem? Thanks again. ________________________________ Da: users-list [users-list-bounces+giacomo.bergami2=unibo.it@monetdb.org<mailto:unibo.it@monetdb.org>] per conto di Lefteris [lsidir@gmail.com<mailto:lsidir@gmail.com>] Inviato: mercoledì 16 dicembre 2015 17.20 A: Communication channel for MonetDB users Oggetto: Re: Performing a direct access to MonetDB's BAT tables via MAL Hi, in the MAL level the fastest and best access to a BAT is still subselect if you are looking for a value and fetch if you are interested in the value to a specific position (aka oid). Lefteris On Wed, Dec 16, 2015 at 4:45 PM, Giacomo Bergami <giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it><mailto:giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it>>> wrote: Good Morning/Evening everyone. My aim is to direcly access to the BAT column store representation of MonetDB through the standard libraries (MAPI/JDBC) - if possible. I know that each SQL query gets rewrited into a BAT algebra expression, but in my case I want to access to a single value per time (e.g. I want to access to the value stored in the i-th row and in the column labelled "j" of a given table) and maybe in this case the direct access is quicker than performing the whole SQL query. I've already tried to use the mclient with the MAL language and read the documentation, and I tried to use the client with something like this: mdb.start(); bbp.open(); bbp.prelude(); a := bbp.bind("fx", "size"); where "fx" should be the name of the table and "size" one of its attributes. But unfortunately I do not know how to search for a specific row-key and to get the correspondant value, and AFAIK i have to get the id of the column "size". Thanks in advance, Giacomo Bergami ____________________________ Giacomo Bergami, Ph.D Student University of Bologna https://www.unibo.it/sitoweb/giacomo.bergami2 _______________________________________________ users-list mailing list users-list@monetdb.org<mailto:users-list@monetdb.org><mailto:users-list@monetdb.org<mailto:users-list@monetdb.org>> https://www.monetdb.org/mailman/listinfo/users-list _______________________________________________ users-list mailing list users-list@monetdb.org<mailto:users-list@monetdb.org> https://www.monetdb.org/mailman/listinfo/users-list

1) I am using "MonetDB Database Server Toolkit v1.1 (Jul2015-SP1)" (monetdb -v) on MacOSX El Capitain, and I am trying to run the commands in mclient:
mclient -v "mclient, the MonetDB interactive terminal (Jul2015-SP1) support for command-line editing compiled-in character encoding: UTF-8"
okay.
2) After that command mclient is "blocked".
I do not know why you start with *mal>s := sql.start();*. Normally when
you type *explain <a sql query>*, the query plan starts with: mal>function user.s2_2{autoCommit=true}():void; mal>barrier X_37 := language.dataflow(); mal>X_2 := sql.mvc(); mal>... In this way you won't be blocked. I am not sure if it would answer your question. Best, Wenjian
________________________________ Da: users-list [users-list-bounces+giacomo.bergami2=unibo.it@monetdb.org] per conto di Xu,Wenjian [zeroxwj@gmail.com] Inviato: mercoledì 23 dicembre 2015 4.37 A: Communication channel for MonetDB users Oggetto: Re: Performing a direct access to MonetDB's BAT tables via MAL
Hi Giacomo,
1) Which version of MonetDB are you using? Environment?
2) What do you mean by "the client hangs"?
Best, Wenjian
On Tue, Dec 22, 2015 at 10:46 PM, Giacomo Bergami < giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it>> wrote: Now I'm trying to follow the example given in this wiki: https://www.monetdb.org/wiki/TPCH_Example and https://www.monetdb.org/Documentation/Manuals/SQLreference/Explain.
I tried to perform in the mclient the following query, where with the first statement I try to initialize the sql module.
mal>s := sql.start(); mal>_2 := sql.mvc();
but after the second command, the client hangs and does not me allow to perform the query. Is there any way to overcome this problem? Thanks again.
________________________________ Da: users-list [users-list-bounces+giacomo.bergami2=unibo.it@monetdb.org <mailto:unibo.it@monetdb.org>] per conto di Lefteris [lsidir@gmail.com <mailto:lsidir@gmail.com>] Inviato: mercoledì 16 dicembre 2015 17.20 A: Communication channel for MonetDB users Oggetto: Re: Performing a direct access to MonetDB's BAT tables via MAL
Hi,
in the MAL level the fastest and best access to a BAT is still subselect if you are looking for a value and fetch if you are interested in the value to a specific position (aka oid).
Lefteris
On Wed, Dec 16, 2015 at 4:45 PM, Giacomo Bergami < giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it><mailto: giacomo.bergami2@unibo.it<mailto:giacomo.bergami2@unibo.it>>> wrote: Good Morning/Evening everyone.
My aim is to direcly access to the BAT column store representation of MonetDB through the standard libraries (MAPI/JDBC) - if possible. I know that each SQL query gets rewrited into a BAT algebra expression, but in my case I want to access to a single value per time (e.g. I want to access to the value stored in the i-th row and in the column labelled "j" of a given table) and maybe in this case the direct access is quicker than performing the whole SQL query.
I've already tried to use the mclient with the MAL language and read the documentation, and I tried to use the client with something like this:
mdb.start(); bbp.open(); bbp.prelude(); a := bbp.bind("fx", "size");
where "fx" should be the name of the table and "size" one of its attributes. But unfortunately I do not know how to search for a specific row-key and to get the correspondant value, and AFAIK i have to get the id of the column "size".
Thanks in advance, Giacomo Bergami ____________________________ Giacomo Bergami, Ph.D Student University of Bologna https://www.unibo.it/sitoweb/giacomo.bergami2 _______________________________________________ users-list mailing list users-list@monetdb.org<mailto:users-list@monetdb.org><mailto: users-list@monetdb.org<mailto:users-list@monetdb.org>> https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org<mailto:users-list@monetdb.org> https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (3)
-
Giacomo Bergami
-
Lefteris
-
Xu,Wenjian