hydradatabase / hydradatabase/columnar

Confused about columnar cache regression test

Open
#261 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
3k
Forks
106
PR merge metrics
No merged PRs in 30d

Description

### What's wrong?

Hi,

When I read the regression test in [columnar_cache.sql](https://github.com/hydradatabase/hydra/blob/main/columnar/src/test/regress/sql/columnar_cache.sql), I noticed that it contains the following test case:

```SQL
CREATE TABLE big_table (
id INT,
firstname TEXT,
lastname TEXT
) USING columnar;

INSERT INTO big_table (id, firstname, lastname)
SELECT i,
CONCAT('firstname-', i),
CONCAT('lastname-', i)
FROM generate_series(1, 1000000) as i;

-- get some baselines from multiple chunks
SELECT firstname,
lastname,
SUM(id)
FROM big_table
WHERE id < 1000
GROUP BY firstname,
lastname
UNION
SELECT firstname,
lastname,
SUM(id)
FROM big_table
WHERE id BETWEEN 15000 AND 16000
GROUP BY firstname,
lastname
ORDER BY firstname;

-- enable caching
SET columnar.enable_column_cache = 't';

-- the results should be the same as above
SELECT firstname,
lastname,
SUM(id)
FROM big_table
WHERE id < 1000
GROUP BY firstname,
lastname
UNION
SELECT firstname,
lastname,
SUM(id)
FROM big_table
WHERE id BETWEEN 15000 AND 16000
GROUP BY firstname,
lastname
ORDER BY firstname;
```
The comments claim that both queries produce the same outcome but [columnar_cache.out](https://github.com/hydradatabase/hydra/blob/main/columnar/src/test/regress/expected/columnar_cache.out) results differ. The first query returns [2000 rows](https://github.com/hydradatabase/hydra/blob/main/columnar/src/test/regress/expected/columnar_cache.out#L2030) while the second only returns [999 rows](https://github.com/hydradatabase/hydra/blob/main/columnar/src/test/regress/expected/columnar_cache.out#L3052).

Is this expected?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.