@Override public void addProperties() { super.addProperties(); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getDimAttributeListKey(getName()), attributes); setAttributedProperties(getProperties(), attributes); }
/** extract storage name and check in timeline cache for existance */ public boolean factPartitionExists(FactTable fact, FactPartition part, String storageTableName) throws HiveException, LensException { String storage = extractStorageName(fact, storageTableName); return partitionTimelineCache.partitionTimeExists(fact.getSourceFactName(), storage, part.getPeriod(), part.getPartCol(), part.getPartSpec()); }
@Override public void addProperties() { super.addProperties(); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getCubeMeasureListKey(getName()), measures); setMeasureProperties(getProperties(), measures); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getCubeDimensionListKey(getName()), dimensions); setDimensionProperties(getProperties(), dimensions); }
boolean latestPartitionExists(String factOrDimTblName, String storageName, String latestPartCol) throws HiveException, LensException { String storageTableName = MetastoreUtil.getStorageTableName(factOrDimTblName, Storage.getPrefix(storageName)); if (isDimensionTable(factOrDimTblName)) { return dimTableLatestPartitionExists(storageTableName); } else { return !partitionTimelineCache.noPartitionsExist(factOrDimTblName, storageName, latestPartCol); } }
@Override public void addProperties() { super.addProperties(); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getExpressionListKey(getName()), expressions); setExpressionProperties(getProperties(), expressions); MetastoreUtil.addNameStrings(getProperties(), getJoinChainListPropKey(getName()), joinChains); setJoinChainProperties(joinChains); }
private void mergeRanges() { for (int i = 0; i < ranges.size() - 1; i++) { if (ranges.get(i).getEnd().compareTo(ranges.get(i + 1).getBegin()) >= 0) { TimePartitionRange removed = ranges.remove(i + 1); ranges.get(i).setEnd(TimePartition.max(removed.getEnd(), ranges.get(i).getEnd())); i--; // check again at same index } else if (ranges.get(i).isEmpty()) { ranges.remove(i); i--; } } }
public void createStorage(Storage storage) throws LensException { checkIfAuthorized(); createCubeHiveTable(storage); // do a get to update cache getStorage(storage.getName()); }
@Override protected void addProperties() { super.addProperties(); addCubeName(getName(), getProperties(), cubeName); addSegmentProperties(getName(), getProperties(), segments); }
public void createStorage(Storage storage) throws LensException { createCubeHiveTable(storage); // do a get to update cache getStorage(storage.getName()); }
public CubeColumn getColumnByName(String column) { CubeColumn cubeCol = super.getExpressionByName(column); if (cubeCol == null) { cubeCol = getMeasureByName(column); if (cubeCol == null) { cubeCol = getDimAttributeByName(column); } } return cubeCol; }
/** * Create cube in metastore defined by {@link Cube} or {@link DerivedCube} object * * @param cube the {@link Cube} object. * @throws LensException */ public void createCube(CubeInterface cube) throws LensException { checkIfAuthorized(); createCubeHiveTable((AbstractCubeTable) cube); // do a get to update cache getCube(cube.getName()); }
public String getStorageTableName(String factOrDimTableName, String storage, UpdatePeriod updatePeriod) throws LensException { return MetastoreUtil.getFactOrDimtableStorageTableName(factOrDimTableName, getStorageTablePrefixFromStorage(factOrDimTableName, storage, updatePeriod)); } }
public CubeColumn getColumnByName(String column) { CubeColumn cubeCol = super.getExpressionByName(column); if (cubeCol == null) { cubeCol = getAttributeByName(column); } return cubeCol; }
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); } }
@Override public String toString() { String str = super.toString(); str += ", hierarchy:" + MetastoreUtil.getObjectStr(hierarchy); return str; } }
boolean latestPartitionExists(String factOrDimTblName, String storageName, String latestPartCol) throws HiveException, LensException { String storageTableName = MetastoreUtil.getStorageTableName(factOrDimTblName, Storage.getPrefix(storageName)); if (isDimensionTable(factOrDimTblName)) { return dimTableLatestPartitionExists(storageTableName); } else { return !partitionTimelineCache.noPartitionsExist(factOrDimTblName, storageName, latestPartCol); } }
@Override public void addProperties() { super.addProperties(); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getCubeMeasureListKey(getName()), measures); setMeasureProperties(getProperties(), measures); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getCubeDimensionListKey(getName()), dimensions); setDimensionProperties(getProperties(), dimensions); }
@Override public void addProperties() { super.addProperties(); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getExpressionListKey(getName()), expressions); setExpressionProperties(getProperties(), expressions); MetastoreUtil.addNameStrings(getProperties(), getJoinChainListPropKey(getName()), joinChains); setJoinChainProperties(joinChains); }
private void mergeRanges() { for (int i = 0; i < ranges.size() - 1; i++) { if (ranges.get(i).getEnd().compareTo(ranges.get(i + 1).getBegin()) >= 0) { TimePartitionRange removed = ranges.remove(i + 1); ranges.get(i).setEnd(TimePartition.max(removed.getEnd(), ranges.get(i).getEnd())); i--; // check again at same index } else if (ranges.get(i).isEmpty()) { ranges.remove(i); i--; } } }
/** extract storage name and check in timeline cache for existance */ public boolean factPartitionExists(FactTable fact, FactPartition part, String storageTableName) throws HiveException, LensException { String storage = extractStorageName(fact, storageTableName); return partitionTimelineCache.partitionTimeExists(fact.getSourceFactName(), storage, part.getPeriod(), part.getPartCol(), part.getPartSpec()); }