fn array_value_to_string(column: array::ArrayRef, row: usize) -> Result<String> {
    match column.data_type() {
        DataType::Utf8 => Ok(column
            .as_any()
            .downcast_ref::<array::StringArray>()
            .unwrap()
            .value(row)
            .to_string()),
        DataType::Boolean => make_string!(array::BooleanArray, column, row),
        DataType::Int16 => make_string!(array::Int16Array, column, row),
        DataType::Int32 => make_string!(array::Int32Array, column, row),
        DataType::Int64 => make_string!(array::Int64Array, column, row),
        DataType::UInt8 => make_string!(array::UInt8Array, column, row),
        DataType::UInt16 => make_string!(array::UInt16Array, column, row),
        DataType::UInt32 => make_string!(array::UInt32Array, column, row),
        DataType::UInt64 => make_string!(array::UInt64Array, column, row),
        DataType::Float16 => make_string!(array::Float32Array, column, row),
        DataType::Float32 => make_string!(array::Float32Array, column, row),
        DataType::Float64 => make_string!(array::Float64Array, column, row),
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Second => {
            make_string!(array::TimestampSecondArray, column, row)
        }
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Millisecond => {
            make_string!(array::TimestampMillisecondArray, column, row)
        }
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Microsecond => {
            make_string!(array::TimestampMicrosecondArray, column, row)
        }
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Nanosecond => {
            if column.is_null(row) {
                Ok("<null>".to_string())
            } else {
                let nano_duration = UNIX_EPOCH + Duration::from_nanos(column
                    .as_any()
                    .downcast_ref::<array::TimestampNanosecondArray>()
                    .unwrap()
                    .value(row) as u64);
                let datetime = DateTime::<Utc>::from(nano_duration);
                Ok(datetime.to_rfc3339())
            }
        }
        DataType::Date32(_) => make_string!(array::Date32Array, column, row),
        DataType::Date64(_) => make_string!(array::Date64Array, column, row),
        DataType::Time32(unit) if *unit == TimeUnit::Second => {
            make_string!(array::Time32SecondArray, column, row)
        }
        DataType::Time32(unit) if *unit == TimeUnit::Millisecond => {
            make_string!(array::Time32MillisecondArray, column, row)
        }
        DataType::Time32(unit) if *unit == TimeUnit::Microsecond => {
            make_string!(array::Time64MicrosecondArray, column, row)
        }
        DataType::Time64(unit) if *unit == TimeUnit::Nanosecond => {
            make_string!(array::Time64NanosecondArray, column, row)
        }
        _ => Err(ArrowError::InvalidArgumentError(format!(
            "Unsupported {:?} type for repl.",
            column.data_type()
        ))),
    }
}
/// Get the value at the given row in an array as a string
Get the value at the given row in an array as a string
Get the value at the given row in an array as a string
fn array_value_to_string(column: array::ArrayRef, row: usize) -> Result<String> {
    match column.data_type() {
        DataType::Utf8 => Ok(column
            .as_any()
            .downcast_ref::<array::StringArray>()
            .unwrap()
            .value(row)
            .to_string()),
        DataType::Boolean => make_string!(array::BooleanArray, column, row),
        DataType::Int16 => make_string!(array::Int16Array, column, row),
        DataType::Int32 => make_string!(array::Int32Array, column, row),
        DataType::Int64 => make_string!(array::Int64Array, column, row),
        DataType::UInt8 => make_string!(array::UInt8Array, column, row),
        DataType::UInt16 => make_string!(array::UInt16Array, column, row),
        DataType::UInt32 => make_string!(array::UInt32Array, column, row),
        DataType::UInt64 => make_string!(array::UInt64Array, column, row),
        DataType::Float16 => make_string!(array::Float32Array, column, row),
        DataType::Float32 => make_string!(array::Float32Array, column, row),
        DataType::Float64 => make_string!(array::Float64Array, column, row),
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Second => {
            make_string!(array::TimestampSecondArray, column, row)
        }
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Millisecond => {
            make_string!(array::TimestampMillisecondArray, column, row)
        }
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Microsecond => {
            make_string!(array::TimestampMicrosecondArray, column, row)
        }
        DataType::Timestamp(unit, _) if *unit == TimeUnit::Nanosecond => {
            if column.is_null(row) {
                Ok("<null>".to_string())
            } else {
                let nano_duration = UNIX_EPOCH + Duration::from_nanos(column
                    .as_any()
                    .downcast_ref::<array::TimestampNanosecondArray>()
                    .unwrap()
                    .value(row) as u64);
                let datetime = DateTime::<Utc>::from(nano_duration);
                Ok(datetime.to_rfc3339())
            }
        }
        DataType::Date32(_) => make_string!(array::Date32Array, column, row),
        DataType::Date64(_) => make_string!(array::Date64Array, column, row),
        DataType::Time32(unit) if *unit == TimeUnit::Second => {
            make_string!(array::Time32SecondArray, column, row)
        }
        DataType::Time32(unit) if *unit == TimeUnit::Millisecond => {
            make_string!(array::Time32MillisecondArray, column, row)
        }
        DataType::Time32(unit) if *unit == TimeUnit::Microsecond => {
            make_string!(array::Time64MicrosecondArray, column, row)
        }
        DataType::Time64(unit) if *unit == TimeUnit::Nanosecond => {
            make_string!(array::Time64NanosecondArray, column, row)
        }
        _ => Err(ArrowError::InvalidArgumentError(format!(
            "Unsupported {:?} type for repl.",
            column.data_type()
        ))),
    }
}
fn array_value_to_string ( column : array :: ArrayRef , row : usize ) -> Result < String > { match column . data_type ( ) { DataType :: Utf8 => Ok ( column . as_any ( ) . downcast_ref :: < array :: StringArray > ( ) . unwrap ( ) . value ( row ) . to_string ( ) ) , DataType :: Boolean => make_string ! ( array BooleanArray column row ) , DataType :: Int16 => make_string ! ( array Int16Array column row ) , DataType :: Int32 => make_string ! ( array Int32Array column row ) , DataType :: Int64 => make_string ! ( array Int64Array column row ) , DataType :: UInt8 => make_string ! ( array UInt8Array column row ) , DataType :: UInt16 => make_string ! ( array UInt16Array column row ) , DataType :: UInt32 => make_string ! ( array UInt32Array column row ) , DataType :: UInt64 => make_string ! ( array UInt64Array column row ) , DataType :: Float16 => make_string ! ( array Float32Array column row ) , DataType :: Float32 => make_string ! ( array Float32Array column row ) , DataType :: Float64 => make_string ! ( array Float64Array column row ) , DataType :: Timestamp ( unit , _ ) if * unit == TimeUnit :: Second => { make_string ! ( array TimestampSecondArray column row ) } DataType :: Timestamp ( unit , _ ) if * unit == TimeUnit :: Millisecond => { make_string ! ( array TimestampMillisecondArray column row ) } DataType :: Timestamp ( unit , _ ) if * unit == TimeUnit :: Microsecond => { make_string ! ( array TimestampMicrosecondArray column row ) } DataType :: Timestamp ( unit , _ ) if * unit == TimeUnit :: Nanosecond => { if column . is_null ( row ) { Ok ( " " . to_string ( ) ) } else { let nano_duration = UNIX_EPOCH + Duration :: from_nanos ( column . as_any ( ) . downcast_ref :: < array :: TimestampNanosecondArray > ( ) . unwrap ( ) . value ( row ) as u64 ) ; let datetime = DateTime :: < Utc > :: from ( nano_duration ) ; Ok ( datetime . to_rfc3339 ( ) ) } } DataType :: Date32 ( _ ) => make_string ! ( array Date32Array column row ) , DataType :: Date64 ( _ ) => make_string ! ( array Date64Array column row ) , DataType :: Time32 ( unit ) if * unit == TimeUnit :: Second => { make_string ! ( array Time32SecondArray column row ) } DataType :: Time32 ( unit ) if * unit == TimeUnit :: Millisecond => { make_string ! ( array Time32MillisecondArray column row ) } DataType :: Time32 ( unit ) if * unit == TimeUnit :: Microsecond => { make_string ! ( array Time64MicrosecondArray column row ) } DataType :: Time64 ( unit ) if * unit == TimeUnit :: Nanosecond => { make_string ! ( array Time64NanosecondArray column row ) } _ => Err ( ArrowError :: InvalidArgumentError ( format ! ( " " column data_type ( ) ) ) ) , } }
Get the value at the given row in an array as a string
Get the value at the given row in an array as a string
column
array::ArrayRef
row
usize
column
array::ArrayRef
row
usize