@@ -108,22 +108,32 @@ suite("test_tsd_index_drop_bf") {
108108 ALTER TABLE ${ tableName}
109109 SET ("bloom_filter_columns" = "")
110110 """
111+
112+ // Insert more data in parallel, to create the shadow index.
113+ def num_values = insert_num
114+ insert_num * = 2
115+ for (int index = num_values; index < insert_num; index++ ) {
116+ sql """
117+ INSERT INTO ${ tableName} VALUES (1, ${ index} , 'user_${ index} ', 'data_${ index} ')
118+ """
119+ }
111120 sql " sync"
112121
113122 // Verify bloom filter was removed upstream
114123 assertTrue (helper. checkShowTimesOf("""
115124 SHOW CREATE TABLE ${ context.dbName} .${ tableName}
116- """ ,
125+ """ ,
117126 noBloomFilter, 30 , " sql" ))
118127
119128 // 4. Insert more data after dropping bloom filter
120129 sql """
121130 INSERT INTO ${ tableName} VALUES
122- (1 , 100, "post_drop_user_1", "extra_data_1"),
123- (1 , 101, "post_drop_user_2", "extra_data_2"),
124- (1 , 102, "post_drop_unique", "extra_data_3")
131+ (2 , 100, "post_drop_user_1", "extra_data_1"),
132+ (2 , 101, "post_drop_user_2", "extra_data_2"),
133+ (2 , 102, "post_drop_unique", "extra_data_3")
125134 """
126135 sql " sync"
136+ insert_num + = 3
127137
128138 // Verify query still works without bloom filter
129139 assertTrue (helper. checkShowTimesOf(
@@ -137,7 +147,7 @@ suite("test_tsd_index_drop_bf") {
137147 // Check all data is synced
138148 assertTrue (helper. checkShowTimesOf(
139149 """ select * from ${ tableName} """ ,
140- has_count(insert_num + 3 ), 60 , " target" ))
150+ has_count(insert_num), 60 , " target" ))
141151
142152 // Check bloom filter is removed downstream
143153 assertTrue (helper. checkShowTimesOf("""
@@ -149,4 +159,14 @@ suite("test_tsd_index_drop_bf") {
149159 assertTrue (helper. checkShowTimesOf(
150160 """ select * from ${ tableName} where username = 'post_drop_unique' """ ,
151161 has_count(1 ), 30 , " target" ))
162+
163+ // Insert some more data to verify downstream is still functional
164+ sql """
165+ INSERT INTO ${ tableName} VALUES
166+ (3, 200, "final_user_1", "final_data_1"),
167+ (3, 201, "final_user_2", "final_data_2")
168+ """
169+ assertTrue (helper. checkShowTimesOf(
170+ """ select * from ${ tableName} """ ,
171+ has_count(insert_num + 2 ), 60 , " target" ))
152172}
0 commit comments