[Mondrian] RolapUtil.executeQuery

Kleyson Rios kleysonrios at saude.go.gov.br
Wed Jun 13 15:22:05 EDT 2012


Actually, I am trying to implement dynamic role and it is not working, 
so I am trying to understand why.

At some point in the code I have my hierarchy topLevel and for this 
level I need their members, then the following methods are called by 
Pentaho:

public List<RolapMember> getMembersInLevel
     list = 
rolapHierarchy.getMemberReader().getMembersInLevel(cubeLevel.getRolapLevel(), 
startOrdinal, endOrdinal, constraint);
         members = source.getMembersInLevel(level, startOrdinal, 
endOrdinal, constraint);
             getMembersInLevel(level, constraint);
                 final TupleList tupleList = 
tupleReader.readTuples(dataSource, null, null);
                     prepareTuples(jdbcConnection, partialResult, 
newPartialResult);
                         (...)
                         stmt = RolapUtil.executeQuery(
                             dataSource, sql, types, maxRows, 0,
                             new SqlStatement.StatementLocus(
                                 Locus.peek().execution,
                                 "SqlTupleReader.readTuples " + 
partialTargets,
                                 message,
                                 SqlStatementEvent.Purpose.TUPLES, 0),
                             -1, -1);
                         (...)

So, at that point I should get the topLevel's member but I got an 
exception from Locus.peek().execution. And it's a little hard to 
understand what's the problem.

Thanks in advance.

Regards.

-- 

Kleyson Rios
Gestor de TI
Coordenador de BI / Banco de Dados
Gerência de Tecnologia da Informação
Secretaria de Estado da Saúde de Goiás
(62) 3201-3707

Se não pode vencer pelo talento, vença pelo esforço. (Dave Weinbaum)


Em 13/6/2012 15:56, Luc Boudreau escreveu:
> Try this:
>
>                return Locus.execute(
>                 mondrianConnection,
>                 "Description",
>                 new Locus.Action<Void>() {
>                     public Void execute()
>                     {
>                         // Do anything here.
>                         return null;
>                     }
>                 });
>
> ... where MondrianConnection is a RolapConnection object. May I ask 
> why you need to use the private API?
>
> Luc
>
>
> On Wed, Jun 13, 2012 at 2:52 PM, Kleyson Rios 
> <kleysonrios at saude.go.gov.br <mailto:kleysonrios at saude.go.gov.br>> wrote:
>
>     I am trying to understand some things and in the
>     mondrian.rolap.SqlTupleReader we have:
>
>     protected void prepareTuples(
>             DataSource dataSource,
>             TupleList partialResult,
>             List<List<RolapMember>> newPartialResult)
>         {
>                     (...)
>
>                     stmt = RolapUtil.executeQuery(
>                         dataSource, sql, types, maxRows, 0,
>                         new SqlStatement.StatementLocus(
>                             Locus.peek().execution,
>                             "SqlTupleReader.readTuples " + partialTargets,
>                             message,
>                             SqlStatementEvent.Purpose.TUPLES, 0),
>                         -1, -1);
>
>                     (...)
>     }
>
>     And when I run stmt I got the following exception at
>     Locus.peek().execution: "throw new EmptyStackException();"
>
>     I would expect get a result from the sql.
>
>     Parameters:
>     dataSource: org.apache.commons.dbcp.PoolingDataSource at 1def85
>
>     sql: select "CUSTOMER_W_TER"."TERRITORY" as "c0" from "CUSTOMER_W_TER"
>     as "CUSTOMER_W_TER" group by "CUSTOMER_W_TER"."TERRITORY" order by
>     CASE
>     WHEN "CUSTOMER_W_TER"."TERRITORY" IS NULL THEN 1 ELSE 0 END,
>     "CUSTOMER_W_TER"."TERRITORY" ASC
>
>     types: [null]
>
>     maxRows: 0
>
>
>     Any idea ?
>
>     Regards.
>
>     --
>     Kleyson Rios
>     Gestor de TI
>     Coordenador de BI / Banco de Dados
>     Gerência de Tecnologia da Informação
>     Secretaria de Estado da Saúde de Goiás
>     (62) 3201-3707 <tel:%2862%29%203201-3707>
>
>     Se não pode vencer pelo talento, vença pelo esforço. (Dave Weinbaum)
>
>     _______________________________________________
>     Mondrian mailing list
>     Mondrian at pentaho.org <mailto:Mondrian at pentaho.org>
>     http://lists.pentaho.org/mailman/listinfo/mondrian
>
>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20120613/4776b3f0/attachment-0001.html 


More information about the Mondrian mailing list