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/