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: hybrid storage encode bug in multi record batch #426

Merged
merged 5 commits into from
Dec 1, 2022
Merged

fix: hybrid storage encode bug in multi record batch #426

merged 5 commits into from
Dec 1, 2022

Conversation

chunshao90
Copy link
Contributor

@chunshao90 chunshao90 commented Nov 27, 2022

Which issue does this PR close?

Closes #403

Rationale for this change

Fix bugs described in #403 .
Hybrid storage compresses multi-record batches into one record batch.
There is a bug where collapsible_col_arrays in TsidBatch only stores the first record batch data, other record batch data are lost.

What changes are included in this PR?

Are there any user-facing changes?

No.

How does this change test

Modify some tests to cover this bug.

@chunshao90 chunshao90 changed the title fix: fix hybridstorage ecode bug in multi record batch fix: fix hybridstorage encode bug in multi record batch Nov 28, 2022
@jiacai2050 jiacai2050 changed the title fix: fix hybridstorage encode bug in multi record batch fix: hybrid storage encode bug in multi record batch Nov 28, 2022
@jiacai2050
Copy link
Contributor

@chunshao90 I think of one critical issue for hybrid format: it will not be compatible with bloom filter.

We built bloom filter for each row group, there will be exact num_rows_per_row_group rows in one row group, since ParquetWriter will flush row group until the accumulated rows reach num_rows_per_row_group, otherwise it will just pending them.

The problem is that hybrid storage will shorten rows in one row group, for example if we set num_rows_per_row_group to 8192, after hybrid conversion, it will less than 8192, then ParquetWriter will not flush this row group since 8192 is not reached.

analytic_engine/src/sst/parquet/hybrid.rs Outdated Show resolved Hide resolved
analytic_engine/src/sst/parquet/hybrid.rs Outdated Show resolved Hide resolved
analytic_engine/src/sst/parquet/hybrid.rs Outdated Show resolved Hide resolved
@chunshao90
Copy link
Contributor Author

@chunshao90 I think of one critical issue for hybrid format: it will not be compatible with bloom filter.

We built bloom filter for each row group, there will be exact num_rows_per_row_group rows in one row group, since ParquetWriter will flush row group until the accumulated rows reach num_rows_per_row_group, otherwise it will just pending them.

The problem is that hybrid storage will shorten rows in one row group, for example if we set num_rows_per_row_group to 8192, after hybrid conversion, it will less than 8192, then ParquetWriter will not flush this row group since 8192 is not reached.

I create an issue #435.

Copy link
Contributor

@jiacai2050 jiacai2050 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chunshao90 chunshao90 merged commit f3ba886 into apache:main Dec 1, 2022
chunshao90 added a commit to chunshao90/ceresdb that referenced this pull request May 15, 2023
* fix: fix hybridstorage ecode bug in multi record batch

* cargo fmt

* refactor code

* refactor by CR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

write hybrid column data cause index out of bounds
2 participants