You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: agg_index_reader_native.rs
    path of file: ./repos/databend/src/query/storages/fuse/src/io/read/agg_index
    
    the code of the file until where you have to start completion: // Copyright 2021 Datafuse Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::sync::Arc;

use databend_common_arrow::arrow::chunk::Chunk;
use databend_common_arrow::native::read as nread;
use databend_common_exception::Result;
use databend_common_expression::DataBlock;
use databend_storages_common_table_meta::meta::ColumnMeta;
use log::debug;

use super::AggIndexReader;
use crate::io::BlockReader;
use crate::io::NativeSourceData;
use crate::FusePartInfo;

impl AggIndexReader {
    pub fn sync_read_native_data(&self, loc: &str) -> Option<NativeSourceData> {
        match self.reader.operator.blocking().reader(loc) {
            Ok(mut reader) => {
                let metadata = nread::reader::read_meta(&mut reader)
                    .inspect_err(|e| {
                        debug!("Read aggregating index `{loc}`'s metadata failed: {e}")
                    })
                    .ok()?;
                let num_rows = metadata[0].pages.iter().map(|p| p.num_values).sum();
                debug_assert!(
        
    
    pub fn sync_read_native_data(&self, loc: &str) -> Option<NativeSourceData> {
        match self.reader.operator.blocking().reader(loc) {
            Ok(mut reader) => {
                let metadata = nread::reader::read_meta(&mut reader)
                    .inspect_err(|e| {
                        debug!("Read aggregating index `{loc}`'s metadata failed: {e}")
                    })
                    .ok()?;
                let num_rows = metadata[0].pages.iter().map(|p| p.num_values).sum();
                debug_assert!(
                    metadata
                        .iter()
                        .all(|c| c.pages.iter().map(|p| p.num_values).sum::<u64>() == num_rows)
                );
                let columns_meta = metadata
                    .into_iter()
                    .enumerate()
                    .map(|(i, c)| (i as u32, ColumnMeta::Native(c)))
                    .collect();
                let part = FusePartInfo::create(
                    loc.to_string(),
                    num_rows,
                    columns_meta,
                    None,
                    self.compression.into(),
                    None,
                    None,
                    None,
                );
                let res = self
                    .reader
                    .sync_read_native_columns_data(&part, &None)
                    .inspect_err(|e| debug!("Read aggregating index `{loc}` failed: {e}"))
                    .ok()?;
                Some(res)
            }
            Err(e) => {
                if e.kind() == opendal::ErrorKind::NotFound {
                    debug!("Aggregating index `{loc}` not found.")
                } else {
                    debug!("Read aggregating index `{loc}` failed: {e}");
                }
                None
            }
        }
    }