Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a server crash #235

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions columnar/src/backend/columnar/columnar_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -2260,4 +2260,4 @@ ReadChunkGroupNextVector(ChunkGroupReadState *chunkGroupReadState, Datum *column
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 18 additions & 0 deletions columnar/src/test/regress/expected/columnar_query.out
Original file line number Diff line number Diff line change
Expand Up @@ -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;
17 changes: 16 additions & 1 deletion columnar/src/test/regress/sql/columnar_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,19 @@ SELECT * FROM t WHERE a >= 90;

SELECT * FROM t WHERE a >= 90;

DROP TABLE t;
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;