Skip to content

Commit f00baa4

Browse files
authored
YT block input fix for empty input (#11605)
1 parent f282430 commit f00baa4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ydb/library/yql/providers/yt/codec/yt_codec_io.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,12 @@ class TArrowDecoder : public TMkqlReaderImpl::TDecoder {
14911491

14921492
bool ReadNext() {
14931493
if (!StreamReader_) {
1494-
StreamReader_ = ARROW_RESULT(arrow::ipc::RecordBatchStreamReader::Open(InputStream_.get()));
1494+
// Deal with empty input
1495+
auto streamReaderResult = arrow::ipc::RecordBatchStreamReader::Open(InputStream_.get());
1496+
if (!streamReaderResult.ok() && InputStream_->EOSReached()) {
1497+
return false;
1498+
}
1499+
StreamReader_ = ARROW_RESULT(streamReaderResult);
14951500

14961501
auto oldTableIndex = TableIndex_;
14971502
if (!IgnoreStreamTableIndex) {

0 commit comments

Comments
 (0)