Skip to content

Commit

Permalink
fix unstable case
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Jan 8, 2025
1 parent b26aabe commit dc8fd62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

suite("partition_col_stats") {
suite("partition_col_stats", "p0, nonConcurrent") {
try {
multi_sql """
set global enable_partition_analyze=true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ suite("partition_key_minmax") {
)
distributed by hash(a) properties("replication_num"="1");
insert into rangetable values (5, 3, 0), (22, 150, 1), (333, 1, 2),(6, 1, 3);
insert into rangetable values (5, 3, 0),(6, 1, 3),(22, 150, 1),(333, 1, 2);
analyze table rangetable with sync;
"""
Expand All @@ -38,8 +38,14 @@ suite("partition_key_minmax") {
sql """memo plan
select * from rangetable where a < 250;
"""
containsAny("a#0 -> ndv=2.6667, min=5.000000(5), max=30.000000(30), count=2.6667")
containsAny("a#0 -> ndv=3, min=5.000000(5), max=30.000000(30), count=2.6667")
// case 1: partition col stats not available, partition row count not available
containsAny("a#0 -> ndv=2.6667, min=5.000000(5), max=30.000000(30)")
// case 2: partition col stats not available, partition row count available
containsAny("a#0 -> ndv=3.0000, min=5.000000(5), max=30.000000(30)")
// case 3: partition col stats available, partition row count not available
containsAny("a#0 -> ndv=2.6667, min=5.000000(5), max=22.000000(22)")
// case 4: partition col stats available, partition row count available
containsAny("a#0 -> ndv=3.0000, min=5.000000(5), max=22.000000(22)")
}

sql """
Expand All @@ -65,8 +71,7 @@ suite("partition_key_minmax") {
sql """
memo plan select * from listtable where id >=3;
"""
containsAny("id#0 -> ndv=1.0000, min=3.000000(3), max=3.000000(3), count=1.0000,")
containsAny("id#0 -> ndv=1.0000, min=1.000000(1), max=3.000000(3), count=1.0000,")
contains("id#0 -> ndv=1.0000, min=3.000000(3), max=3.000000(3), count=1.0000")
}
}

0 comments on commit dc8fd62

Please sign in to comment.