当前位置: 首页>>代码示例>>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;未经允许,请勿转载。