@@ -2306,6 +2306,9 @@ Status OrcReader::_get_next_block_impl(Block* block, size_t* read_rows, bool* eo
23062306 col_name, column_ptr, column_type,
23072307 _table_info_node_ptr->get_children_node (col_name), _type_map[file_column_name],
23082308 batch_vec[orc_col_idx->second ], _batch->numElements ));
2309+ #ifndef NDEBUG
2310+ column_ptr->sanity_check ();
2311+ #endif
23092312 }
23102313
23112314 RETURN_IF_ERROR (_fill_partition_columns (block, _batch->numElements ,
@@ -2322,8 +2325,25 @@ Status OrcReader::_get_next_block_impl(Block* block, size_t* read_rows, bool* eo
23222325 return Status::OK ();
23232326 }
23242327 {
2328+ #ifndef NDEBUG
2329+ for (auto col : *block) {
2330+ col.column ->sanity_check ();
2331+
2332+ DCHECK (block->rows () == col.column ->size ())
2333+ << absl::Substitute (" block rows = $0 , column rows = $1, col name = $2" ,
2334+ block->rows (), col.column ->size (), col.name );
2335+ }
2336+ #endif
23252337 SCOPED_RAW_TIMER (&_statistics.predicate_filter_time );
23262338 _execute_filter_position_delete_rowids (*_filter);
2339+ #ifndef NDEBUG
2340+ for (auto col : *block) {
2341+ col.column ->sanity_check ();
2342+ DCHECK (block->rows () == col.column ->size ())
2343+ << absl::Substitute (" block rows = $0 , column rows = $1, col name = $2" ,
2344+ block->rows (), col.column ->size (), col.name );
2345+ }
2346+ #endif
23272347 {
23282348 SCOPED_RAW_TIMER (&_statistics.decode_null_map_time );
23292349 RETURN_IF_CATCH_EXCEPTION (
@@ -2332,6 +2352,14 @@ Status OrcReader::_get_next_block_impl(Block* block, size_t* read_rows, bool* eo
23322352 Block::erase_useless_column (block, column_to_keep);
23332353 RETURN_IF_ERROR (_convert_dict_cols_to_string_cols (block, &batch_vec));
23342354 *read_rows = block->rows ();
2355+ #ifndef NDEBUG
2356+ for (auto col : *block) {
2357+ col.column ->sanity_check ();
2358+ DCHECK (block->rows () == col.column ->size ())
2359+ << absl::Substitute (" block rows = $0 , column rows = $1, col name = $2" ,
2360+ block->rows (), col.column ->size (), col.name );
2361+ }
2362+ #endif
23352363 }
23362364 } else {
23372365 uint64_t rr;
@@ -2403,6 +2431,9 @@ Status OrcReader::_get_next_block_impl(Block* block, size_t* read_rows, bool* eo
24032431 col_name, column_ptr, column_type,
24042432 _table_info_node_ptr->get_children_node (col_name), _type_map[file_column_name],
24052433 batch_vec[orc_col_idx->second ], _batch->numElements ));
2434+ #ifndef NDEBUG
2435+ column_ptr->sanity_check ();
2436+ #endif
24062437 }
24072438
24082439 RETURN_IF_ERROR (_fill_partition_columns (block, _batch->numElements ,
@@ -2419,6 +2450,14 @@ Status OrcReader::_get_next_block_impl(Block* block, size_t* read_rows, bool* eo
24192450 return Status::OK ();
24202451 }
24212452
2453+ #ifndef NDEBUG
2454+ for (auto col : *block) {
2455+ col.column ->sanity_check ();
2456+ DCHECK (block->rows () == col.column ->size ())
2457+ << absl::Substitute (" block rows = $0 , column rows = $1, col name = $2" ,
2458+ block->rows (), col.column ->size (), col.name );
2459+ }
2460+ #endif
24222461 {
24232462 SCOPED_RAW_TIMER (&_statistics.predicate_filter_time );
24242463 _build_delete_row_filter (block, _batch->numElements );
@@ -2472,7 +2511,23 @@ Status OrcReader::_get_next_block_impl(Block* block, size_t* read_rows, bool* eo
24722511 Block::erase_useless_column (block, column_to_keep);
24732512 }
24742513 }
2514+ #ifndef NDEBUG
2515+ for (auto col : *block) {
2516+ col.column ->sanity_check ();
2517+ DCHECK (block->rows () == col.column ->size ())
2518+ << absl::Substitute (" block rows = $0 , column rows = $1, col name = $2" ,
2519+ block->rows (), col.column ->size (), col.name );
2520+ }
2521+ #endif
24752522 RETURN_IF_ERROR (_convert_dict_cols_to_string_cols (block, &batch_vec));
2523+ #ifndef NDEBUG
2524+ for (auto col : *block) {
2525+ col.column ->sanity_check ();
2526+ DCHECK (block->rows () == col.column ->size ())
2527+ << absl::Substitute (" block rows = $0 , column rows = $1, col name = $2" ,
2528+ block->rows (), col.column ->size (), col.name );
2529+ }
2530+ #endif
24762531 *read_rows = block->rows ();
24772532 }
24782533 return Status::OK ();
@@ -2582,6 +2637,9 @@ Status OrcReader::filter(orc::ColumnVectorBatch& data, uint16_t* sel, uint16_t s
25822637 table_col_name, column_ptr, column_type,
25832638 _table_info_node_ptr->get_children_node (table_col_name),
25842639 _type_map[file_column_name], batch_vec[orc_col_idx->second ], data.numElements ));
2640+ #ifndef NDEBUG
2641+ column_ptr->sanity_check ();
2642+ #endif
25852643 }
25862644 RETURN_IF_ERROR (
25872645 _fill_partition_columns (block, size, _lazy_read_ctx.predicate_partition_columns ));
0 commit comments