Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewritten version of the query #60

Open
MrAta opened this issue Jun 11, 2020 · 3 comments
Open

rewritten version of the query #60

MrAta opened this issue Jun 11, 2020 · 3 comments

Comments

@MrAta
Copy link

MrAta commented Jun 11, 2020

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
Copy link
Collaborator

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
Copy link
Author

MrAta commented Jun 11, 2020

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
Copy link
Collaborator

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants