StarTreeIndexSpec starTreeIndexSpec = _indexingConfig.getStarTreeIndexSpec(); List<String> invertedIndexColumns = _indexingConfig.getInvertedIndexColumns();
StarTreeIndexSpec starTreeIndexSpec = indexingConfig.getStarTreeIndexSpec(); if (starTreeIndexSpec != null) { enableStarTreeIndex(starTreeIndexSpec);
/** * Helper function to trigger the segment creation * * TODO: Support all kinds of indexing (no dictionary) */ private void buildSegment(String outputPath, String tableName, String segmentName, RecordReader recordReader, IndexingConfig indexingConfig) throws Exception { SegmentGeneratorConfig segmentGeneratorConfig = new SegmentGeneratorConfig(recordReader.getSchema()); segmentGeneratorConfig.setOutDir(outputPath); segmentGeneratorConfig.setTableName(tableName); segmentGeneratorConfig.setSegmentName(segmentName); if (indexingConfig != null) { segmentGeneratorConfig.setInvertedIndexCreationColumns(indexingConfig.getInvertedIndexColumns()); if (indexingConfig.getStarTreeIndexSpec() != null) { segmentGeneratorConfig.enableStarTreeIndex(indexingConfig.getStarTreeIndexSpec()); } } SegmentIndexCreationDriverImpl driver = new SegmentIndexCreationDriverImpl(); driver.init(segmentGeneratorConfig, recordReader); driver.build(); }
private void checkTableConfigWithStarTreeConfig(TableConfig tableConfig, TableConfig tableConfigToCompare) throws Exception { // Check that the segment assignment configuration does exist. Assert.assertEquals(tableConfigToCompare.getTableName(), tableConfig.getTableName()); Assert.assertNotNull(tableConfigToCompare.getIndexingConfig().getStarTreeIndexSpec()); // Check that the configurations are correct. StarTreeIndexSpec starTreeIndexSpec = tableConfigToCompare.getIndexingConfig().getStarTreeIndexSpec(); Set<String> dims = new HashSet<>(); dims.add("dims"); Assert.assertEquals(starTreeIndexSpec.getDimensionsSplitOrder(), Collections.singletonList("dim")); Assert.assertEquals(starTreeIndexSpec.getMaxLeafRecords(), 5); Assert.assertEquals(starTreeIndexSpec.getSkipMaterializationCardinalityThreshold(), 1); Assert.assertEquals(starTreeIndexSpec.getSkipMaterializationForDimensions(), dims); Assert.assertEquals(starTreeIndexSpec.getSkipStarNodeCreationForDimensions(), dims); starTreeIndexSpec = StarTreeIndexSpec.fromJsonString(starTreeIndexSpec.toJsonString()); Assert.assertEquals(starTreeIndexSpec.getDimensionsSplitOrder(), Collections.singletonList("dim")); Assert.assertEquals(starTreeIndexSpec.getMaxLeafRecords(), 5); Assert.assertEquals(starTreeIndexSpec.getSkipMaterializationCardinalityThreshold(), 1); Assert.assertEquals(starTreeIndexSpec.getSkipMaterializationForDimensions(), dims); Assert.assertEquals(starTreeIndexSpec.getSkipStarNodeCreationForDimensions(), dims); }
StarTreeIndexSpec actualStarTreeSpec = actualIndexingConfig.getStarTreeIndexSpec();
_starTreeIndexSpec = indexingConfig.getStarTreeIndexSpec();