Пример #1
0
 /**
  * Figure out queried dim attributes and measures from the cube query context
  *
  * @param cubeql
  * @throws LensException
  */
 private void findDimAttributesAndMeasures(CubeQueryContext cubeql) throws LensException {
   CubeInterface cube = cubeql.getCube();
   if (cube != null) {
     Set<String> cubeColsQueried = cubeql.getColumnsQueried(cube.getName());
     Set<String> queriedDimAttrs = new HashSet<String>();
     Set<String> queriedMsrs = new HashSet<String>();
     Set<String> queriedExprs = new HashSet<String>();
     if (cubeColsQueried != null && !cubeColsQueried.isEmpty()) {
       for (String col : cubeColsQueried) {
         if (cube.getMeasureNames().contains(col)) {
           queriedMsrs.add(col);
         } else if (cube.getDimAttributeNames().contains(col)) {
           queriedDimAttrs.add(col);
         } else if (cube.getExpressionNames().contains(col)) {
           queriedExprs.add(col);
         }
       }
     }
     cubeql.addQueriedDimAttrs(queriedDimAttrs);
     cubeql.addQueriedMsrs(queriedMsrs);
     cubeql.addQueriedExprs(queriedExprs);
   }
 }