This is an automated email from the ASF dual-hosted git repository.

leborchuk pushed a commit to branch REL_2_STABLE
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit e416feac9b3327e104179a40e43c65f762c756dc
Author: Dianjin Wang <[email protected]>
AuthorDate: Fri Aug 28 18:45:31 2026 +0800

    PAX regress: align AOCO_Compression size checks with main
    
    pax-ic-good-opt-off/on fail on Rocky Linux 10:
    
      - 712 bytes      |                    36.75
      + 728 bytes      |                    35.95
    
    mpp17012_compress_test2 is a zlib-compressed AOCO table, so its exact
    on-disk size depends on the deflate implementation the platform ships.
    Rocky 8 and Rocky 9 produce 712 bytes, Rocky 10 produces 728.
    
    src/test/regress stopped asserting the exact numbers in be38ff50732: the
    query stays inside start_ignore for reference, and the size and the ratio
    are checked to be within 10% instead. main's copy of the pax suite carries
    the same treatment for both the zlib and the rle_type table since the
    PostgreSQL 16 merge (0f4cf8d5068); this branch's copy predates that.
    
    Take both blocks from main verbatim, so the assertions survive and the two
    branches do not drift further apart. The rle_type table does not depend on
    zlib and passes today, but it is included to keep the file in sync.
---
 .../src/test/regress/expected/AOCO_Compression.out | 52 ++++++++++++++++++++++
 .../src/test/regress/sql/AOCO_Compression.sql      | 34 ++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/contrib/pax_storage/src/test/regress/expected/AOCO_Compression.out 
b/contrib/pax_storage/src/test/regress/expected/AOCO_Compression.out
index 0b8917a4295..2e06c56b842 100644
--- a/contrib/pax_storage/src/test/regress/expected/AOCO_Compression.out
+++ b/contrib/pax_storage/src/test/regress/expected/AOCO_Compression.out
@@ -3572,6 +3572,7 @@ Access method: ao_column
 -- When I insert data
 insert into mpp17012_compress_test2 
