Cube getBaseCube() { return cube instanceof Cube ? (Cube) cube : ((DerivedCube) cube).getParent(); }
Cube getBaseCube() { return cube instanceof Cube ? (Cube) cube : ((DerivedCube) cube).getParent(); }
private static String getTimeDimOfPartitionColumn(CubeInterface cube, String partCol) { if (cube == null) { return partCol; } if (cube instanceof DerivedCube) { return ((DerivedCube) cube).getParent().getTimeDimOfPartitionColumn(partCol); } else { return ((Cube) cube).getTimeDimOfPartitionColumn(partCol); } }
private static String getPartitionColumnOfTimeDim(CubeInterface cube, String timeDimName) { if (cube == null) { return timeDimName; } if (cube instanceof DerivedCube) { return ((DerivedCube) cube).getParent().getPartitionColumnOfTimeDim(timeDimName); } else { return ((Cube) cube).getPartitionColumnOfTimeDim(timeDimName); } }
private static String getPartitionColumnOfTimeDim(CubeInterface cube, String timeDimName) { if (cube == null) { return timeDimName; } if (cube instanceof DerivedCube) { return ((DerivedCube) cube).getParent().getPartitionColumnOfTimeDim(timeDimName); } else { return ((Cube) cube).getPartitionColumnOfTimeDim(timeDimName); } }
private static String getTimeDimOfPartitionColumn(CubeInterface cube, String partCol) { if (cube == null) { return partCol; } if (cube instanceof DerivedCube) { return ((DerivedCube) cube).getParent().getTimeDimOfPartitionColumn(partCol); } else { return ((Cube) cube).getTimeDimOfPartitionColumn(partCol); } }
public List<Segmentation> getAllSegmentations(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<Segmentation> cubeSegs = new ArrayList<>(); for (Segmentation seg : getAllSegmentations()) { if (cubeName == null || seg.getBaseCube().equalsIgnoreCase(cubeName)) { cubeSegs.add(seg); } } return cubeSegs; }
public List<Segmentation> getAllSegmentations(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<Segmentation> cubeSegs = new ArrayList<>(); for (Segmentation seg : getAllSegmentations()) { if (cubeName == null || seg.getBaseCube().equalsIgnoreCase(cubeName)) { cubeSegs.add(seg); } } return cubeSegs; }
/** * Get all fact tables of the cube. * * @param cube Cube object * @return List of fact tables * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts()) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
/** * Get all facts of cube (optional virtual facts) * * @param cube Cube object * @param includeVirtualFacts set true for virtual facts * @return List of fact tables with optional virtual facts * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube, boolean includeVirtualFacts) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts(includeVirtualFacts)) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
/** * Get all fact tables of the cube. * * @param cube Cube object * @return List of fact tables * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts()) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
/** * Get all facts of cube (optional virtual facts) * * @param cube Cube object * @param includeVirtualFacts set true for virtual facts * @return List of fact tables with optional virtual facts * @throws LensException */ public List<FactTable> getAllFacts(CubeInterface cube, boolean includeVirtualFacts) throws LensException { String cubeName = null; if (cube != null) { if (cube instanceof DerivedCube) { cube = ((DerivedCube) cube).getParent(); } cubeName = cube.getName(); } List<FactTable> cubeFacts = new ArrayList<>(); for (FactTable fact : getAllFacts(includeVirtualFacts)) { if (cubeName == null || fact.getCubeName().equalsIgnoreCase(cubeName)) { cubeFacts.add(fact); } } return cubeFacts; }
/** * Get all derived cubes of the cube, that have all fields queryable together * * @param cube Cube object * @return List of DerivedCube objects * @throws LensException */ public List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube) throws LensException { List<DerivedCube> dcubes = new ArrayList<>(); for (CubeInterface cb : getAllCubes()) { if (cb.isDerivedCube() && ((DerivedCube) cb).getParent().getName().equalsIgnoreCase(cube.getName()) && cb.allFieldsQueriable()) { dcubes.add((DerivedCube) cb); } } return dcubes; }
/** * Get all derived cubes of the cube, that have all fields queryable together * * @param cube Cube object * @return List of DerivedCube objects * @throws LensException */ public List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube) throws LensException { List<DerivedCube> dcubes = new ArrayList<>(); for (CubeInterface cb : getAllCubes()) { if (cb.isDerivedCube() && ((DerivedCube) cb).getParent().getName().equalsIgnoreCase(cube.getName()) && cb.allFieldsQueriable()) { dcubes.add((DerivedCube) cb); } } return dcubes; }
baseCube = (Cube) cube; } else { baseCube = ((DerivedCube) cube).getParent();
baseCube = (Cube) cube; } else { baseCube = ((DerivedCube) cube).getParent();
private void addAllDirectAttributesToFlattenedListFromCube(ObjectFactory objectFactory, CubeInterface cube, List<XFlattenedColumn> columnList) { AbstractBaseTable baseTbl = (AbstractBaseTable) (cube instanceof DerivedCube ? ((DerivedCube) cube).getParent() : cube); for (CubeDimAttribute dim : cube.getDimAttributes()) { XFlattenedColumn fcol = objectFactory.createXFlattenedColumn(); fcol.setDimAttribute(JAXBUtils.xDimAttrFromHiveDimAttr(dim, baseTbl)); fcol.setTableName(cube.getName()); columnList.add(fcol); } }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } DerivedCube other = (DerivedCube) obj; if (!this.getParent().equals(other.getParent())) { return false; } if (this.getMeasureNames() == null) { if (other.getMeasureNames() != null) { return false; } } else if (!this.getMeasureNames().equals(other.getMeasureNames())) { return false; } if (this.getDimAttributeNames() == null) { if (other.getDimAttributeNames() != null) { return false; } } else if (!this.getDimAttributeNames().equals(other.getDimAttributeNames())) { return false; } return true; }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } DerivedCube other = (DerivedCube) obj; if (!this.getParent().equals(other.getParent())) { return false; } if (this.getMeasureNames() == null) { if (other.getMeasureNames() != null) { return false; } } else if (!this.getMeasureNames().equals(other.getMeasureNames())) { return false; } if (this.getDimAttributeNames() == null) { if (other.getDimAttributeNames() != null) { return false; } } else if (!this.getDimAttributeNames().equals(other.getDimAttributeNames())) { return false; } return true; }
xdc.getMeasureNames().getMeasureName().addAll(c.getMeasureNames()); xdc.getDimAttrNames().getAttrName().addAll(c.getDimAttributeNames()); xdc.setParent(((DerivedCube) c).getParent().getName()); } else { XBaseCube xbc = XCF.createXBaseCube();