diff --git a/src/datatypes/src/schema/column_schema.rs b/src/datatypes/src/schema/column_schema.rs
index ffe9d2eb4a95..c22b9f7b4a5f 100644
--- a/src/datatypes/src/schema/column_schema.rs
+++ b/src/datatypes/src/schema/column_schema.rs
@@ -123,6 +123,14 @@ impl ColumnSchema {
self.default_constraint.as_ref()
}
+ /// Check if the default constraint is a impure function.
+ pub fn is_default_impure(&self) -> bool {
+ self.default_constraint
+ .as_ref()
+ .map(|c| c.is_function())
+ .unwrap_or(false)
+ }
+
#[inline]
pub fn metadata(&self) -> &Metadata {
&self.metadata
@@ -290,6 +298,15 @@ impl ColumnSchema {
}
}
+ /// Creates an impure default value for this column, only if it have a impure default constraint.
+ /// Otherwise, returns `Ok(None)`.
+ pub fn create_impure_default(&self) -> Result