diff --git a/columnar/src/backend/columnar/columnar_reader.c b/columnar/src/backend/columnar/columnar_reader.c index b24e4d1..b23829f 100644 --- a/columnar/src/backend/columnar/columnar_reader.c +++ b/columnar/src/backend/columnar/columnar_reader.c @@ -2162,8 +2162,8 @@ ReadStripeNextVector(StripeReadState *stripeReadState, Datum *columnValues, if (*newVectorSize == 0) continue; } - - stripeReadState->currentRow += stripeReadState->chunkGroupReadState->rowCount; + else + stripeReadState->currentRow += stripeReadState->chunkGroupReadState->rowCount; return true; } @@ -2260,4 +2260,4 @@ ReadChunkGroupNextVector(ChunkGroupReadState *chunkGroupReadState, Datum *column } return true; -} \ No newline at end of file +} diff --git a/columnar/src/test/regress/expected/columnar_alter_set_type.out b/columnar/src/test/regress/expected/columnar_alter_set_type.out index 72f16a2..204a4fc 100644 --- a/columnar/src/test/regress/expected/columnar_alter_set_type.out +++ b/columnar/src/test/regress/expected/columnar_alter_set_type.out @@ -63,7 +63,7 @@ SELECT columnar.alter_columnar_table_set('test', compression => 'lz4'); INSERT INTO test VALUES(1); VACUUM VERBOSE test; INFO: statistics for "test": -storage id: 10000000141 +storage id: 10000000142 total file size: 24576, total data size: 6 compression rate: 0.83x total row count: 1, stripe count: 1, average rows per stripe: 1 @@ -72,7 +72,7 @@ chunk count: 1, containing data for dropped columns: 0, lz4 compressed: 1 ALTER TABLE test ALTER COLUMN i TYPE int8; VACUUM VERBOSE test; INFO: statistics for "test": -storage id: 10000000142 +storage id: 10000000143 total file size: 24576, total data size: 10 compression rate: 0.90x total row count: 1, stripe count: 1, average rows per stripe: 1 diff --git a/columnar/src/test/regress/expected/columnar_query.out b/columnar/src/test/regress/expected/columnar_query.out index 72664c7..95b78db 100644 --- a/columnar/src/test/regress/expected/columnar_query.out +++ b/columnar/src/test/regress/expected/columnar_query.out @@ -310,3 +310,21 @@ SELECT * FROM t WHERE a >= 90; (11 rows) DROP TABLE t; +-- +-- [columnar] Test chunk_group_row_limit +-- +CREATE TABLE t(a INT) USING columnar; +SELECT columnar.alter_columnar_table_set('t', chunk_group_row_limit => '11000'); + alter_columnar_table_set +-------------------------- + +(1 row) + +INSERT INTO t SELECT a FROM generate_series(0,50000) AS a; +SELECT count(*) FROM t; + count +------- + 50001 +(1 row) + +DROP TABLE t; diff --git a/columnar/src/test/regress/sql/columnar_query.sql b/columnar/src/test/regress/sql/columnar_query.sql index d3c58ae..f78bc1f 100644 --- a/columnar/src/test/regress/sql/columnar_query.sql +++ b/columnar/src/test/regress/sql/columnar_query.sql @@ -159,4 +159,19 @@ SELECT * FROM t WHERE a >= 90; SELECT * FROM t WHERE a >= 90; -DROP TABLE t; \ No newline at end of file +DROP TABLE t; + + +-- +-- [columnar] Test chunk_group_row_limit +-- + +CREATE TABLE t(a INT) USING columnar; + +SELECT columnar.alter_columnar_table_set('t', chunk_group_row_limit => '11000'); + +INSERT INTO t SELECT a FROM generate_series(0,50000) AS a; + +SELECT count(*) FROM t; + +DROP TABLE t;