@@ -942,10 +942,13 @@ std::vector<std::shared_ptr<arrow::RecordBatch>> SliceToRecordBatches(const std:
942
942
auto it = i->chunks ().begin ();
943
943
ui32 length = (*it)->length ();
944
944
for (ui32 idx = 0 ; idx + 1 < positions.size (); ++idx) {
945
+ AFL_VERIFY (it != i->chunks ().end ());
946
+ while (!(*it)->length ()) {
947
+ AFL_VERIFY (++it != i->chunks ().end ());
948
+ }
949
+ AFL_VERIFY (positions[idx + 1 ] - currentPosition <= length)(" length" , length)(" idx+1" , positions[idx + 1 ])(" pos" , currentPosition);
945
950
auto chunk = (*it)->Slice (positions[idx] - currentPosition, positions[idx + 1 ] - positions[idx]);
946
- AFL_VERIFY_DEBUG (chunk->length () == positions[idx + 1 ] - positions[idx])(" length" , chunk->length ())(
947
- " delta" , positions[idx + 1 ] - positions[idx]);
948
- AFL_VERIFY_DEBUG (chunk->length ())(" delta" , positions[idx + 1 ] - positions[idx]);
951
+ AFL_VERIFY_DEBUG (chunk->length () == positions[idx + 1 ] - positions[idx])(" length" , chunk->length ())(" expect" , positions[idx + 1 ] - positions[idx]);
949
952
if (positions[idx + 1 ] - currentPosition == length) {
950
953
if (++it != i->chunks ().end ()) {
951
954
length = (*it)->length ();
@@ -958,8 +961,8 @@ std::vector<std::shared_ptr<arrow::RecordBatch>> SliceToRecordBatches(const std:
958
961
std::vector<std::shared_ptr<arrow::RecordBatch>> result;
959
962
ui32 count = 0 ;
960
963
for (auto && i : slicedData) {
961
- AFL_VERIFY_DEBUG (i.size ());
962
- AFL_VERIFY_DEBUG (i.front ()->length ());
964
+ AFL_VERIFY (i.size ());
965
+ AFL_VERIFY (i.front ()->length ());
963
966
result.emplace_back (arrow::RecordBatch::Make (t->schema (), i.front ()->length (), i));
964
967
count += result.back ()->num_rows ();
965
968
}
0 commit comments