xudong963 commented on code in PR #22406:
URL: https://github.com/apache/datafusion/pull/22406#discussion_r3286363675
##########
datafusion/physical-expr-common/src/metrics/mod.rs:
##########
@@ -555,6 +558,54 @@ impl Display for Label {
}
}
+#[derive(Clone, Eq)]
+enum LabelValue {
+ Static(&'static str),
+ Shared(Arc<str>),
+}
+
+impl LabelValue {
+ fn as_str(&self) -> &str {
+ match self {
+ Self::Static(value) => value,
+ Self::Shared(value) => value.as_ref(),
+ }
+ }
+}
+
+impl From<Cow<'static, str>> for LabelValue {
+ fn from(value: Cow<'static, str>) -> Self {
+ match value {
+ Cow::Borrowed(value) => Self::Static(value),
+ Cow::Owned(value) => Self::Shared(Arc::from(value)),
Review Comment:
OKay, I'll try in a seperate PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]