diff --git a/ydb/core/kqp/runtime/kqp_scan_data.cpp b/ydb/core/kqp/runtime/kqp_scan_data.cpp index 68c0ab5f9f94..bb8a2cf0fa1b 100644 --- a/ydb/core/kqp/runtime/kqp_scan_data.cpp +++ b/ydb/core/kqp/runtime/kqp_scan_data.cpp @@ -687,6 +687,7 @@ TBytesStatistics TKqpScanComputeContext::TScanData::TBlockBatchReader::AddData(c for (auto&& filtered : batches) { TUnboxedValueVector batchValues; batchValues.resize(totalColsCount); + Y_ENSURE(TotalColumnsCount == static_cast(filtered->num_columns())); for (int i = 0; i < filtered->num_columns(); ++i) { batchValues[i] = holderFactory.CreateArrowBlock(arrow::Datum(AdoptArrowTypeToYQL(filtered->column(i)))); }