-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] [Enhancement] Fix nullptr and support Iceberg null padding
PR #48151 introduced a regression, where what would previously return an Error now caused a nullptr dereference and crashed the entire CN. This change removes the crashing and, for Iceberg, also adds support for padding evolved fields with null values, as per Iceberg spec. Signed-off-by: Samrose Ahmed <[email protected]>
- Loading branch information
1 parent
692b5e0
commit 143b6aa
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2021-present StarRocks, Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
#include "formats/parquet/column_reader.h" | ||
|
||
namespace starrocks::parquet { | ||
|
||
// Used to pad with nulls for schema evolved struct columns, as per Iceberg spec. | ||
class DefaultColumnReader final : public ColumnReader { | ||
public: | ||
explicit DefaultColumnReader() {} | ||
~DefaultColumnReader() override = default; | ||
|
||
Status read_range(const Range<uint64_t>& range, const Filter* filter, ColumnPtr& dst) override { | ||
dst->append_default(range.span_size()); | ||
return Status::OK(); | ||
} | ||
|
||
void get_levels(level_t** def_levels, level_t** rep_levels, size_t* num_levels) override {} | ||
void set_need_parse_levels(bool need_parse_levels) override { } | ||
void select_offset_index(const SparseRange<uint64_t>& range, const uint64_t rg_first_row) override {} | ||
void collect_column_io_range(std::vector<io::SharedBufferedInputStream::IORange>* ranges, int64_t* end_offset, | ||
ColumnIOType type, bool active) override {} | ||
|
||
}; | ||
|
||
} // namespace starrocks::parquet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters