@@ -238,7 +238,10 @@ impl LayoutReader for StructReader {
238238 match & self . partition_expr ( expr. clone ( ) ) {
239239 Partitioned :: Single ( name, partition) => self
240240 . field_reader ( name) ?
241- . pruning_evaluation ( row_range, partition, mask) ,
241+ . pruning_evaluation ( row_range, partition, mask)
242+ . map_err ( |err| {
243+ err. with_context ( format ! ( "While evaluating pruning filter partition {name}" ) )
244+ } ) ,
242245 Partitioned :: Multi ( _) => {
243246 // TODO(ngates): if all partitions are boolean, we can use a pruning evaluation. Otherwise
244247 // there's not much we can do? Maybe... it's complicated...
@@ -257,16 +260,27 @@ impl LayoutReader for StructReader {
257260 match & self . partition_expr ( expr. clone ( ) ) {
258261 Partitioned :: Single ( name, partition) => self
259262 . field_reader ( name) ?
260- . filter_evaluation ( row_range, partition, mask) ,
263+ . filter_evaluation ( row_range, partition, mask)
264+ . map_err ( |err| {
265+ err. with_context ( format ! ( "While evaluating filter partition {name}" ) )
266+ } ) ,
261267 Partitioned :: Multi ( partitioned) => partitioned. clone ( ) . into_mask_future (
262268 mask,
263269 |name, expr, mask| {
264270 self . field_reader ( name) ?
265271 . filter_evaluation ( row_range, expr, mask)
272+ . map_err ( |err| {
273+ err. with_context ( format ! ( "While evaluating filter partition {name}" ) )
274+ } )
266275 } ,
267276 |name, expr, mask| {
268277 self . field_reader ( name) ?
269278 . projection_evaluation ( row_range, expr, mask)
279+ . map_err ( |err| {
280+ err. with_context ( format ! (
281+ "While evaluating projection partition {name}"
282+ ) )
283+ } )
270284 } ,
271285 ) ,
272286 }
@@ -287,7 +301,10 @@ impl LayoutReader for StructReader {
287301 let ( projected, is_pack_merge) = match & self . partition_expr ( expr. clone ( ) ) {
288302 Partitioned :: Single ( name, partition) => (
289303 self . field_reader ( name) ?
290- . projection_evaluation ( row_range, partition, mask_fut) ?,
304+ . projection_evaluation ( row_range, partition, mask_fut)
305+ . map_err ( |err| {
306+ err. with_context ( format ! ( "While evaluating projection partition {name}" ) )
307+ } ) ?,
291308 partition. is :: < Pack > ( ) || partition. is :: < Merge > ( ) ,
292309 ) ,
293310
@@ -297,6 +314,11 @@ impl LayoutReader for StructReader {
297314 . into_array_future ( mask_fut, |name, expr, mask| {
298315 self . field_reader ( name) ?
299316 . projection_evaluation ( row_range, expr, mask)
317+ . map_err ( |err| {
318+ err. with_context ( format ! (
319+ "While evaluating projection partition {name}"
320+ ) )
321+ } )
300322 } ) ?,
301323 partitioned. root . is :: < Pack > ( ) || partitioned. root . is :: < Merge > ( ) ,
302324 ) ,
0 commit comments