Re: [MonetDB-users] monetdb_sql/mal() ?
Jason Kinzer a écrit :
Besides, It would seem to overlap with Mauricio's work which already provides some parsing from his OCaml algebra to SQL. But the thing is, you've got the SQL string created at OCaml compile time.
I may be wrong about this compile time assertion. It now seems to me that this is runtime. In which case, it would make sense to map Mauricio's relational algebra to MAL's relational algebra.
What would be nice is to have the SQL -> MAL compilation also happen at the same time you compile the OCaml program.
(Moreover, it seems to me that MAL comes in two flavour: a human-readable one and a machine readable one. Is that correct? If yes, I'm aiming at the machine readable one.)
How easy would that be? Do you need a running embedded server for that, or simply a subset of the functionalities of the MonetDB shared libraries?
Ah, I see now, so you're talking about actually writing a SQL->MAL compiler as part of that existing Ocaml SQL frontend (sort of cut out the "middle-man").
Yes.
That sounds neat, but bear in mind that could be tantamount to re-writing the existing Monet SQL frontend, depending on your goals
In fact, I would like to do an OCaml/C binding to the SQL -> MAL compilation that is already done in MonetDB. This seems to me the least effort path. But I'd like to know where in the code is this compilation / conversion from SQL to MAL done.
- so I let you draw your own conclusions. Try doing an "explain" on various SQL statements to see the generated MAL.
Sorry, I'm quite new to MonetDB and still having a hard time with the documentation. What is this "explain" thing I should be doing?
I would say writing a very naive, minimal SQL translation is not easy but certainly within raeach. Here someone other than I should comment, but I think most of the complexity of the existing frontend lies in the optimization passes, tx handling, approaches to handle datasets that won't fit in memory, etc.
Rewriting an SQL -> MAL translation is not my goal. Reusing an existing one would be one my goals. All the best, -- Guillaume Yziquel http://yziquel.homelinux.org/
But I'd like to know where in the code is this compilation / conversion from SQL to MAL done.
Check out the sources for the SQL frontend: http://monetdb.cwi.nl/downloads/sources/Nov2009-SP1/MonetDB-SQL-2.34.2.tar.g...
Sorry, I'm quite new to MonetDB and still having a hard time with the documentation. What is this "explain" thing I should be doing?
In mclient you can do explains on queries, e.g. "explain select * from foo" to see the generated MAL. Of course that's probably only useful if you're
It's actually (at least a high level) pretty easy to understand because it looks a lot like a traditional compiler [tho targetting MAL instead of say, bytecode] which for us Ocaml guys is bread-and-butter stuff ;-) Of course it's not quite that straight-forward tho because it's tightly coupled to the SQL runtime which in turn has to integrate to some extent with the underlying MAL interpreter and BAT stuff. But I digress... planning on doing something at the MAL level.
Rewriting an SQL -> MAL translation is not my goal. Reusing an existing one would be one my goals.
Well, In that case I'm a bit unclear how this is much different than just feeding a SQL string through MAPI, just as you would e.g. to Oracle through OCI, etc. But in any case, best of luck.
participants (2)
-
Guillaume Yziquel
-
Jason Kinzer