values('a',generate_series(1,250),'ksjdhfksdhfksdhfksjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh','bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
 -- Then the data will be compressed according to a consistent compression ratio
+-- start_ignore  
 select pg_size_pretty(pg_relation_size('mpp17012_compress_test2')),
 get_ao_compression_ratio('mpp17012_compress_test2');
  pg_size_pretty | get_ao_compression_ratio 
@@ -3579,6 +3580,31 @@ get_ao_compression_ratio('mpp17012_compress_test2');
  712 bytes      |                    36.75
 (1 row)
 
+-- end_ignore 
+select
+    case
+        when
+            abs((pg_relation_size('mpp17012_compress_test2') - 712.0) / 712.0) 
< 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_relation_size;
+ test_relation_size 
+--------------------
+ test passed
+(1 row)
+
+select
+    case
+        when
+            abs((get_ao_compression_ratio('mpp17012_compress_test2') - 36.75) 
/ 36.75) < 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_ao_compression_ratio;
+ test_ao_compression_ratio 
+---------------------------
+ test passed
+(1 row)
+
 -- Test that an AO/CO table with compresstype zlib and invalid compress level 
will error at create
 create table a_aoco_table_with_zlib_and_invalid_compression_level(col text) 
WITH (APPENDONLY=true, COMPRESSTYPE=zlib, compresslevel=-1, ORIENTATION=column);
 ERROR:  value -1 out of bounds for option "compresslevel"
@@ -3604,6 +3630,7 @@ select 
pg_size_pretty(pg_relation_size('a_aoco_table_with_rle_type_compression')
 -- When I insert data
 insert into a_aoco_table_with_rle_type_compression select i from 
generate_series(1,100)i;
 -- Then the data will be compressed according to a consistent compression ratio
+-- start_ignore
 select 
pg_size_pretty(pg_relation_size('a_aoco_table_with_rle_type_compression')),
        get_ao_compression_ratio('a_aoco_table_with_rle_type_compression');
  pg_size_pretty | get_ao_compression_ratio 
@@ -3611,6 +3638,31 @@ select 
pg_size_pretty(pg_relation_size('a_aoco_table_with_rle_type_compression')
  296 bytes      |                     1.81
 (1 row)
 
+-- end_ignore 
+select
+    case
+        when
+            abs((pg_relation_size('a_aoco_table_with_rle_type_compression') - 
296.0) / 296.0) < 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_relation_size;
+ test_relation_size 
+--------------------
+ test passed
+(1 row)
+
+select
+    case
+        when
+            
abs((get_ao_compression_ratio('a_aoco_table_with_rle_type_compression') - 1.81) 
/ 1.81) < 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_ao_compression_ratio;
+ test_ao_compression_ratio 
+---------------------------
+ test passed
+(1 row)
+
 -- Test that an AO/CO table with compresstype rle and invalid compress level 
will error at create
 create table a_aoco_table_with_rle_type_and_invalid_compression_level(col int) 
WITH (APPENDONLY=true, COMPRESSTYPE=rle_type, compresslevel=-1, 
ORIENTATION=column);
 ERROR:  value -1 out of bounds for option "compresslevel"
diff --git a/contrib/pax_storage/src/test/regress/sql/AOCO_Compression.sql 
b/contrib/pax_storage/src/test/regress/sql/AOCO_Compression.sql
index 251da040730..6ce42e9eabe 100644
--- a/contrib/pax_storage/src/test/regress/sql/AOCO_Compression.sql
+++ b/contrib/pax_storage/src/test/regress/sql/AOCO_Compression.sql
@@ -1748,8 +1748,25 @@ get_ao_compression_ratio('mpp17012_compress_test2');
 -- When I insert data
 insert into mpp17012_compress_test2 
values('a',generate_series(1,250),'ksjdhfksdhfksdhfksjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh','bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
 -- Then the data will be compressed according to a consistent compression ratio
+-- start_ignore  
 select pg_size_pretty(pg_relation_size('mpp17012_compress_test2')),
 get_ao_compression_ratio('mpp17012_compress_test2');
+-- end_ignore 
+select
+    case
+        when
+            abs((pg_relation_size('mpp17012_compress_test2') - 712.0) / 712.0) 
< 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_relation_size;
+
+select
+    case
+        when
+            abs((get_ao_compression_ratio('mpp17012_compress_test2') - 36.75) 
/ 36.75) < 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_ao_compression_ratio;
 
 -- Test that an AO/CO table with compresstype zlib and invalid compress level 
will error at create
 create table a_aoco_table_with_zlib_and_invalid_compression_level(col text) 
WITH (APPENDONLY=true, COMPRESSTYPE=zlib, compresslevel=-1, ORIENTATION=column);
@@ -1764,8 +1781,25 @@ select 
pg_size_pretty(pg_relation_size('a_aoco_table_with_rle_type_compression')
 -- When I insert data
 insert into a_aoco_table_with_rle_type_compression select i from 
generate_series(1,100)i;
 -- Then the data will be compressed according to a consistent compression ratio
+-- start_ignore
 select 
pg_size_pretty(pg_relation_size('a_aoco_table_with_rle_type_compression')),
        get_ao_compression_ratio('a_aoco_table_with_rle_type_compression');
+-- end_ignore 
+select
+    case
+        when
+            abs((pg_relation_size('a_aoco_table_with_rle_type_compression') - 
296.0) / 296.0) < 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_relation_size;
+
+select
+    case
+        when
+            
abs((get_ao_compression_ratio('a_aoco_table_with_rle_type_compression') - 1.81) 
/ 1.81) < 0.1
+        then 'test passed'
+        else 'test failed'
+    end as test_ao_compression_ratio;
 
 -- Test that an AO/CO table with compresstype rle and invalid compress level 
will error at create
 create table a_aoco_table_with_rle_type_and_invalid_compression_level(col int) 
WITH (APPENDONLY=true, COMPRESSTYPE=rle_type, compresslevel=-1, 
ORIENTATION=column);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to