IITDBGroup / gprom

GProM is a middleware that adds support for provenance to database backends.
http://www.cs.iit.edu/%7edbgroup/research/gprom.php
Apache License 2.0
8 stars 5 forks source link

rewritten version of the query #60

Open MrAta opened 4 years ago

MrAta commented 4 years ago

Hi,

I've been looking at GProm recently, I was wondering how can I get the rewritten version of the query before its execution? Is it logged somewhere through the stack? or is there a standalone version of GProm or other utility that gives the rewritten version of input query?

lordpretzel commented 4 years ago

There is several ways of how to get this. First of most components of GProM's compilation pipeline are plugins that can be replaced. For your use case you want to change the executor plugin from "run" which executes the query and shows the result to "sql" which just returns the rewritten SQL code. For that add the parameter -Pexecutor run to the invocation of gprom:

gprom ... -Pexecutor run 

Alternatively, you can also increase the loglevel to see what happens internally (4 is debug, 3 is info, 2 is error (the default).

gprom ... -loglevel 4

Finally, you could link your application against GProM's shared library (which is not much tested though and there are some known hacks in there) or use the Java bindings which are build by default (albeit also not very tested so there may be bugs).

MrAta commented 4 years ago

Thanks for the detailed explanation! I'll go over it.

Not related to this issue, and since there's no pull request for wiki pages, I noticed that in the wiki page here in this example query SELECT a, sum(b) AS x FROM r GROUP BY b; the group by clause has to be GROUP BY a.

lordpretzel commented 3 years ago

thanks