3 Replies Latest reply on Sep 8, 2010 12:53 PM by shawkins

    QueryResolverException upon generated SQL query from Mondrian

    chesse

      Hello,

       

      I've setup a "Star-schema" vdb to connect from an Mondrian client. Upon executing a MDX statement I get the following exception:

       

      Mondrian Error:Internal error: while building member cache;  sql=[select "Batch"."ident" as "c0" from "staR"."Batch" as "Batch" group  by "Batch"."ident" order by "Batch"."ident" ASC]

       

      Remote org.teiid.api.exception.query.QueryResolverException:  Unrelated order by column Batch.ident cannot be used in a SET query,  with SELECT DISTINCT, or GROUP BY

       

      It seems that the query engine can't execute "order by table.column".

      If the statement is changed from:

       

      select "Batch"."ident" as "c0" from "staR"."Batch" as "Batch" group  by "Batch"."ident" order by "Batch"."ident" ASC

       

      to

       

      select "Batch"."ident" as "c0" from "staR"."Batch" as "Batch" group  by "Batch"."ident" order by "c0" ASC

       

      it works.

       

      Using the alias "c0" in the "group by" doesn't work either. I've tested this with the DTP SQL Scrapbook connected to the vdb.

       

       

      Thanks,
      Carmon