QuarkCube { public static Set<Set<Dimension>> getDimensionSets(Set<Dimension> dimensions) { Set<Set<Dimension>> result = Sets.newHashSet(); result.add(new HashSet<>()); for (Dimension d : dimensions) { if (d.parentDimension == null) { result = cartesian(ImmutableList.of(result, getHierarichalSet(d, new AtomicBoolean(false)))); } } return result; } QuarkCube(String name, Object sql, List<Measure> measures,
                   List<Dimension> dimensionList,
                   List<String> tableName, String groupingColumn);  QuarkCube(String name, Object sql, List<Measure> measures,
                   List<Dimension> dimensionList,
                   List<Group> groupList,
                   List<String> tableName, String groupingColumn);  QuarkCube(String name, Object sql, List<Measure> measures,
                   List<Dimension> dimensionList,
                   List<Group> groupList,
                   List<String> tableName, String groupingColumn,
                   List<String> alias); Lattice build(CalciteSchema calciteSchema, QuarkTable quarkTable); static Set<Set<Dimension>> getDimensionSets(Set<Dimension> dimensions); static Set<Set<E>> cartesian(List<Set<T>> list); final String name; final Object sql; final List<Measure> measures; final Set<Dimension> dimensions; final List<String> tableName; final List<String> alias; final String groupingColumn; final Set<Set<Dimension>> groups; }
@Test public void computeDimensionSet() { Set<Set<QuarkCube.Dimension>> dimSet = QuarkCube.getDimensionSets( fixture.getAllDim()); assertEquals(dimSet.size(), 8); }
@Test public void computeHeirDimensionSet() { Set<Set<QuarkCube.Dimension>> dimSet = QuarkCube.getDimensionSets( fixture.getHeirDim()); assertEquals(dimSet.size(), 4); }