diff --git a/src/common/src/types/cow.rs b/src/common/src/types/cow.rs index bb4dda7434202..65e3bd6a741fe 100644 --- a/src/common/src/types/cow.rs +++ b/src/common/src/types/cow.rs @@ -17,7 +17,7 @@ use super::{Datum, DatumRef, ToDatumRef, ToOwnedDatum}; /// 🐮 A borrowed [`DatumRef`] or an owned [`Datum`]. #[derive(Debug, Clone)] pub enum DatumCow<'a> { - Ref(DatumRef<'a>), + Borrowed(DatumRef<'a>), Owned(Datum), } @@ -36,14 +36,14 @@ impl From for DatumCow<'_> { impl<'a> From> for DatumCow<'a> { fn from(datum: DatumRef<'a>) -> Self { - DatumCow::Ref(datum) + DatumCow::Borrowed(datum) } } impl ToDatumRef for DatumCow<'_> { fn to_datum_ref(&self) -> DatumRef<'_> { match self { - DatumCow::Ref(datum) => *datum, + DatumCow::Borrowed(datum) => *datum, DatumCow::Owned(datum) => datum.to_datum_ref(), } } @@ -52,7 +52,7 @@ impl ToDatumRef for DatumCow<'_> { impl ToOwnedDatum for DatumCow<'_> { fn to_owned_datum(self) -> Datum { match self { - DatumCow::Ref(datum) => datum.to_owned_datum(), + DatumCow::Borrowed(datum) => datum.to_owned_datum(), DatumCow::Owned(datum) => datum, } } diff --git a/src/connector/src/parser/unified/json.rs b/src/connector/src/parser/unified/json.rs index c2f74c375f2bb..a467f1a0f98ce 100644 --- a/src/connector/src/parser/unified/json.rs +++ b/src/connector/src/parser/unified/json.rs @@ -429,7 +429,7 @@ impl JsonParseOptions { .map_err(|_| create_error())? .into(), // ---- Varchar ----- - (DataType::Varchar, ValueType::String) => return Ok(DatumCow::Ref(Some(value.as_str().unwrap().into()))), + (DataType::Varchar, ValueType::String) => return Ok(DatumCow::Borrowed(Some(value.as_str().unwrap().into()))), ( DataType::Varchar, ValueType::Bool