@@ -1632,6 +1632,31 @@ public void testValidateIndexingConfig() {
16321632 fail ("Should not fail for valid StarTreeIndex config column name" );
16331633 }
16341634
1635+ // Test using * as the column for the COUNT aggregation
1636+ starTreeIndexConfig =
1637+ new StarTreeIndexConfig (List .of ("myCol" ), List .of ("myCol" ), List .of ("COUNT__*" ), null , 1 );
1638+ tableConfig = new TableConfigBuilder (TableType .OFFLINE ).setTableName (TABLE_NAME )
1639+ .setStarTreeIndexConfigs (List .of (starTreeIndexConfig ))
1640+ .build ();
1641+ try {
1642+ TableConfigUtils .validate (tableConfig , schema );
1643+ } catch (Exception e ) {
1644+ fail ("Should not fail for valid StarTreeIndex function column pair with COUNT__*" );
1645+ }
1646+
1647+ // Test using * as the column for a non-COUNT aggregation
1648+ starTreeIndexConfig =
1649+ new StarTreeIndexConfig (List .of ("myCol" ), List .of ("myCol" ), List .of ("SUM__*" ), null , 1 );
1650+ tableConfig = new TableConfigBuilder (TableType .OFFLINE ).setTableName (TABLE_NAME )
1651+ .setStarTreeIndexConfigs (List .of (starTreeIndexConfig ))
1652+ .build ();
1653+ try {
1654+ TableConfigUtils .validate (tableConfig , schema );
1655+ fail ("Should not fail for invalid StarTreeIndex function column pair with SUM__*" );
1656+ } catch (Exception e ) {
1657+ // expected
1658+ }
1659+
16351660 starTreeIndexConfig = new StarTreeIndexConfig (List .of ("myCol2" ), List .of ("myCol" ), List .of ("SUM__myCol" ), null , 1 );
16361661 tableConfig = new TableConfigBuilder (TableType .OFFLINE ).setTableName (TABLE_NAME )
16371662 .setStarTreeIndexConfigs (List .of (starTreeIndexConfig ))
@@ -1690,6 +1715,29 @@ public void testValidateIndexingConfig() {
16901715 // expected
16911716 }
16921717
1718+ starTreeIndexConfig = new StarTreeIndexConfig (List .of ("myCol" ), null , null ,
1719+ List .of (new StarTreeAggregationConfig ("*" , "COUNT" )), 1 );
1720+ tableConfig = new TableConfigBuilder (TableType .OFFLINE ).setTableName (TABLE_NAME )
1721+ .setStarTreeIndexConfigs (List .of (starTreeIndexConfig ))
1722+ .build ();
1723+ try {
1724+ TableConfigUtils .validate (tableConfig , schema );
1725+ } catch (Exception e ) {
1726+ fail ("Should not fail for valid StarTreeIndex config with aggregation config for COUNT on '*' column" );
1727+ }
1728+
1729+ starTreeIndexConfig = new StarTreeIndexConfig (List .of ("myCol" ), null , null ,
1730+ List .of (new StarTreeAggregationConfig ("*" , "SUM" )), 1 );
1731+ tableConfig = new TableConfigBuilder (TableType .OFFLINE ).setTableName (TABLE_NAME )
1732+ .setStarTreeIndexConfigs (List .of (starTreeIndexConfig ))
1733+ .build ();
1734+ try {
1735+ TableConfigUtils .validate (tableConfig , schema );
1736+ fail ("Should fail for invalid StarTreeIndex config with aggregation config for SUM on '*' column" );
1737+ } catch (Exception e ) {
1738+ // expected
1739+ }
1740+
16931741 starTreeIndexConfig =
16941742 new StarTreeIndexConfig (List .of ("multiValCol" ), List .of ("multiValCol" ), List .of ("SUM__multiValCol" ), null , 1 );
16951743 tableConfig = new TableConfigBuilder (TableType .OFFLINE ).setTableName (TABLE_NAME )
0 commit comments