@Test(priority = 2) public void testGetXFactTable() throws Exception { List<FieldSchema> factColumns = new ArrayList<>(cubeMeasures.size()); for (CubeMeasure measure : cubeMeasures) { factColumns.add(measure.getColumn()); } factColumns.add(new FieldSchema("zipcode", "int", "zip")); FieldSchema itPart = new FieldSchema("it", "string", "date part"); FieldSchema etPart = new FieldSchema("et", "string", "date part"); StorageTableDesc s1 = new StorageTableDesc(TextInputFormat.class, HiveIgnoreKeyTextOutputFormat.class, Lists.newArrayList(getDatePartition(), itPart, etPart), Lists.newArrayList(getDatePartitionKey(), itPart.getName(), etPart.getName())); Set<UpdatePeriod> c1Storage = new HashSet<UpdatePeriod>(); c1Storage.add(HOURLY); Map<String, Set<UpdatePeriod>> updatePeriods = new HashMap<String, Set<UpdatePeriod>>(); updatePeriods.put(c1, c1Storage); Map<String, StorageTableDesc> storageTableDescs = getHashMap("HOURLY_c1", s1); Map<UpdatePeriod, String> updatePeriodMap = new HashMap<>(); updatePeriodMap.put(HOURLY, HOURLY.toString() + "_" + c1); Map<String, Set<String>> storageTablePartitionColumns = new HashMap<String, Set<String>>(); storageTablePartitionColumns.put(c1, new HashSet<>()); Map<String, Map<UpdatePeriod, String>> storageUpdatePeriodMap = new HashMap<String, Map<UpdatePeriod, String>>(); storageUpdatePeriodMap.put(c1, updatePeriodMap); client.createCubeFactTable(CUBE_NAME_WITH_PROPS, X_FACT_NAME, factColumns, updatePeriods, 0.0d, new HashMap<String, String>(), storageTableDescs, storageUpdatePeriodMap, storageTablePartitionColumns); CubeFactTable cubeFact = new CubeFactTable(CUBE_NAME_WITH_PROPS, X_FACT_NAME, factColumns, updatePeriods, 0.0d, new HashMap<String, String>(), storageUpdatePeriodMap, new HashMap<String, Set<String>>()); XFact xfact = client.getXFactTable(cubeFact); assertEquals(xfact.getCubeName(), CUBE_NAME_WITH_PROPS); assertEquals(xfact.getName(), X_FACT_NAME.toLowerCase()); }
public XFact getXFactTable(String tableName) throws LensException { return getXFactTable(getFactTable(tableName)); }
CubeMetastoreClient { public XFact getXFactTable(String tableName) throws LensException { return getXFactTable(getFactTable(tableName)); } }
CubeMetastoreClient { public XFact getXFactTable(String tableName) throws LensException { return getXFactTable(getFactTable(tableName)); } private  CubeMetastoreClient(HiveConf conf); }
CubeMetastoreClient { public XFact getXFactTable(String tableName) throws LensException { return getXFactTable(getFactTable(tableName)); } private  CubeMetastoreClient(HiveConf conf); DataCompletenessChecker getCompletenessChecker(); boolean isDataCompletenessCheckEnabled(); Date getLatestDateOfCube(Cube cube, String timeDimension); void clearHiveTableCache(); List<PartitionTimeline> getTimelines(String factName, String storage, String updatePeriodStr,
    String timeDimension); void updatePartition(String fact, String storageName, Partition partition, UpdatePeriod updatePeriod); void updatePartitions(String factOrDimtableName, String storageName,
    Map<UpdatePeriod, List<Partition>> partitions); boolean isLensQueryableTable(String tableName); void verifyStorageExists(AbstractCubeTable cdt, String storage); void createCubeFactTable(String cubeName, String factName, List<FieldSchema> columns,
    Map<String, Set<UpdatePeriod>> storageAggregatePeriods, double weight, Map<String, String> properties,
    Map<String, StorageTableDesc> storageTableDescs, Map<String, Map<UpdatePeriod, String>> storageUpdatePeriodMap,
    Map<String, Set<String>> storageTablePartitionColumns); void createEntity(T entity); void updateEntity(String name, T entity); static Map<String, String> addFactColStartTimePropertyToFactProperties(XFactTable fact); void createFactTable(XFact fact); void createVirtualFactTable(String cubeName, String virtualFactName, String sourceFactName, Double weight,
    Map<String, String> properties); static CubeMetastoreClient getInstance(HiveConf conf); HiveConf getConf(); static void close(); void createStorage(XStorage storage); void createStorage(Storage storage); void createCube(XCube cube); void createCube(CubeInterface cube); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions,
    Map<String, String> properties); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions,
    Set<ExprColumn> expressions, Map<String, String> properties); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions,
    Set<ExprColumn> expressions, Set<JoinChain> chains, Map<String, String> properties); void createDimension(String name, Set<CubeDimAttribute> attributes, Map<String, String> properties,
    double weight); void createDimension(XDimension dim); void createDimension(Dimension dim); void createDerivedCube(String parent, String name, Set<String> measures, Set<String> dimensions,
    Map<String, String> properties, double weight); void createCubeFactTable(String cubeName, String factName, List<FieldSchema> columns,
    Map<String, Set<UpdatePeriod>> storageAggregatePeriods, double weight, Map<String, String> properties,
    Map<String, StorageTableDesc> storageTableDescs); void createSegmentation(String baseCubeName, String segmentationName, Set<Segment> segments,
    double weight, Map<String, String> properties); void createCubeDimensionTable(XDimensionTable xDimTable); void createCubeDimensionTable(String dimName, String dimTblName, List<FieldSchema> columns, double weight,
    Set<String> storageNames, Map<String, String> properties, Map<String, StorageTableDesc> storageTableDescs); void createCubeDimensionTable(String dimName, String dimTblName, List<FieldSchema> columns, double weight,
    Map<String, UpdatePeriod> dumpPeriods, Map<String, String> properties,
    Map<String, StorageTableDesc> storageTableDescs); void createCubeTable(AbstractCubeTable cubeTable, Map<String, StorageTableDesc> storageTableDescs); void createSegmentation(XSegmentation cubeSeg); void createSegmentation(Segmentation cubeSeg); void addStorage(CubeFactTable fact, String storage, Set<UpdatePeriod> updatePeriods,
    Map<String, StorageTableDesc> storageTableDescs, Map<UpdatePeriod, String> updatePeriodStoragePrefix); void addStorage(CubeDimensionTable dim, String storage, UpdatePeriod dumpPeriod,
    StorageTableDesc storageTableDesc); List<Partition> addPartition(StoragePartitionDesc partSpec, String storageName, CubeTableType type); List<Partition> addPartitions(List<StoragePartitionDesc> storagePartitionDescs, String storageName,
    CubeTableType type); Date getStorageTableStartDate(String storageTable, FactTable factTableName); Date getStorageTableEndDate(String storageTable, FactTable factTableName); void dropPartition(String cubeTableName, String storageName, Map<String, Date> timePartSpec,
    Map<String, String> nonTimePartSpec, UpdatePeriod updatePeriod); boolean tableExists(String tblName); boolean factPartitionExists(FactTable fact, FactPartition part, String storageTableName); boolean factPartitionExists(String factName, String storageName, UpdatePeriod updatePeriod,
    Map<String, Date> partitionTimestamp,
    Map<String, String> partSpec); boolean partitionExists(String storageTableName, UpdatePeriod updatePeriod,
    Map<String, Date> partitionTimestamps); boolean partitionExistsByFilter(String cubeTableName, String storageName, UpdatePeriod updatePeriod,
    String filter); boolean partitionExistsByFilter(String storageTableName, String filter); List<Partition> getAllParts(String storageTableName); Partition getPartitionByFilter(String storageTableName, String filter); List<Partition> getPartitionsByFilter(String storageTableName, String filter); boolean dimTableLatestPartitionExists(String storageTableName); Table getHiveTable(String tableName); List<String> getTimePartColNamesOfTable(String storageTableName); List<String> getTimePartColNamesOfTable(Table table); Table getTableWithTypeFailFast(String tableName, CubeTableType type); Table getTableWithType(String tableName, CubeTableType type, boolean throwException); Table getTable(String tableName); Table getTable(String tableName, boolean throwException); void dropHiveTable(String table); boolean isFactTable(String tableName); boolean isVirtualFactTable(String virtualTableName); boolean isDimensionTable(String tableName); boolean isCube(String tableName); boolean isDimension(String tableName); XFact getXFactTable(String tableName); XFact getXFactTable(FactTable ft); Segmentation getSegmentationTable(String tableName); XDimensionTable getXDimensionTable(String dimTable); XDimensionTable getXDimensionTable(CubeDimensionTable dimTable); CubeDimensionTable getDimensionTable(String tableName); Storage getStorage(String storageName); Storage getStorage(String storageName, boolean throwException); CubeInterface getCube(String tableName); Dimension getDimension(String tableName); FactTable getFactTable(String tableName); Segmentation getSegmentation(String segName); Segmentation getSegmentation(String segName, boolean throwException); Collection<CubeDimensionTable> getAllDimensionTables(); Collection<Storage> getAllStorages(); Collection<CubeInterface> getAllCubes(); Collection<Dimension> getAllDimensions(); Collection<FactTable> getAllFacts(); Collection<FactTable> getAllFacts(boolean includeVirtualFacts); Collection<Segmentation> getAllSegmentations(); List<FactTable> getAllFacts(CubeInterface cube); List<FactTable> getAllFacts(CubeInterface cube, boolean includeVirtualFacts); List<Segmentation> getAllSegmentations(CubeInterface cube); List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube); List<CubeDimensionTable> getAllDimensionTables(Dimension dim); boolean partColExists(FactTable factTable, String storage, String partCol); Set<String> getStorageTables(FactTable factTable, String storage); void pushHiveTable(Table hiveTable); void alterHiveTable(String table, Table hiveTable); void alterCube(XCube cube); void alterCube(String cubeName, CubeInterface cube); void alterDimension(XDimension newDim); void alterDimension(String dimName, Dimension newDim); void alterStorage(XStorage storage); void alterStorage(String storageName, Storage storage); void dropStorage(String storageName); void dropCube(String cubeName); void dropDimension(String dimName); void dropFact(String factName, boolean cascade); void dropVirtualFact(String virtualFactName); void dropSegmentation(String segName); void dropStorageFromFact(String factName, String storage); void dropStorageFromDim(String dimTblName, String storage); void dropDimensionTable(String dimTblName, boolean cascade); void alterCubeFactTable(XFact fact); void alterCubeFactTable(String factTableName, FactTable cubeFactTable,
    Map<String, StorageTableDesc> storageTableDescs,
    Map<String, String> props); void alterSegmentation(XSegmentation cubeSeg); void alterVirtualCubeFactTable(CubeVirtualFactTable cubeVirtualFactTable); void alterSegmentation(String segName, Segmentation seg); CubeFactTable getCubeFactTable(String factName); CubeVirtualFactTable getCubeVirtualFactTable(String factName); void alterCubeDimensionTable(XDimensionTable dimensionTable); void alterCubeDimensionTable(String dimTableName, CubeDimensionTable cubeDimensionTable,
    Map<String, StorageTableDesc> storageTableDescs); boolean isStorageTableCandidateForRange(String storageTableName, Date fromDate, Date toDate); boolean isStorageTablePartitionACandidate(String storageTableName, Date partDate); boolean isStorageTableCandidateForRange(String storageTableName, String fromDate, String toDate); String getStorageTableName(String factOrDimTableName, String storage, UpdatePeriod updatePeriod); }
