<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Haven't got it breaking in Foodmart
      yet, but there is Mondrian-1610 to keep you entertained.<br>
      <br>
      <br>
      On 05/06/13 16:25, Luc Boudreau wrote:<br>
    </div>
    <blockquote
cite="mid:CAKTEAx8vP1E0ShofEpq0d8nT0_j4T256LiC+u9Oa-RxpXe=opg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Sure thing. Put anything you can share in a Jira
        case and let me know the #.<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Wed, Jun 5, 2013 at 11:24 AM, Tom
          Barber(Alabs) <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:tom@analytical-labs.com" target="_blank">tom@analytical-labs.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>Okay I don't have a foodmart repro path Luc but I do
                know whats causing it.<br>
                <br>
                My client has written a schema which has a User
                dimension,<br>
                <br>
                within that dimension it has a bunch of attributes that
                reference more than one table one of them is:<br>
                <br>
                &lt;Attribute name="Path ID" keyColumn="PATH_ID"
                table="LKP_PATH" hasHierarchy='false'/&gt;<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Attribute name="Path Configuration"
                keyColumn="CONFIGURATION" table="LKP_PATH"
                hasHierarchy='false'/&gt;<br>
                <br>
                and then they include those attributes in a Hierarchy:<br>
                <br>
                &lt;Hierarchy name='Path' allMemberName='All Path'&gt;<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level attribute='Path ID' /&gt;<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Level attribute='Path
                Configuration'/&gt;<br>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Hierarchy&gt; <br>
                <br>
                This is all parsed fine by Mondrian and the schema
                loads.<br>
                <br>
                <br>
                But as soon as you enable that Hierarchy and then use
                the Path ID field elsewhere in the schema, in their case
                they also have a dimension called Path which also uses
                the LKP_PATH table, thats when the SQL gets aliased
                incorrectly.<br>
                <br>
                Luc I can send you their schema and SQL table structure
                offline if that would help.<span class="HOEnZb"><font
                    color="#888888"><br>
                    <br>
                    Tom</font></span>
                <div class="im"><br>
                  <br>
                  <br>
                  On 05/06/13 15:46, Luc Boudreau wrote:<br>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">Can you reproduce this on FoodMart?
                      I'd like to create an item in Jira so we address
                      this ASAP.<br>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On Wed, Jun 5, 2013 at
                        10:03 AM, Tom Barber(Alabs) <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:tom@analytical-labs.com"
                            target="_blank">tom@analytical-labs.com</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div text="#000000" bgcolor="#FFFFFF">
                            <div>Hi Luc, the SQL itself I'd stripped
                              out, <br>
                              <br>
                              All I'm doing it putting a Level.Member&nbsp;
                              on Rows and a Measure on the columns.<br>
                              <br>
                              And I get: <br>
                              Caused by:
                              mondrian.olap.MondrianException: Mondrian
                              Error:Failed to load segment form SQL<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
mondrian.rolap.agg.SegmentLoader.createExecuteSql(SegmentLoader.java:643)<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
                              mondrian.rolap.agg.SegmentLoader.loadImpl(SegmentLoader.java:195)<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... 8 more<br>
                              Caused by:
                              mondrian.olap.MondrianException: Mondrian
                              Error:Internal error: Error while loading
                              segment; sql=[select `LKP_PATH`.`PATH_ID`
                              as `c0`,
                              count(`FCT_RESUMEUPLOAD`.`FACT_RESUMEUPLOAD_KEY`)
                              as `m0` from `LKP_PATH` as `LKP_PATH_1`,
                              `FCT_RESUMEUPLOAD` as `FCT_RESUMEUPLOAD`
                              where `FCT_RESUMEUPLOAD`.`PATH_KEY` =
                              `LKP_PATH`.`PATH_KEY` and
                              `LKP_PATH`.`PATH_ID` = 'hello' group by
                              `LKP_PATH`.`PATH_ID`]<br>
                              <br>
                              Thats the real SQL generated. I'm using
                              the latest Mondrian 4 + Saiku build from
                              our CI, its tagged 4.0.0-SNAPSHOT so I
                              don't know what exact Mondrian 4 build it
                              used but it was built 11 hours ago.<br>
                              <br>
                              mysql&nbsp; Ver 14.14 Distrib 5.5.31, for Linux
                              (x86_64) using readline 5.1<br>
                              <br>
                              I was actually trying to debug another
                              issue for a client, but I can't even run
                              this query.<br>
                              <br>
                              Cheers<span><font color="#888888"><br>
                                  <br>
                                  Tom</font></span>
                              <div>
                                <div><br>
                                  <br>
                                  <br>
                                  On 05/06/13 14:46, Luc Boudreau wrote:<br>
                                </div>
                              </div>
                            </div>
                            <div>
                              <div>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div>Where is that SQL generated? Is
                                      this a tuple query? This looks
                                      like a bug; not a dialect issue.<br>
                                      <br>
                                    </div>
                                    Luc<br>
                                  </div>
                                  <div class="gmail_extra"><br>
                                    <br>
                                    <div class="gmail_quote">On Wed, Jun
                                      5, 2013 at 9:09 AM, Tom
                                      Barber(Alabs) <span dir="ltr">&lt;<a
                                          moz-do-not-send="true"
                                          href="mailto:tom@analytical-labs.com"
                                          target="_blank">tom@analytical-labs.com</a>&gt;</span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote"
                                        style="margin:0 0 0
                                        .8ex;border-left:1px #ccc
                                        solid;padding-left:1ex">Hello
                                        Mondrian fans,<br>
                                        <br>
                                        I'm trying to get a schema
                                        running under Mondrian 4 and
                                        Mysql and when a<br>
                                        query is run its generating SQL
                                        like this:<br>
                                        <br>
                                        select `LKP_PATH`.`PATH_ID` as
                                        `c0` from `LKP_PATH` as
                                        `LKP_PATH_1`;<br>
                                        <br>
                                        which MySQL is getting upset
                                        over because the table name at
                                        the start of<br>
                                        the select isn't the aliased
                                        table name but the original:<br>
                                        <br>
                                        &nbsp; select `LKP_PATH_1`.`PATH_ID`
                                        as `c0` from `LKP_PATH` as
                                        `LKP_PATH_1`;<br>
                                        <br>
                                        The above is a valid query.<br>
                                        <br>
                                        Any property I can set to get
                                        this working?<br>
                                        <br>
                                        Thanks<br>
                                        <br>
                                        Tom<br>
_______________________________________________<br>
                                        Mondrian mailing list<br>
                                        <a moz-do-not-send="true"
                                          href="mailto:Mondrian@pentaho.org"
                                          target="_blank">Mondrian@pentaho.org</a><br>
                                        <a moz-do-not-send="true"
                                          href="http://lists.pentaho.org/mailman/listinfo/mondrian"
                                          target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                  <pre>_______________________________________________
Mondrian mailing list
<a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org" target="_blank">Mondrian@pentaho.org</a>
<a moz-do-not-send="true" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a>
</pre>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                          <br>
_______________________________________________<br>
                          Mondrian mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:Mondrian@pentaho.org"
                            target="_blank">Mondrian@pentaho.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.pentaho.org/mailman/listinfo/mondrian"
                            target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
Mondrian mailing list
<a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org" target="_blank">Mondrian@pentaho.org</a>
<a moz-do-not-send="true" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Mondrian mailing list<br>
            <a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.pentaho.org/mailman/listinfo/mondrian"
              target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Mondrian mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>
<a class="moz-txt-link-freetext" href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>