pub(crate) async fn make_one_rub_or_parquet_chunk_scenario(
    partition_key: &str,
    data: &str,
) -> Vec<DbScenario> {
    // Scenario 1: One closed chunk in RUB
    let db = make_db().await.db;
    let table_names = write_lp(&db, data).await;
    for table_name in &table_names {
        db.rollover_partition(table_name, partition_key)
            .await
            .unwrap();
        db.move_chunk_to_read_buffer(table_name, partition_key, 0)
            .await
            .unwrap();
    }
    let scenario1 = DbScenario {
        scenario_name: "--------------------- Data in read buffer".into(),
        db,
    };

    // Scenario 2: One closed chunk in Parquet only
    let db = make_db().await.db;
    let table_names = write_lp(&db, data).await;
    for table_name in &table_names {
        db.rollover_partition(table_name, partition_key)
            .await
            .unwrap();
        db.move_chunk_to_read_buffer(table_name, partition_key, 0)
            .await
            .unwrap();
        db.persist_partition(
            table_name,
            partition_key,
            Instant::now() + Duration::from_secs(1),
        )
        .await
        .unwrap();
        db.unload_read_buffer(table_name, partition_key, 1).unwrap();
    }
    let scenario2 = DbScenario {
        scenario_name: "--------------------- Data in object store only ".into(),
        db,
    };

    vec![scenario1, scenario2]
}
// This function loads one chunk of lp data into RUB for testing predicate pushdown
This function loads one chunk of lp data into RUB for testing predicate pushdown
This function loads one chunk of lp data into RUB for testing predicate pushdown
pub(crate) async fn make_one_rub_or_parquet_chunk_scenario(
    partition_key: &str,
    data: &str,
) -> Vec<DbScenario> {
    // Scenario 1: One closed chunk in RUB
    let db = make_db().await.db;
    let table_names = write_lp(&db, data).await;
    for table_name in &table_names {
        db.rollover_partition(table_name, partition_key)
            .await
            .unwrap();
        db.move_chunk_to_read_buffer(table_name, partition_key, 0)
            .await
            .unwrap();
    }
    let scenario1 = DbScenario {
        scenario_name: "--------------------- Data in read buffer".into(),
        db,
    };
    // Scenario 2: One closed chunk in Parquet only
    let db = make_db().await.db;
    let table_names = write_lp(&db, data).await;
    for table_name in &table_names {
        db.rollover_partition(table_name, partition_key)
            .await
            .unwrap();
        db.move_chunk_to_read_buffer(table_name, partition_key, 0)
            .await
            .unwrap();
        db.persist_partition(
            table_name,
            partition_key,
            Instant::now() + Duration::from_secs(1),
        )
        .await
        .unwrap();
        db.unload_read_buffer(table_name, partition_key, 1).unwrap();
    }
    let scenario2 = DbScenario {
        scenario_name: "--------------------- Data in object store only ".into(),
        db,
    };
    vec![scenario1, scenario2]
}
pub ( crate ) async fn make_one_rub_or_parquet_chunk_scenario ( partition_key : & str , data : & str , ) -> Vec < DbScenario > { // Scenario 1: One closed chunk in RUB let db = make_db ( ) . await . db ; let table_names = write_lp ( & db , data ) . await ; for table_name in & table_names { db . rollover_partition ( table_name , partition_key ) . await . unwrap ( ) ; db . move_chunk_to_read_buffer ( table_name , partition_key , 0 ) . await . unwrap ( ) ; } let scenario1 = DbScenario { scenario_name : " " . into ( ) , db , } ; // Scenario 2: One closed chunk in Parquet only let db = make_db ( ) . await . db ; let table_names = write_lp ( & db , data ) . await ; for table_name in & table_names { db . rollover_partition ( table_name , partition_key ) . await . unwrap ( ) ; db . move_chunk_to_read_buffer ( table_name , partition_key , 0 ) . await . unwrap ( ) ; db . persist_partition ( table_name , partition_key , Instant :: now ( ) + Duration :: from_secs ( 1 ) , ) . await . unwrap ( ) ; db . unload_read_buffer ( table_name , partition_key , 1 ) . unwrap ( ) ; } let scenario2 = DbScenario { scenario_name : " " . into ( ) , db , } ; vec ! [ scenario1 scenario2 ] }
This function loads one chunk of lp data into RUB for testing predicate pushdown
This function loads one chunk of lp data into RUB for testing predicate pushdown
partition_key
&str
data
&str
partition_key
&str
data
&str