CubeMetastoreClient { public XFact getXFactTable(String tableName) throws LensException { return getXFactTable(getFactTable(tableName)); } private  CubeMetastoreClient(HiveConf conf); DataCompletenessChecker getCompletenessChecker(); boolean isDataCompletenessCheckEnabled(); Date getLatestDateOfCube(Cube cube, String timeDimension); void clearHiveTableCache(); List<PartitionTimeline> getTimelines(String factName, String storage, String updatePeriodStr,
    String timeDimension); void updatePartition(String fact, String storageName, Partition partition, UpdatePeriod updatePeriod); void updatePartitions(String factOrDimtableName, String storageName,
    Map<UpdatePeriod, List<Partition>> partitions); boolean isLensQueryableTable(String tableName); void verifyStorageExists(AbstractCubeTable cdt, String storage); void createCubeFactTable(String cubeName, String factName, List<FieldSchema> columns,
    Map<String, Set<UpdatePeriod>> storageAggregatePeriods, double weight, Map<String, String> properties,
    Map<String, StorageTableDesc> storageTableDescs, Map<String, Map<UpdatePeriod, String>> storageUpdatePeriodMap,
    Map<String, Set<String>> storageTablePartitionColumns); void createEntity(T entity); void updateEntity(String name, T entity); static Map<String, String> addFactColStartTimePropertyToFactProperties(XFactTable fact); void createFactTable(XFact fact); void createVirtualFactTable(String cubeName, String virtualFactName, String sourceFactName, Double weight,
    Map<String, String> properties); static CubeMetastoreClient getInstance(HiveConf conf); HiveConf getConf(); static void close(); void createStorage(XStorage storage); void createStorage(Storage storage); void createCube(XCube cube); void createCube(CubeInterface cube); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions,
    Map<String, String> properties); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions,
    Set<ExprColumn> expressions, Map<String, String> properties); void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions,
    Set<ExprColumn> expressions, Set<JoinChain> chains, Map<String, String> properties); void createDimension(String name, Set<CubeDimAttribute> attributes, Map<String, String> properties,
    double weight); void createDimension(XDimension dim); void createDimension(Dimension dim); void createDerivedCube(String parent, String name, Set<String> measures, Set<String> dimensions,
    Map<String, String> properties, double weight); void createCubeFactTable(String cubeName, String factName, List<FieldSchema> columns,
    Map<String, Set<UpdatePeriod>> storageAggregatePeriods, double weight, Map<String, String> properties,
    Map<String, StorageTableDesc> storageTableDescs); void createSegmentation(String baseCubeName, String segmentationName, Set<Segment> segments,
    double weight, Map<String, String> properties); void createCubeDimensionTable(XDimensionTable xDimTable); void createCubeDimensionTable(String dimName, String dimTblName, List<FieldSchema> columns, double weight,
    Set<String> storageNames, Map<String, String> properties, Map<String, StorageTableDesc> storageTableDescs); void createCubeDimensionTable(String dimName, String dimTblName, List<FieldSchema> columns, double weight,
    Map<String, UpdatePeriod> dumpPeriods, Map<String, String> properties,
    Map<String, StorageTableDesc> storageTableDescs); void createCubeTable(AbstractCubeTable cubeTable, Map<String, StorageTableDesc> storageTableDescs); void createSegmentation(XSegmentation cubeSeg); void createSegmentation(Segmentation cubeSeg); void addStorage(CubeFactTable fact, String storage, Set<UpdatePeriod> updatePeriods,
    Map<String, StorageTableDesc> storageTableDescs, Map<UpdatePeriod, String> updatePeriodStoragePrefix); void addStorage(CubeDimensionTable dim, String storage, UpdatePeriod dumpPeriod,
    StorageTableDesc storageTableDesc); List<Partition> addPartition(StoragePartitionDesc partSpec, String storageName, CubeTableType type); List<Partition> addPartitions(List<StoragePartitionDesc> storagePartitionDescs, String storageName,
    CubeTableType type); Date getStorageTableStartDate(String storageTable, FactTable factTableName); Date getStorageTableEndDate(String storageTable, FactTable factTableName); void dropPartition(String cubeTableName, String storageName, Map<String, Date> timePartSpec,
    Map<String, String> nonTimePartSpec, UpdatePeriod updatePeriod); boolean tableExists(String tblName); boolean factPartitionExists(FactTable fact, FactPartition part, String storageTableName); boolean factPartitionExists(String factName, String storageName, UpdatePeriod updatePeriod,
    Map<String, Date> partitionTimestamp,
    Map<String, String> partSpec); boolean partitionExists(String storageTableName, UpdatePeriod updatePeriod,
    Map<String, Date> partitionTimestamps); boolean partitionExistsByFilter(String cubeTableName, String storageName, UpdatePeriod updatePeriod,
    String filter); boolean partitionExistsByFilter(String storageTableName, String filter); List<Partition> getAllParts(String storageTableName); Partition getPartitionByFilter(String storageTableName, String filter); List<Partition> getPartitionsByFilter(String storageTableName, String filter); boolean dimTableLatestPartitionExists(String storageTableName); Table getHiveTable(String tableName); List<String> getTimePartColNamesOfTable(String storageTableName); List<String> getTimePartColNamesOfTable(Table table); Table getTableWithTypeFailFast(String tableName, CubeTableType type); Table getTableWithType(String tableName, CubeTableType type, boolean throwException); Table getTable(String tableName); Table getTable(String tableName, boolean throwException); void dropHiveTable(String table); boolean isFactTable(String tableName); boolean isVirtualFactTable(String virtualTableName); boolean isDimensionTable(String tableName); boolean isCube(String tableName); boolean isDimension(String tableName); XFact getXFactTable(String tableName); XFact getXFactTable(FactTable ft); Segmentation getSegmentationTable(String tableName); XDimensionTable getXDimensionTable(String dimTable); XDimensionTable getXDimensionTable(CubeDimensionTable dimTable); CubeDimensionTable getDimensionTable(String tableName); Storage getStorage(String storageName); Storage getStorage(String storageName, boolean throwException); CubeInterface getCube(String tableName); Dimension getDimension(String tableName); FactTable getFactTable(String tableName); Segmentation getSegmentation(String segName); Segmentation getSegmentation(String segName, boolean throwException); Collection<CubeDimensionTable> getAllDimensionTables(); Collection<Storage> getAllStorages(); Collection<CubeInterface> getAllCubes(); Collection<Dimension> getAllDimensions(); Collection<FactTable> getAllFacts(); Collection<FactTable> getAllFacts(boolean includeVirtualFacts); Collection<Segmentation> getAllSegmentations(); List<FactTable> getAllFacts(CubeInterface cube); List<FactTable> getAllFacts(CubeInterface cube, boolean includeVirtualFacts); List<Segmentation> getAllSegmentations(CubeInterface cube); List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube); List<CubeDimensionTable> getAllDimensionTables(Dimension dim); boolean partColExists(FactTable factTable, String storage, String partCol); Set<String> getStorageTables(FactTable factTable, String storage); void pushHiveTable(Table hiveTable); void alterHiveTable(String table, Table hiveTable); void alterCube(XCube cube); void alterCube(String cubeName, CubeInterface cube); void alterDimension(XDimension newDim); void alterDimension(String dimName, Dimension newDim); void alterStorage(XStorage storage); void alterStorage(String storageName, Storage storage); void dropStorage(String storageName); void dropCube(String cubeName); void dropDimension(String dimName); void dropFact(String factName, boolean cascade); void dropVirtualFact(String virtualFactName); void dropSegmentation(String segName); void dropStorageFromFact(String factName, String storage); void dropStorageFromDim(String dimTblName, String storage); void dropDimensionTable(String dimTblName, boolean cascade); void alterCubeFactTable(XFact fact); void alterCubeFactTable(String factTableName, FactTable cubeFactTable,
    Map<String, StorageTableDesc> storageTableDescs,
    Map<String, String> props); void alterSegmentation(XSegmentation cubeSeg); void alterVirtualCubeFactTable(CubeVirtualFactTable cubeVirtualFactTable); void alterSegmentation(String segName, Segmentation seg); CubeFactTable getCubeFactTable(String factName); CubeVirtualFactTable getCubeVirtualFactTable(String factName); void alterCubeDimensionTable(XDimensionTable dimensionTable); void alterCubeDimensionTable(String dimTableName, CubeDimensionTable cubeDimensionTable,
    Map<String, StorageTableDesc> storageTableDescs); boolean isStorageTableCandidateForRange(String storageTableName, Date fromDate, Date toDate); boolean isStorageTablePartitionACandidate(String storageTableName, Date partDate); boolean isStorageTableCandidateForRange(String storageTableName, String fromDate, String toDate); String getStorageTableName(String factOrDimTableName, String storage, UpdatePeriod updatePeriod);  }