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(); assertEquals(actualStarTreeSpec.getDimensionsSplitOrder(), expectedDimensionSplitOrder); assertEquals(actualStarTreeSpec.getMaxLeafRecords(), expectedMaxLeafRecords);
properties.setProperty(STAR_TREE_SPLIT_ORDER, starTreeIndexSpec.getDimensionsSplitOrder()); properties.setProperty(STAR_TREE_MAX_LEAF_RECORDS, starTreeIndexSpec.getMaxLeafRecords()); properties.setProperty(STAR_TREE_SKIP_STAR_NODE_CREATION_FOR_DIMENSIONS,
starTreeBuilderConfig.setOutDir(starTreeTempDir); starTreeBuilderConfig.setSchema(dataSchema); starTreeBuilderConfig.setDimensionsSplitOrder(starTreeIndexSpec.getDimensionsSplitOrder()); starTreeBuilderConfig.setSkipStarNodeCreationDimensions(starTreeIndexSpec.getSkipStarNodeCreationForDimensions()); starTreeBuilderConfig.setSkipMaterializationDimensions(starTreeIndexSpec.getSkipMaterializationForDimensions());