diff --git a/fe/fe-core/src/test/java/com/starrocks/statistic/StatisticsCollectJobTest.java b/fe/fe-core/src/test/java/com/starrocks/statistic/StatisticsCollectJobTest.java index 71d8c23367e1c..a87b53b00e25a 100644 --- a/fe/fe-core/src/test/java/com/starrocks/statistic/StatisticsCollectJobTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/statistic/StatisticsCollectJobTest.java @@ -1535,4 +1535,20 @@ public long getDataSize() { } } + @Test + public void testGetCollectibleColumns() throws Exception { + starRocksAssert.withTable("CREATE TABLE test.t_gen_col (" + + " c1 datetime NOT NULL," + + " c2 bigint," + + " c3 DATETIME NULL AS date_trunc('month', c1) " + + " ) " + + " DUPLICATE KEY(c1) " + + " PARTITION BY (c2, c3) " + + " PROPERTIES('replication_num'='1')"); + Table table = starRocksAssert.getTable("test", "t_gen_col"); + List cols = StatisticUtils.getCollectibleColumns(table); + Assert.assertTrue(cols.size() == 2); + Assert.assertTrue(!cols.contains("c3")); + starRocksAssert.dropTable("test.t_gen_col"); + } }