// RecordBatches with knowledge of influx metadata
RecordBatches with knowledge of influx metadata
RecordBatches with knowledge of influx metadata
pub async fn create_batches_with_influxtype() -> Vec<Arc<RecordBatch>> {
        // Use the available TestChunk to create chunks and then convert them to raw RecordBatches
        let mut batches = vec![];
        // This test covers all kind of chunks: overlap, non-overlap without duplicates within, non-overlap with duplicates within
        // todo: may want to simplify the below data of test chunks. these are reuse the current code that cover many commpaction cases
        let chunk1 = Arc::new(
            TestChunk::new("t")
                .with_id(1)
                .with_time_column_with_full_stats(
                    Some(5),
                    Some(7000),
                    10,
                    Some(NonZeroU64::new(7).unwrap()),
                )
                .with_tag_column_with_full_stats(
                    "tag1",
                    Some("AL"),
                    Some("MT"),
                    10,
                    Some(NonZeroU64::new(3).unwrap()),
                )
                .with_i64_field_column("field_int")
                .with_ten_rows_of_data_some_duplicates(),
        );
        let batch1 = raw_data(&[chunk1]).await[0].clone();
        //println!("BATCH1: {:#?}", batch1);
        batches.push(Arc::new(batch1));
        // chunk2 overlaps with chunk 1
        let chunk2 = Arc::new(
            TestChunk::new("t")
                .with_id(2)
                .with_time_column_with_full_stats(
                    Some(5),
                    Some(7000),
                    5,
                    Some(NonZeroU64::new(5).unwrap()),
                )
                .with_tag_column_with_full_stats(
                    "tag1",
                    Some("AL"),
                    Some("MT"),
                    5,
                    Some(NonZeroU64::new(3).unwrap()),
                )
                .with_i64_field_column("field_int")
                .with_five_rows_of_data(),
        );
        let batch2 = raw_data(&[chunk2]).await[0].clone();
        //println!("BATCH2: {:#?}", batch2);
        batches.push(Arc::new(batch2));
        // chunk3 no overlap, no duplicates within
        let chunk3 = Arc::new(
            TestChunk::new("t")
                .with_id(3)
                .with_time_column_with_full_stats(
                    Some(8000),
                    Some(20000),
                    3,
                    Some(NonZeroU64::new(3).unwrap()),
                )
                .with_tag_column_with_full_stats(
                    "tag1",
                    Some("UT"),
                    Some("WA"),
                    3,
                    Some(NonZeroU64::new(3).unwrap()),
                )
                .with_i64_field_column("field_int")
                .with_three_rows_of_data(),
        );
        let batch3 = raw_data(&[chunk3]).await[0].clone();
        //println!("BATCH3: {:#?}", batch3);
        batches.push(Arc::new(batch3));
        // chunk3 no overlap, duplicates within
        let chunk4 = Arc::new(
            TestChunk::new("t")
                .with_id(4)
                .with_time_column_with_full_stats(
                    Some(28000),
                    Some(220000),
                    4,
                    Some(NonZeroU64::new(3).unwrap()),
                )
                .with_tag_column_with_full_stats(
                    "tag1",
                    Some("UT"),
                    Some("WA"),
                    4,
                    Some(NonZeroU64::new(3).unwrap()),
                )
                .with_i64_field_column("field_int")
                .with_may_contain_pk_duplicates(true)
                .with_four_rows_of_data(),
        );
        let batch4 = raw_data(&[chunk4]).await[0].clone();
        //println!("BATCH4: {:#?}", batch4);
        batches.push(Arc::new(batch4));
        // todo: show what output data look like in comments for easier debug
        batches
    }
pub async fn create_batches_with_influxtype ( ) -> Vec < Arc < RecordBatch > > { // Use the available TestChunk to create chunks and then convert them to raw RecordBatches let mut batches = vec ! [ ] ; // This test covers all kind of chunks: overlap, non-overlap without duplicates within, non-overlap with duplicates within // todo: may want to simplify the below data of test chunks. these are reuse the current code that cover many commpaction cases let chunk1 = Arc :: new ( TestChunk :: new ( " " ) . with_id ( 1 ) . with_time_column_with_full_stats ( Some ( 5 ) , Some ( 7000 ) , 10 , Some ( NonZeroU64 :: new ( 7 ) . unwrap ( ) ) , ) . with_tag_column_with_full_stats ( " " , Some ( " " ) , Some ( " " ) , 10 , Some ( NonZeroU64 :: new ( 3 ) . unwrap ( ) ) , ) . with_i64_field_column ( " " ) . with_ten_rows_of_data_some_duplicates ( ) , ) ; let batch1 = raw_data ( & [ chunk1 ] ) . await [ 0 ] . clone ( ) ; //println!("BATCH1: {:#?}", batch1); batches . push ( Arc :: new ( batch1 ) ) ; // chunk2 overlaps with chunk 1 let chunk2 = Arc :: new ( TestChunk :: new ( " " ) . with_id ( 2 ) . with_time_column_with_full_stats ( Some ( 5 ) , Some ( 7000 ) , 5 , Some ( NonZeroU64 :: new ( 5 ) . unwrap ( ) ) , ) . with_tag_column_with_full_stats ( " " , Some ( " " ) , Some ( " " ) , 5 , Some ( NonZeroU64 :: new ( 3 ) . unwrap ( ) ) , ) . with_i64_field_column ( " " ) . with_five_rows_of_data ( ) , ) ; let batch2 = raw_data ( & [ chunk2 ] ) . await [ 0 ] . clone ( ) ; //println!("BATCH2: {:#?}", batch2); batches . push ( Arc :: new ( batch2 ) ) ; // chunk3 no overlap, no duplicates within let chunk3 = Arc :: new ( TestChunk :: new ( " " ) . with_id ( 3 ) . with_time_column_with_full_stats ( Some ( 8000 ) , Some ( 20000 ) , 3 , Some ( NonZeroU64 :: new ( 3 ) . unwrap ( ) ) , ) . with_tag_column_with_full_stats ( " " , Some ( " " ) , Some ( " " ) , 3 , Some ( NonZeroU64 :: new ( 3 ) . unwrap ( ) ) , ) . with_i64_field_column ( " " ) . with_three_rows_of_data ( ) , ) ; let batch3 = raw_data ( & [ chunk3 ] ) . await [ 0 ] . clone ( ) ; //println!("BATCH3: {:#?}", batch3); batches . push ( Arc :: new ( batch3 ) ) ; // chunk3 no overlap, duplicates within let chunk4 = Arc :: new ( TestChunk :: new ( " " ) . with_id ( 4 ) . with_time_column_with_full_stats ( Some ( 28000 ) , Some ( 220000 ) , 4 , Some ( NonZeroU64 :: new ( 3 ) . unwrap ( ) ) , ) . with_tag_column_with_full_stats ( " " , Some ( " " ) , Some ( " " ) , 4 , Some ( NonZeroU64 :: new ( 3 ) . unwrap ( ) ) , ) . with_i64_field_column ( " " ) . with_may_contain_pk_duplicates ( true ) . with_four_rows_of_data ( ) , ) ; let batch4 = raw_data ( & [ chunk4 ] ) . await [ 0 ] . clone ( ) ; //println!("BATCH4: {:#?}", batch4); batches . push ( Arc :: new ( batch4 ) ) ; // todo: show what output data look like in comments for easier debug batches }
RecordBatches with knowledge of influx metadata
RecordBatches with knowledge of influx metadata