@@ -790,6 +790,7 @@ impl ZarrTableProvider {
790790 name. clone ( )
791791 } ;
792792
793+
793794 // Check if this is an empty array
794795 let is_empty = shape. iter ( ) . any ( |& s| s == 0 ) ;
795796
@@ -1556,7 +1557,7 @@ impl ZarrTableProvider {
15561557 let mut filtered_batches = Vec :: new ( ) ;
15571558 let mut row_count = 0 ;
15581559
1559- // Get proper chunk indices from the first data variable
1560+ // Get proper chunk indices from the first available array
15601561 let chunk_combinations = if !data_variables. is_empty ( ) {
15611562 let ( _, first_array, _) = & data_variables[ 0 ] ;
15621563 // Get chunk grid shape to determine proper chunk indices
@@ -1570,6 +1571,28 @@ impl ZarrTableProvider {
15701571 vec ! [ ]
15711572 }
15721573 }
1574+ } else if !dimension_arrays. is_empty ( ) {
1575+ let ( _, first_array, _) = & dimension_arrays[ 0 ] ;
1576+ match first_array. chunk_grid_shape ( ) {
1577+ Some ( chunk_grid_shape) => {
1578+ let chunk_indices = vec ! [ 0u64 ; chunk_grid_shape. len( ) ] ;
1579+ vec ! [ chunk_indices]
1580+ } ,
1581+ None => {
1582+ vec ! [ ]
1583+ }
1584+ }
1585+ } else if !coordinate_arrays. is_empty ( ) {
1586+ let ( _, first_array, _) = & coordinate_arrays[ 0 ] ;
1587+ match first_array. chunk_grid_shape ( ) {
1588+ Some ( chunk_grid_shape) => {
1589+ let chunk_indices = vec ! [ 0u64 ; chunk_grid_shape. len( ) ] ;
1590+ vec ! [ chunk_indices]
1591+ } ,
1592+ None => {
1593+ vec ! [ ]
1594+ }
1595+ }
15731596 } else {
15741597 vec ! [ ]
15751598 } ;
0 commit comments