Skip to content

Commit

Permalink
[BugFix] fix error message for parquet DATA_PAGE_V2
Browse files Browse the repository at this point in the history
Signed-off-by: zombee0 <[email protected]>
  • Loading branch information
zombee0 committed Dec 11, 2024
1 parent a950760 commit 80b9453
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions be/src/formats/parquet/column_chunk_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,17 @@ Status ColumnChunkReader::_parse_page_header() {
size_t now = _page_reader->get_offset();
_opts.stats->request_bytes_read += (now - off);
_opts.stats->request_bytes_read_uncompressed += (now - off);
_page_parse_state = PAGE_HEADER_PARSED;

// The page num values will be used for late materialization before parsing page data,
// so we set _num_values when parsing header.
if (_page_reader->current_header()->type == tparquet::PageType::DATA_PAGE) {
auto& page_type = _page_reader->current_header()->type;
// TODO: support DATA_PAGE_V2, now common writer use DATA_PAGE as default
if (UNLIKELY(page_type != tparquet::PageType::DICTIONARY_PAGE && page_type != tparquet::PageType::DATA_PAGE)) {
return Status::NotSupported(
strings::Substitute("Not supported page type: $0", page_type));
}
if (page_type == tparquet::PageType::DATA_PAGE) {
const auto& header = *_page_reader->current_header();
_num_values = header.data_page_header.num_values;
_opts.stats->has_page_statistics |=
Expand All @@ -136,7 +143,6 @@ Status ColumnChunkReader::_parse_page_header() {
: false;
}

_page_parse_state = PAGE_HEADER_PARSED;
return Status::OK();
}

Expand Down

0 comments on commit 80b9453

Please sign in to comment.