pub async fn new_rb_chunk(
        &self,
        decoded_parquet_file: Arc<DecodedParquetFile>,
    ) -> Option<QuerierRBChunk> {
        let parquet_file_id = decoded_parquet_file.parquet_file_id();
        let schema = decoded_parquet_file.schema();
        let chunk_id = ChunkId::from(Uuid::from_u128(parquet_file_id.get() as _));
        let table_name = self
            .catalog_cache
            .table()
            .name(decoded_parquet_file.table_id())
            .await?;

        let rb_chunk = self
            .catalog_cache()
            .read_buffer()
            .get(
                Arc::clone(&decoded_parquet_file),
                Arc::clone(&table_name),
                self.store.clone(),
            )
            .await;

        // Somewhat hacky workaround because of implicit chunk orders, use min sequence number and
        // hope it doesn't overflow u32. Order is non-zero, se we need to add 1.
        let order = ChunkOrder::new(1 + decoded_parquet_file.min_sequence_number().get() as u32)
            .expect("cannot be zero");

        // Read partition sort key
        let partition_sort_key = self
            .catalog_cache()
            .partition()
            .sort_key(decoded_parquet_file.partition_id())
            .await;

        let meta = Arc::new(ChunkMeta {
            chunk_id,
            table_name,
            order,
            sort_key: decoded_parquet_file.sort_key().cloned(),
            sequencer_id: decoded_parquet_file.sequencer_id(),
            partition_id: decoded_parquet_file.partition_id(),
            min_sequence_number: decoded_parquet_file.min_sequence_number(),
            max_sequence_number: decoded_parquet_file.max_sequence_number(),
        });

        Some(QuerierRBChunk::new(
            parquet_file_id,
            rb_chunk,
            meta,
            schema,
            partition_sort_key,
        ))
    }
/// Create read buffer chunk. May be from the cache, may be from the parquet file.
Create read buffer chunk. May be from the cache, may be from the parquet file.
Create read buffer chunk . May be from the cache may be from the parquet file .
pub async fn new_rb_chunk(
        &self,
        decoded_parquet_file: Arc<DecodedParquetFile>,
    ) -> Option<QuerierRBChunk> {
        let parquet_file_id = decoded_parquet_file.parquet_file_id();
        let schema = decoded_parquet_file.schema();
        let chunk_id = ChunkId::from(Uuid::from_u128(parquet_file_id.get() as _));
        let table_name = self
            .catalog_cache
            .table()
            .name(decoded_parquet_file.table_id())
            .await?;
        let rb_chunk = self
            .catalog_cache()
            .read_buffer()
            .get(
                Arc::clone(&decoded_parquet_file),
                Arc::clone(&table_name),
                self.store.clone(),
            )
            .await;
        // Somewhat hacky workaround because of implicit chunk orders, use min sequence number and
        // hope it doesn't overflow u32. Order is non-zero, se we need to add 1.
        let order = ChunkOrder::new(1 + decoded_parquet_file.min_sequence_number().get() as u32)
            .expect("cannot be zero");
        // Read partition sort key
        let partition_sort_key = self
            .catalog_cache()
            .partition()
            .sort_key(decoded_parquet_file.partition_id())
            .await;
        let meta = Arc::new(ChunkMeta {
            chunk_id,
            table_name,
            order,
            sort_key: decoded_parquet_file.sort_key().cloned(),
            sequencer_id: decoded_parquet_file.sequencer_id(),
            partition_id: decoded_parquet_file.partition_id(),
            min_sequence_number: decoded_parquet_file.min_sequence_number(),
            max_sequence_number: decoded_parquet_file.max_sequence_number(),
        });
        Some(QuerierRBChunk::new(
            parquet_file_id,
            rb_chunk,
            meta,
            schema,
            partition_sort_key,
        ))
    }
pub async fn new_rb_chunk ( & self , decoded_parquet_file : Arc < DecodedParquetFile > , ) -> Option < QuerierRBChunk > { let parquet_file_id = decoded_parquet_file . parquet_file_id ( ) ; let schema = decoded_parquet_file . schema ( ) ; let chunk_id = ChunkId :: from ( Uuid :: from_u128 ( parquet_file_id . get ( ) as _ ) ) ; let table_name = self . catalog_cache . table ( ) . name ( decoded_parquet_file . table_id ( ) ) . await ? ; let rb_chunk = self . catalog_cache ( ) . read_buffer ( ) . get ( Arc :: clone ( & decoded_parquet_file ) , Arc :: clone ( & table_name ) , self . store . clone ( ) , ) . await ; // Somewhat hacky workaround because of implicit chunk orders, use min sequence number and // hope it doesn't overflow u32. Order is non-zero, se we need to add 1. let order = ChunkOrder :: new ( 1 + decoded_parquet_file . min_sequence_number ( ) . get ( ) as u32 ) . expect ( " " ) ; // Read partition sort key let partition_sort_key = self . catalog_cache ( ) . partition ( ) . sort_key ( decoded_parquet_file . partition_id ( ) ) . await ; let meta = Arc :: new ( ChunkMeta { chunk_id , table_name , order , sort_key : decoded_parquet_file . sort_key ( ) . cloned ( ) , sequencer_id : decoded_parquet_file . sequencer_id ( ) , partition_id : decoded_parquet_file . partition_id ( ) , min_sequence_number : decoded_parquet_file . min_sequence_number ( ) , max_sequence_number : decoded_parquet_file . max_sequence_number ( ) , } ) ; Some ( QuerierRBChunk :: new ( parquet_file_id , rb_chunk , meta , schema , partition_sort_key , ) ) }
Create read buffer chunk.
Create read buffer chunk .
&self
decoded_parquet_file
Arc<DecodedParquetFile>
&self
decoded_parquet_file
Arc<DecodedParquetFile>