public class CubeFactTable extends AbstractCubeTable implements FactTable
Constructor and Description |
---|
CubeFactTable(String cubeName,
String factName,
List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
Map<String,Set<UpdatePeriod>> storageUpdatePeriods) |
CubeFactTable(String cubeName,
String factName,
List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
Map<String,Set<UpdatePeriod>> storageUpdatePeriods,
double weight) |
CubeFactTable(String cubeName,
String factName,
List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
Map<String,Set<UpdatePeriod>> storageUpdatePeriods,
double weight,
Map<String,String> properties) |
CubeFactTable(String cubeName,
String factName,
List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
Map<String,Set<UpdatePeriod>> storageUpdatePeriods,
double weight,
Map<String,String> properties,
Map<String,Map<UpdatePeriod,String>> storagePrefixUpdatePeriodMap) |
CubeFactTable(org.apache.hadoop.hive.ql.metadata.Table hiveTable) |
Modifier and Type | Method and Description |
---|---|
void |
addColumns(Collection<org.apache.hadoop.hive.metastore.api.FieldSchema> columns)
Adds or alters the columns passed
|
void |
addUpdatePeriod(String storage,
UpdatePeriod period)
Add update period to storage
|
void |
alterColumn(org.apache.hadoop.hive.metastore.api.FieldSchema column)
Alters the column if already existing or just adds it if it is new column
|
void |
alterCubeName(String cubeName)
Alter the cubeName to which this fact belongs
|
void |
alterStorage(String storage,
Set<UpdatePeriod> updatePeriods)
Alter a storage with specified update periods
|
boolean |
equals(Object obj) |
Date |
getAbsoluteEndTime()
Absolute end time of the fact
|
Date |
getAbsoluteStartTime()
Absolute start time of the fact
|
String |
getCubeName()
Cube to which this fact belongs to
|
String |
getDataCompletenessTag()
tag for checking data completeness
|
Date |
getEndTime()
End time of the fact
|
List<String> |
getPartitions(Date fromDate,
Date toDate,
UpdatePeriod interval)
Get partition value strings for given range, for the specified updateInterval
|
Date |
getRelativeEndTime()
Relative End time of the Fact
|
Date |
getRelativeStartTime()
Relative start time of the fact
|
String |
getSourceFactName()
Storage name of the fact
|
Date |
getStartTime()
Start time of the fact
|
Map<String,Map<UpdatePeriod,String>> |
getStoragePrefixUpdatePeriodMap() |
Set<String> |
getStorages()
The set of Storage names
|
String |
getTablePrefix(String storage,
UpdatePeriod updatePeriod) |
CubeTableType |
getTableType()
The type of the fact
|
Map<String,Set<UpdatePeriod>> |
getUpdatePeriods()
Get map of storage to update period mapping
|
Set<String> |
getValidColumns()
Return valid columns of the fact, which can be specified by property MetastoreUtil.getValidColumnsKey(getName())
|
boolean |
hasColumn(String column) |
int |
hashCode() |
boolean |
isAggregated()
Is Aggregated Fact
|
boolean |
isVirtualFact()
Is Virtual Fact
|
static UpdatePeriod |
maxIntervalInRange(Date from,
Date to,
Set<UpdatePeriod> updatePeriods)
Get the max update period for the given range and available update periods
|
void |
removeUpdatePeriod(String storage,
UpdatePeriod period)
Remove update period from storage
|
void |
setAggregated(boolean isAggregated) |
addProperties, alterWeight, getAllFieldNames, getColumns, getName, getProperties, getWeight, now, removeProperty, toString, weight
getAllFieldNames, getColumns, getProperties, weight
public CubeFactTable(org.apache.hadoop.hive.ql.metadata.Table hiveTable)
public CubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageUpdatePeriods)
public CubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageUpdatePeriods, double weight)
public CubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageUpdatePeriods, double weight, Map<String,String> properties)
public boolean hasColumn(String column)
public Map<String,Set<UpdatePeriod>> getUpdatePeriods()
FactTable
getUpdatePeriods
in interface FactTable
public int hashCode()
hashCode
in class AbstractCubeTable
public boolean equals(Object obj)
equals
in class AbstractCubeTable
public CubeTableType getTableType()
FactTable
getTableType
in interface FactTable
getTableType
in class AbstractCubeTable
CubeTableType
public List<String> getPartitions(Date fromDate, Date toDate, UpdatePeriod interval)
fromDate
- toDate
- interval
- public static UpdatePeriod maxIntervalInRange(Date from, Date to, Set<UpdatePeriod> updatePeriods)
from
- to
- updatePeriods
- public Set<String> getStorages()
FactTable
getStorages
in interface FactTable
getStorages
in class AbstractCubeTable
public String getCubeName()
FactTable
getCubeName
in interface FactTable
public Set<String> getValidColumns()
getValidColumns
in interface FactTable
public void addUpdatePeriod(String storage, UpdatePeriod period)
storage
- period
- public void removeUpdatePeriod(String storage, UpdatePeriod period)
storage
- period
- public void alterStorage(String storage, Set<UpdatePeriod> updatePeriods) throws LensException
storage
- updatePeriods
- LensException
public void alterColumn(org.apache.hadoop.hive.metastore.api.FieldSchema column)
AbstractCubeTable
column
- The column spec as FieldSchema - name, type and a commentpublic void addColumns(Collection<org.apache.hadoop.hive.metastore.api.FieldSchema> columns)
AbstractCubeTable
columns
- The collection of columnspublic void alterCubeName(String cubeName)
cubeName
- public String getDataCompletenessTag()
FactTable
getDataCompletenessTag
in interface FactTable
public boolean isAggregated()
FactTable
isAggregated
in interface FactTable
public void setAggregated(boolean isAggregated)
public boolean isVirtualFact()
FactTable
isVirtualFact
in interface FactTable
public String getSourceFactName()
FactTable
getSourceFactName
in interface FactTable
public String getTablePrefix(String storage, UpdatePeriod updatePeriod)
public Date getAbsoluteStartTime()
FactTable
getAbsoluteStartTime
in interface FactTable
Date
public Date getRelativeStartTime()
FactTable
getRelativeStartTime
in interface FactTable
Date
public Date getStartTime()
FactTable
getStartTime
in interface FactTable
Date
public Date getAbsoluteEndTime()
FactTable
getAbsoluteEndTime
in interface FactTable
Date
public Date getRelativeEndTime()
FactTable
getRelativeEndTime
in interface FactTable
Date
public Date getEndTime()
FactTable
getEndTime
in interface FactTable
Date
@Generated(value="lombok") public Map<String,Map<UpdatePeriod,String>> getStoragePrefixUpdatePeriodMap()
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.