| -- Cloudberry specific access method tests, in addition to what's |
| -- covered by upstream create_am.sql tests |
| \set HIDE_TABLEAM off |
| create access method ao_row_testam type table handler ao_row_tableam_handler; |
| create access method ao_col_testam type table handler ao_column_tableam_handler; |
| create access method heap_testam type table handler heap_tableam_handler; |
| select amname, amhandler, amtype from pg_am where amname like '%_testam'; |
| amname | amhandler | amtype |
| ---------------+---------------------------+-------- |
| ao_row_testam | ao_row_tableam_handler | t |
| ao_col_testam | ao_column_tableam_handler | t |
| heap_testam | heap_tableam_handler | t |
| (3 rows) |
| |
| create table create_am_gp_ao1 (a int, b int) using ao_row_testam distributed by (a); |
| \d+ create_am_gp_ao1 |
| Table "public.create_am_gp_ao1" |
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| --------+---------+-----------+----------+---------+---------+--------------+------------- |
| a | integer | | | | plain | | |
| b | integer | | | | plain | | |
| Compression Type: None |
| Compression Level: 0 |
| Block Size: 32768 |
| Checksum: t |
| Distributed by: (a) |
| Access method: ao_row_testam |
| |
| create table create_am_gp_ao2 (a int, b int) using ao_row_testam with (compresstype=zlib) distributed by (a); |
| \d+ create_am_gp_ao2 |
| Table "public.create_am_gp_ao2" |
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| --------+---------+-----------+----------+---------+---------+--------------+------------- |
| a | integer | | | | plain | | |
| b | integer | | | | plain | | |
| Compression Type: zlib |
| Compression Level: 1 |
| Block Size: 32768 |
| Checksum: t |
| Distributed by: (a) |
| Access method: ao_row_testam |
| Options: compresstype=zlib |
| |
| -- Should fail |
| create table create_am_gp_ao3 (a int, b int) using ao_row_testam with (compresstype=rle_type) distributed by (a); |
| ERROR: rle_type cannot be used with Append Only relations row orientation |
| create table create_am_gp_ao3 (a int, b int) using heap_testam with (compresstype=rle_type) distributed by (a); |
| ERROR: unrecognized parameter "compresstype" |
| create table create_am_gp_ao3 (a int, b int) using ao_col_testam with (compresstype=rle_type) distributed by (a); |
| \d+ create_am_gp_ao3 |
| Table "public.create_am_gp_ao3" |
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| --------+---------+-----------+----------+---------+---------+--------------+------------- |
| a | integer | | | | plain | | |
| b | integer | | | | plain | | |
| Distributed by: (a) |
| Access method: ao_col_testam |
| Options: compresstype=rle_type |
| |
| -- Should fail because encoding clause is not supported by the tableam |
| create table create_am_gp_ao4(a int, b int encoding (compresstype=zlib)) using ao_row_testam distributed by (a); |
| ERROR: ENCODING clause only supported with column oriented tables |
| set gp_default_storage_options='compresstype=rle_type'; |
| create table create_am_gp_heap(a int, b int) using heap_testam distributed by (a); |
| -- should not have compresstype parameter |
| \d+ create_am_gp_heap |
| Table "public.create_am_gp_heap" |
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| --------+---------+-----------+----------+---------+---------+--------------+------------- |
| a | integer | | | | plain | | |
| b | integer | | | | plain | | |
| Distributed by: (a) |
| Access method: heap_testam |
| |
| -- Should fail because the default compresstype configured above is |
| -- not supported by this tableam |
| create table create_am_gp_ao5(a int, b int) using ao_row_testam distributed by (a); |
| ERROR: rle_type cannot be used with Append Only relations row orientation |
| create table create_am_gp_ao6(a int, b int) using ao_row_testam with (compresstype=zlib) distributed by (a); |
| \d+ create_am_gp_ao6 |
| Table "public.create_am_gp_ao6" |
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| --------+---------+-----------+----------+---------+---------+--------------+------------- |
| a | integer | | | | plain | | |
| b | integer | | | | plain | | |
| Compression Type: zlib |
| Compression Level: 1 |
| Block Size: 32768 |
| Checksum: t |
| Distributed by: (a) |
| Access method: ao_row_testam |
| Options: compresstype=zlib |
| |
| create table create_am_gp_ao7(a int, b int encoding (compresstype=zlib)) using ao_col_testam distributed by (a); |
| \d+ create_am_gp_ao7 |
| Table "public.create_am_gp_ao7" |
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
| --------+---------+-----------+----------+---------+---------+--------------+------------- |
| a | integer | | | | plain | | |
| b | integer | | | | plain | | |
| Distributed by: (a) |
| Access method: ao_col_testam |
| Options: compresstype=rle_type |
| |
| -- Cleanup |
| drop table if exists create_am_gp_ao1; |
| drop table if exists create_am_gp_ao2; |
| drop table if exists create_am_gp_ao3; |
| drop table if exists create_am_gp_ao4; |
| NOTICE: table "create_am_gp_ao4" does not exist, skipping |
| drop table if exists create_am_gp_ao5; |
| NOTICE: table "create_am_gp_ao5" does not exist, skipping |
| drop table if exists create_am_gp_ao6; |
| drop table if exists create_am_gp_ao7; |
| drop table if exists create_am_gp_heap; |