public static StarTreeIndexSpec fromStarTreeMetadata(StarTreeMetadata starTreeMetadata) { StarTreeIndexSpec starTreeIndexSpec = new StarTreeIndexSpec(); starTreeIndexSpec.setMaxLeafRecords(starTreeMetadata.getMaxLeafRecords()); starTreeIndexSpec.setDimensionsSplitOrder(starTreeMetadata.getDimensionsSplitOrder()); starTreeIndexSpec .setSkipStarNodeCreationForDimensions(Sets.newHashSet(starTreeMetadata.getSkipStarNodeCreationForDimensions())); starTreeIndexSpec .setSkipMaterializationForDimensions(Sets.newHashSet(starTreeMetadata.getSkipMaterializationForDimensions())); starTreeIndexSpec.setSkipMaterializationCardinalityThreshold(starTreeMetadata.getSkipMaterializationCardinality()); return starTreeIndexSpec; }
expectedStarTreeSpec.setSkipStarNodeCreationForDimensions(expectedSkipStarNodeCreationForDimension);
private void setupSegment(File segmentDir) throws Exception { final String filePath = TestUtils.getFileFromResourceUrl(getClass().getClassLoader().getResource(AVRO_DATA)); if (segmentDir.exists()) { FileUtils.deleteQuietly(segmentDir); } final SegmentGeneratorConfig config = SegmentTestUtils .getSegmentGenSpecWithSchemAndProjectedColumns(new File(filePath), segmentDir, "time_day", TimeUnit.DAYS, TABLE_NAME); config.setTableName(TABLE_NAME); config.setSegmentName(SEGMENT_NAME); StarTreeIndexSpec starTreeIndexSpec = new StarTreeIndexSpec(); starTreeIndexSpec.setDimensionsSplitOrder(DIMENSIONS_SPLIT_ORDER); starTreeIndexSpec.setMaxLeafRecords(MAX_LEAF_RECORDS); starTreeIndexSpec.setSkipMaterializationCardinalityThreshold(SKIP_CARDINALITY_THRESHOLD); starTreeIndexSpec.setSkipStarNodeCreationForDimensions(SKIP_STAR_NODE_CREATION_DIMENSTIONS); starTreeIndexSpec.setSkipMaterializationForDimensions(SKIP_MATERIALIZATION_DIMENSIONS); config.enableStarTreeIndex(starTreeIndexSpec); final SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null); driver.init(config); driver.build(); }
starTreeIndexSpec.setSkipMaterializationCardinalityThreshold(1); starTreeIndexSpec.setSkipMaterializationForDimensions(dims); starTreeIndexSpec.setSkipStarNodeCreationForDimensions(dims);