Package com.twilio.kudu.sql.mutation
Class CubeMaintainer
- java.lang.Object
-
- com.twilio.kudu.sql.mutation.CubeMaintainer
-
public class CubeMaintainer extends Object
Used to calculate aggregated values and upsert rows to the kudu cube tables
-
-
Constructor Summary
Constructors Constructor Description CubeMaintainer(CalciteKuduTable cubeCalciteKuduTable, CalciteKuduTable factCalciteKuduTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.kudu.util.Pair<Object[],Object[]>
generateCubeDelta(Map<Integer,Object> colIndexToValueMap)
Remaps the fact table columns to the cube table pk columns (dimensions) and the cube table non pk columns (measures) Also truncates the event time column to the cube rollup timeIterator<Integer>
gePKColumnIndexes()
long
getFloorMod()
TODO support month and yearIterator<Integer>
getNonPKColumnIndexes()
-
-
-
Constructor Detail
-
CubeMaintainer
public CubeMaintainer(CalciteKuduTable cubeCalciteKuduTable, CalciteKuduTable factCalciteKuduTable)
-
-
Method Detail
-
getFloorMod
public long getFloorMod()
TODO support month and year- Returns:
- the mod value used to truncate the timestamp
-
generateCubeDelta
public org.apache.kudu.util.Pair<Object[],Object[]> generateCubeDelta(Map<Integer,Object> colIndexToValueMap)
Remaps the fact table columns to the cube table pk columns (dimensions) and the cube table non pk columns (measures) Also truncates the event time column to the cube rollup time- Parameters:
colIndexToValueMap
- map from fact table column index to column value- Returns:
- pair of array of pk column values and array of non-pk column values
-
-