當前位置: 首頁>>代碼示例>>Java>>正文


Java Cuboid.getCuboidToGridTableMapping方法代碼示例

本文整理匯總了Java中org.apache.kylin.cube.cuboid.Cuboid.getCuboidToGridTableMapping方法的典型用法代碼示例。如果您正苦於以下問題:Java Cuboid.getCuboidToGridTableMapping方法的具體用法?Java Cuboid.getCuboidToGridTableMapping怎麽用?Java Cuboid.getCuboidToGridTableMapping使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.kylin.cube.cuboid.Cuboid的用法示例。


在下文中一共展示了Cuboid.getCuboidToGridTableMapping方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SegmentCubeTupleIterator

import org.apache.kylin.cube.cuboid.Cuboid; //導入方法依賴的package包/類
public SegmentCubeTupleIterator(CubeSegmentScanner scanner, Cuboid cuboid, Set<TblColRef> selectedDimensions, //
        Set<FunctionDesc> selectedMetrics, TupleInfo returnTupleInfo, StorageContext context) {
    this.scanner = scanner;
    this.cuboid = cuboid;
    this.selectedDimensions = selectedDimensions;
    this.selectedMetrics = selectedMetrics;
    this.tupleInfo = returnTupleInfo;
    this.tuple = new Tuple(returnTupleInfo);
    this.context = context;

    CuboidToGridTableMapping mapping = cuboid.getCuboidToGridTableMapping();
    int[] gtDimsIdx = mapping.getDimIndexes(selectedDimensions);
    int[] gtMetricsIdx = mapping.getMetricsIndexes(selectedMetrics);
    // gtColIdx = gtDimsIdx + gtMetricsIdx
    int[] gtColIdx = new int[gtDimsIdx.length + gtMetricsIdx.length];
    System.arraycopy(gtDimsIdx, 0, gtColIdx, 0, gtDimsIdx.length);
    System.arraycopy(gtMetricsIdx, 0, gtColIdx, gtDimsIdx.length, gtMetricsIdx.length);

    this.gtValues = getGTValuesIterator(scanner.iterator(), scanner.getScanRequest(), gtDimsIdx, gtMetricsIdx);
    this.cubeTupleConverter = ((GTCubeStorageQueryBase) context.getStorageQuery()).newCubeTupleConverter(
            scanner.cubeSeg, cuboid, selectedDimensions, selectedMetrics, gtColIdx, tupleInfo);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:23,代碼來源:SegmentCubeTupleIterator.java

示例2: CubeScanRangePlanner

import org.apache.kylin.cube.cuboid.Cuboid; //導入方法依賴的package包/類
public CubeScanRangePlanner(CubeSegment cubeSegment, Cuboid cuboid, TupleFilter filter, Set<TblColRef> dimensions, Set<TblColRef> groupByDims, //
                            Collection<FunctionDesc> metrics, TupleFilter havingFilter, StorageContext context) {
    this.context = context;

    this.maxScanRanges = cubeSegment.getConfig().getQueryStorageVisitScanRangeMax();
    this.maxFuzzyKeysPerSplit = cubeSegment.getConfig().getQueryScanFuzzyKeyMax();
    this.maxFuzzyKeys = maxFuzzyKeysPerSplit * cubeSegment.getConfig().getQueryScanFuzzyKeySplitMax();

    this.cubeSegment = cubeSegment;
    this.cubeDesc = cubeSegment.getCubeDesc();
    this.cuboid = cuboid;

    Set<TblColRef> filterDims = Sets.newHashSet();
    TupleFilter.collectColumns(filter, filterDims);

    this.gtInfo = CubeGridTable.newGTInfo(cuboid, new CubeDimEncMap(cubeSegment));
    CuboidToGridTableMapping mapping = cuboid.getCuboidToGridTableMapping();

    IGTComparator comp = gtInfo.getCodeSystem().getComparator();
    //start key GTRecord compare to start key GTRecord
    this.rangeStartComparator = RecordComparators.getRangeStartComparator(comp);
    //stop key GTRecord compare to stop key GTRecord
    this.rangeEndComparator = RecordComparators.getRangeEndComparator(comp);
    //start key GTRecord compare to stop key GTRecord
    this.rangeStartEndComparator = RecordComparators.getRangeStartEndComparator(comp);

    //replace the constant values in filter to dictionary codes
    Set<TblColRef> groupByPushDown = Sets.newHashSet(groupByDims);
    this.gtFilter = GTUtil.convertFilterColumnsAndConstants(filter, gtInfo, mapping.getCuboidDimensionsInGTOrder(), groupByPushDown);
    this.havingFilter = havingFilter;

    this.gtDimensions = mapping.makeGridTableColumns(dimensions);
    this.gtAggrGroups = mapping.makeGridTableColumns(replaceDerivedColumns(groupByPushDown, cubeSegment.getCubeDesc()));
    this.gtAggrMetrics = mapping.makeGridTableColumns(metrics);
    this.gtAggrFuncs = mapping.makeAggrFuncs(metrics);

    if (cubeSegment.getModel().getPartitionDesc().isPartitioned()) {
        int index = mapping.getIndexOf(cubeSegment.getModel().getPartitionDesc().getPartitionDateColumnRef());
        if (index >= 0) {
            SegmentGTStartAndEnd segmentGTStartAndEnd = new SegmentGTStartAndEnd(cubeSegment, gtInfo);
            this.gtStartAndEnd = segmentGTStartAndEnd.getSegmentStartAndEnd(index);
            this.isPartitionColUsingDatetimeEncoding = segmentGTStartAndEnd.isUsingDatetimeEncoding(index);
            this.gtPartitionCol = gtInfo.colRef(index);
        }
    }
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:47,代碼來源:CubeScanRangePlanner.java


注:本文中的org.apache.kylin.cube.cuboid.Cuboid.getCuboidToGridTableMapping方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。