Skip to content

Commit 111bf4a

Browse files
author
xiao.dong
committed
fix next() return value
1 parent ca3b460 commit 111bf4a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/iceberg/avro/avro_stream_internal.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ bool AvroInputStream::next(const uint8_t** data, size_t* len) {
4747

4848
// Read from the input stream when the buffer is empty
4949
auto result = input_stream_->Read(buffer_.size(), buffer_.data());
50-
if (!result.ok()) {
51-
throw IcebergError(
52-
std::format("Read failed:{} at pos:{}", result.status().ToString(), buffer_pos_));
53-
}
54-
if (result.ValueUnsafe() <= 0) {
50+
// TODO(xiao.dong) Avro interface requires to return false if an error has occurred or
51+
// reach EOF, so error message can not be raised to the caller, add some log after we
52+
// have a logging system
53+
if (!result.ok() || result.ValueUnsafe() <= 0) {
5554
return false;
5655
}
5756
available_bytes_ = result.ValueUnsafe();

0 commit comments

Comments
 (0)