pub fn with_one_row_of_null_data(mut self, _table_name: impl Into<String>) -> Self {
        //let table_name = table_name.into();
        let schema = self
            .table_schema
            .as_ref()
            .expect("table must exist in TestChunk");

        // create arrays
        let columns = schema
            .iter()
            .map(|(_influxdb_column_type, field)| match field.data_type() {
                DataType::Int64 => Arc::new(Int64Array::from(vec![1000])) as ArrayRef,
                DataType::Utf8 => Arc::new(StringArray::from(vec!["MA"])) as ArrayRef,
                DataType::Timestamp(TimeUnit::Nanosecond, _) => {
                    Arc::new(TimestampNanosecondArray::from_vec(vec![1000], None)) as ArrayRef
                }
                DataType::Dictionary(key, value)
                    if key.as_ref() == &DataType::Int32 && value.as_ref() == &DataType::Utf8 =>
                {
                    let dict: DictionaryArray<Int32Type> = vec!["MA"].into_iter().collect();
                    Arc::new(dict) as ArrayRef
                }
                _ => unimplemented!(
                    "Unimplemented data type for test database: {:?}",
                    field.data_type()
                ),
            })
            .collect::<Vec<_>>();

        let batch = RecordBatch::try_new(schema.into(), columns).expect("made record batch");

        self.table_data.push(Arc::new(batch));
        self
    }
/// Prepares this chunk to return a specific record batch with one
/// row of non null data.
Prepares this chunk to return a specific record batch with one
row of non null data.
Prepares this chunk to return a specific record batch with one row of non null data .
pub fn with_one_row_of_null_data(mut self, _table_name: impl Into<String>) -> Self {
        //let table_name = table_name.into();
        let schema = self
            .table_schema
            .as_ref()
            .expect("table must exist in TestChunk");
        // create arrays
        let columns = schema
            .iter()
            .map(|(_influxdb_column_type, field)| match field.data_type() {
                DataType::Int64 => Arc::new(Int64Array::from(vec![1000])) as ArrayRef,
                DataType::Utf8 => Arc::new(StringArray::from(vec!["MA"])) as ArrayRef,
                DataType::Timestamp(TimeUnit::Nanosecond, _) => {
                    Arc::new(TimestampNanosecondArray::from_vec(vec![1000], None)) as ArrayRef
                }
                DataType::Dictionary(key, value)
                    if key.as_ref() == &DataType::Int32 && value.as_ref() == &DataType::Utf8 =>
                {
                    let dict: DictionaryArray<Int32Type> = vec!["MA"].into_iter().collect();
                    Arc::new(dict) as ArrayRef
                }
                _ => unimplemented!(
                    "Unimplemented data type for test database: {:?}",
                    field.data_type()
                ),
            })
            .collect::<Vec<_>>();
        let batch = RecordBatch::try_new(schema.into(), columns).expect("made record batch");
        self.table_data.push(Arc::new(batch));
        self
    }
pub fn with_one_row_of_null_data ( mut self , _table_name : impl Into < String > ) -> Self { //let table_name = table_name.into(); let schema = self . table_schema . as_ref ( ) . expect ( " " ) ; // create arrays let columns = schema . iter ( ) . map ( | ( _influxdb_column_type , field ) | match field . data_type ( ) { DataType :: Int64 => Arc :: new ( Int64Array :: from ( vec ! [ 1000 ] ) ) as ArrayRef , DataType :: Utf8 => Arc :: new ( StringArray :: from ( vec ! [ " " ] ) ) as ArrayRef , DataType :: Timestamp ( TimeUnit :: Nanosecond , _ ) => { Arc :: new ( TimestampNanosecondArray :: from_vec ( vec ! [ 1000 ] , None ) ) as ArrayRef } DataType :: Dictionary ( key , value ) if key . as_ref ( ) == & DataType :: Int32 && value . as_ref ( ) == & DataType :: Utf8 => { let dict : DictionaryArray < Int32Type > = vec ! [ " " ] . into_iter ( ) . collect ( ) ; Arc :: new ( dict ) as ArrayRef } _ => unimplemented ! ( " " field data_type ( ) ) , } ) . collect :: < Vec < _ > > ( ) ; let batch = RecordBatch :: try_new ( schema . into ( ) , columns ) . expect ( " " ) ; self . table_data . push ( Arc :: new ( batch ) ) ; self }
Prepares this chunk to return a specific record batch with one
row of non null data.
Prepares this chunk to return a specific record batch with one row of non null data .
mut self
_table_name
impl Into<String>
mut self
_table_name
impl Into<String>