<br>What you are trying to accomplish is more complex than you would expect. Mondrian does not necessarily translate a given MDX query into a deterministic list of SQL statements. Imagine the work load and poor performance if this was the case. So for optimization reasons, Mondrian will use a heuristic approach in order to figure out the most efficient way to answer a given MDX query. The SQL queries will themselves be tailored to take full advantage of the underlying RDBMS facilities. Mondrian will also represent internally the data tuples / aggregations in a cross-query reusable cache structure, so the order in which the MDX queries come in will influence which SQL query get generated/executed.<br>

<br>As you can guess by now, it is a big requirement. There are also architectural constraints we would require on possible contributions before we accept to become the stewards of the code. Should you decide to go forward, I strongly suggest we have an in-depth discussion about this feature and how it fits in Mondrian as a whole.<br>

<br>Luc<br><br><br><div class="gmail_quote">On Mon, Feb 21, 2011 at 11:59 AM, JS Ubei <span dir="ltr">&lt;<a href="mailto:jsubei@yahoo.fr">jsubei@yahoo.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Hi Luc,<br><br>One more time, thank you.<br>Wonderfull this feature ... but I can&#39;t wait !<br>

<br>I will try to evaluate the difficulty to do this myself and if it&#39;s too hard or &quot;time consumer&quot; I will do my multidimensional database exploration without mondrian.<br><br>And what the problem if I just, to begin, add a flag to know if I really want execute the query (i.e. fetch results) or if I just want the SQL query building part ?<br>

<div class="hm"><br><br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div class="hm"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">De :</span></b> Luc Boudreau &lt;<a href="mailto:lucboudreau@gmail.com" target="_blank">lucboudreau@gmail.com</a>&gt;<br>

<b><span style="font-weight: bold;">À :</span></b>
 Mondrian developer mailing list &lt;<a href="mailto:mondrian@pentaho.org" target="_blank">mondrian@pentaho.org</a>&gt;<br><b><span style="font-weight: bold;">Cc :</span></b> JS Ubei &lt;<a href="mailto:jsubei@yahoo.fr" target="_blank">jsubei@yahoo.fr</a>&gt;<br>

<b><span style="font-weight: bold;">Envoyé le :</span></b> Lun 21 février 2011, 13h 39min 31s<br><b><span style="font-weight: bold;">Objet :</span></b> Re: [Mondrian] need to get SQL queries from MDX<br></font></div><div>

<div></div><div class="h5"><br>Norbie,<br><br>The feature you are searching for doesn&#39;t exist yet. But good news for you, it is on the roadmap for this year. We included it in a feature request called &quot;Explain Query Feature&quot;. The end result will do exactly what you are looking for, and then more. Keep a watch on the following Jira case for updates. Should you decide to contribute to parts of this feature, don&#39;t hesitate to get in touch with us.<br>



<br><a rel="nofollow" href="http://jira.pentaho.com/browse/MONDRIAN-856" target="_blank">http://jira.pentaho.com/browse/MONDRIAN-856</a><br><br><br><br><br><div class="gmail_quote">On Mon, Feb 21, 2011 at 9:04 AM, JS Ubei <span dir="ltr">&lt;<a rel="nofollow" href="mailto:jsubei@yahoo.fr" target="_blank">jsubei@yahoo.fr</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Dear mondrian community,<br>
<br>
In a starting project I plan to use mondrian for MDX queries facilitiy. But in<br>
another part of the project we need to have the SQL resulting queries to use<br>
with an external tool (GIS).<br>
How can I do with the API ?<br>
Idealy, something like :<br>
<br>
//********************<br>
Query query = connection.parseQuery(...)<br>
String sql_query = connection.getSQL(query)<br>
//*******************<br>
<br>
Is the SqlStatement.execute() a good starting point to explore ?<br>
<br>
Best regards,<br>
Norbie<br>
<br>
<br>
<br>
_______________________________________________<br>
Mondrian mailing list<br>
<a rel="nofollow" href="mailto:Mondrian@pentaho.org" target="_blank">Mondrian@pentaho.org</a><br>
<a rel="nofollow" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
</blockquote></div><br>
</div></div></div></div>
</div><br>




      </div></blockquote></div><br>