[Monetdb-developers] MAL access to tables created with SQL
Hello, how is it possible to access in a MAL client session (mclient -l mal) the BATs of tables which were created previously in sql? I have tried different versions of bat.new, and bbp.bind. I tried different naming schemes (e.g. "tablename_columnname" which was mentioned somewhere in the docs), but I always get Referenced BAT not found And when I try to use sql.bind, I get SQLException:mvc:MAL_SCENARIO_PARSER not initialized Another question: is there a way of seeing the MAL translation of sql queries? EXPLAIN works great for SELECT statements, but it doesn't translate DDL expressions like CREATE TABLE. Many thanks Kambiz
darabi@web.de wrote:
Hello,
how is it possible to access in a MAL client session (mclient -l mal) the BATs of tables which were created previously in sql?
You can't, because the mapping of SQL to BATs is maintained in the SQL private catalog. Also, each column in SQL has multiple bats.
I have tried different versions of bat.new, and bbp.bind. I tried different naming schemes (e.g. "tablename_columnname" which was mentioned somewhere in the docs), but I always get
Referenced BAT not found
And when I try to use sql.bind, I get
SQLException:mvc:MAL_SCENARIO_PARSER not initialized
Another question: is there a way of seeing the MAL translation of sql queries? EXPLAIN works great for SELECT statements, but it doesn't translate DDL expressions like CREATE TABLE.
No, we are in the process to also open up this facility for some optimization steps.
Many thanks
Kambiz
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
OK. Is there a way of seeing what MAL gets executed, when a
statement is issued? By modifying the log level or sth. like that?
Thanks
Kambiz
----- Original Message -----
From: "Martin Kersten"
Hello,
how is it possible to access in a MAL client session (mclient -l mal) the BATs of tables which were created previously in sql?
You can't, because the mapping of SQL to BATs is maintained in the SQL private catalog. Also, each column in SQL has multiple bats.
On Thu, Oct 11, 2007 at 06:29:33AM +0200, darabi@web.de wrote:
OK. Is there a way of seeing what MAL gets executed, when a statement is issued? By modifying the log level or sth. like that?
in m5/sql run your query with explain select * from tables or debug select * from tables this should give you some more insight. Niels
Thanks
Kambiz
----- Original Message ----- From: "Martin Kersten"
To: darabi@web.de Cc: monetdb-developers@lists.sourceforge.net Sent: Mittwoch, 10. Oktober 2007 23.50 Uhr (GMT+0100) Europe/Berlin Subject: Re: [Monetdb-developers] MAL access to tables created with SQL darabi@web.de wrote:
Hello,
how is it possible to access in a MAL client session (mclient -l mal) the BATs of tables which were created previously in sql?
You can't, because the mapping of SQL to BATs is maintained in the SQL private catalog. Also, each column in SQL has multiple bats.
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
Martin.Kersten@cwi.nl wrote:
darabi@web.de wrote:
Hello,
how is it possible to access in a MAL client session (mclient -l mal) the BATs of tables which were created previously in sql?
You can't, because the mapping of SQL to BATs is maintained in the SQL private catalog. Also, each column in SQL has multiple bats.
Is it not recommended or not at all possible? Because what I am up to could be implemented on top of sql (at least to rapidly get off the ground in the beginning). I would like to have something like this for an OODB schema: - one bat for each class - one bat for each attribute (maybe also a persistent reversed bat sorted on the value to be able to speed up equality and range queries) - one bat for each relation between classes - one bat for each collection which contains attributes (and not references) And if I interpret the contents of sql_catalog correctly, much of it is already present there. If it is technically impossible, then I would have to duplicate some of that. Kambiz
Martin.Kersten@cwi.nl wrote:
darabi@web.de wrote:
Hello,
how is it possible to access in a MAL client session (mclient -l mal) the BATs of tables which were created previously in sql?
You can't, because the mapping of SQL to BATs is maintained in the SQL private catalog. Also, each column in SQL has multiple bats.
Is it not recommended or not at all possible? not recommended.
Because what I am up to could be implemented on top of sql (at least to rapidly get off the ground in the beginning).
I would like to have something like this for an OODB schema:
- one bat for each class - one bat for each attribute (maybe also a persistent reversed bat sorted on the value to be able to speed up equality and range queries) - one bat for each relation between classes - one bat for each collection which contains attributes (and not references)
And if I interpret the contents of sql_catalog correctly, much of it is already present there. Indeed, but when sql is running its in control of the sql_catalog bat (through
On Sat, Oct 13, 2007 at 02:36:45PM +0200, darabi@web.de wrote: the gdk_logger code). This means it assumes its the only one accessint it. Niels
If it is technically impossible, then I would have to duplicate some of that.
Kambiz
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
The discussion thread indicates a need for some advice. The software stack has been designed to ease a layered approach whereby the MAL layer acts as an abstract engine. In any such layering scheme, it is from a software architecture point of view highly discouraged to jump in the middle. Either, your solution works on top of SQL or it works directly on MAL. Don't ever attempt to be a man in the middle, e.g. exploiting the implementation scheme deployed for the SQL stack. It is much more complicated and extremely fragile. Instead, use the inspiration of SQL->MAL to develop your own solution, including the necessary catalog management structures. Or just extend SQL with a few missing functions to do the specifics. regards, Martin darabi@web.de wrote:
Martin.Kersten@cwi.nl wrote:
darabi@web.de wrote:
Hello,
how is it possible to access in a MAL client session (mclient -l mal) the BATs of tables which were created previously in sql?
You can't, because the mapping of SQL to BATs is maintained in the SQL private catalog. Also, each column in SQL has multiple bats.
Is it not recommended or not at all possible?
Because what I am up to could be implemented on top of sql (at least to rapidly get off the ground in the beginning).
I would like to have something like this for an OODB schema:
- one bat for each class - one bat for each attribute (maybe also a persistent reversed bat sorted on the value to be able to speed up equality and range queries) - one bat for each relation between classes - one bat for each collection which contains attributes (and not references)
And if I interpret the contents of sql_catalog correctly, much of it is already present there.
If it is technically impossible, then I would have to duplicate some of that.
Kambiz
Martin.Kersten@cwi.nl wrote:
The discussion thread indicates a need for some advice.
A nice euphemism for me being clueless :-)
Either, your solution works on top of SQL or it works directly on MAL. Don't ever attempt to be a man in the middle, e.g. exploiting the implementation scheme deployed for the SQL stack. It is much more complicated and extremely fragile.
OK. I never would want to modify the information which is created/maintained by SQL directly. I just wanted to have a look at them to learn something. My question arose from the fact, that I couldn't get that information. Probably due to a dumb mistake.
Instead, use the inspiration of SQL->MAL to develop your own solution, including the necessary catalog management structures. Or just extend SQL with a few missing functions to do the specifics.
I think some additional functions to SQL would be enough for storing the additional information. Thanks you for your advice Kambiz
participants (4)
-
darabi@web.de
-
Kambiz Darabi
-
Martin Kersten
-
Niels Nes