Pentaho Saiku CE plugin - Change Asterisk CrossJoin in CrossJoin Classic

Saiku plugin is (maybe) the most used plugin in Pentaho CE. I like this plugin, but in 3.x version the developers, use for CrossJoin the asterisk (*) operator as a shorthand for crossjoin. It's easy, clean, but when i put more then 4 dimensions the query takes to much time against the classic CROSSJOIN().


To achieve old functionality I've modified 2 files in saiku-query library: src/main/java/org/saiku/query/ and src/main/java/org/saiku/query/

protected static CallNode generateCrossJoin(List selections, boolean nonEmpty, boolean asterisk) {
 String crossJoinFun = "CrossJoin";
 ParseTreeNode sel1 = selections.remove(0);
 if (sel1 instanceof MemberNode) {
  sel1 = generateSetCall(sel1);
 if (selections.size() == 1) {
  ParseTreeNode sel2 = selections.get(0);
  if (sel2 instanceof MemberNode) {
   sel2 = generateSetCall(sel2);
  return new CallNode(
    null, crossJoinFun, Syntax.Function, sel1, sel2);

 } else {
  return new CallNode(
   null, crossJoinFun, Syntax.Function, sel1,
   generateCrossJoin(selections, nonEmpty,false));

axisExpression = generateCrossJoin(hierarchies, axis.isNonEmpty(), false);

Surce code:


Postări populare de pe acest blog

SmokePing integrate with Observium