Skip to content

Commit 60a91a3

Browse files
committed
fix comments
1 parent 796fd18 commit 60a91a3

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/paimon/core/utils/objects_file.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ Status ObjectsFile<T>::Read(const std::string& file_name,
135135
[this, &filter, result](const std::shared_ptr<arrow::StructArray>& struct_array) -> Status {
136136
result->reserve(result->size() + struct_array->length());
137137
const arrow::ArrayVector& fields = struct_array->fields();
138+
ColumnarRow row(fields, pool_, /*row_id=*/0);
138139
for (int64_t i = 0; i < struct_array->length(); i++) {
139-
ColumnarRow row(fields, pool_, i);
140+
row.SetRowId(i);
140141
PAIMON_ASSIGN_OR_RAISE(T obj, serializer_->FromRow(row));
141142
if (filter) {
142143
PAIMON_ASSIGN_OR_RAISE(bool filter_res, filter(obj));

src/paimon/format/avro/avro_file_batch_reader.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include "paimon/format/avro/avro_file_batch_reader.h"
2020

21-
#include <cassert>
2221
#include <limits>
2322
#include <memory>
2423
#include <utility>
@@ -128,7 +127,10 @@ Result<BatchReader::ReadBatch> AvroFileBatchReader::NextBatch() {
128127
}
129128
PAIMON_ASSIGN_OR_RAISE_FROM_ARROW(std::shared_ptr<arrow::Array> array,
130129
array_builder_->Finish());
131-
assert(array->Validate().ok());
130+
#ifndef NDEBUG
131+
// Keep structural validation in debug builds without adding its recursive cost to reads.
132+
PAIMON_RETURN_NOT_OK_FROM_ARROW(array->Validate());
133+
#endif
132134
std::unique_ptr<ArrowArray> c_array = std::make_unique<ArrowArray>();
133135
std::unique_ptr<ArrowSchema> c_schema = std::make_unique<ArrowSchema>();
134136
PAIMON_RETURN_NOT_OK_FROM_ARROW(arrow::ExportArray(*array, c_array.get(), c_schema.get()));

src/paimon/format/orc/orc_adapter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,10 @@ Result<std::shared_ptr<arrow::Array>> OrcAdapter::AppendBatch(
940940
MakeArrowBuilder(type, batch, pool));
941941
std::shared_ptr<arrow::Array> array;
942942
PAIMON_RETURN_NOT_OK_FROM_ARROW(builder->Finish(&array));
943+
#ifndef NDEBUG
944+
// Keep structural validation in debug builds without adding its recursive cost to reads.
943945
PAIMON_RETURN_NOT_OK_FROM_ARROW(array->Validate());
946+
#endif
944947
return array;
945948
}
946949

src/paimon/format/parquet/parquet_file_batch_reader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,10 @@ Result<BatchReader::ReadBatch> ParquetFileBatchReader::NextBatch() {
616616
}
617617
PAIMON_ASSIGN_OR_RAISE_FROM_ARROW(std::shared_ptr<arrow::Array> array,
618618
batch->ToStructArray());
619+
#ifndef NDEBUG
620+
// Keep structural validation in debug builds without adding its recursive cost to reads.
619621
PAIMON_RETURN_NOT_OK_FROM_ARROW(array->Validate());
622+
#endif
620623
PAIMON_ASSIGN_OR_RAISE(bool need_cast, ParquetTimestampConverter::NeedCastArrayForTimestamp(
621624
array->type(), read_data_type_));
622625
if (need_cast) {

0 commit comments

Comments
 (0)