jonahgao commented on code in PR #8283:
URL: https://github.com/apache/arrow-datafusion/pull/8283#discussion_r1399937631


##########
datafusion/sql/src/planner.rs:
##########
@@ -230,6 +229,41 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
         Ok(Schema::new(fields))
     }
 
+    pub(super) fn build_column_defaults(
+        &self,
+        columns: &Vec<SQLColumnDef>,
+        planner_context: &mut PlannerContext,
+    ) -> Result<Vec<(String, Expr)>> {
+        let mut column_defaults = vec![];
+        // Default expressions are restricted, column references are not 
allowed
+        let empty_schema = DFSchema::empty();
+        let human_readable_error = |e: DataFusionError| match e {
+            DataFusionError::SchemaError(SchemaError::FieldNotFound { .. }) => 
{
+                DataFusionError::Plan(format!(

Review Comment:
   I’ve tried using it once, but it returned a `Result`, what is needed here is 
an `Error`.
   



##########
datafusion/sql/src/planner.rs:
##########
@@ -230,6 +229,41 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
         Ok(Schema::new(fields))
     }
 
+    pub(super) fn build_column_defaults(
+        &self,
+        columns: &Vec<SQLColumnDef>,
+        planner_context: &mut PlannerContext,
+    ) -> Result<Vec<(String, Expr)>> {
+        let mut column_defaults = vec![];
+        // Default expressions are restricted, column references are not 
allowed
+        let empty_schema = DFSchema::empty();
+        let human_readable_error = |e: DataFusionError| match e {
+            DataFusionError::SchemaError(SchemaError::FieldNotFound { .. }) => 
{
+                DataFusionError::Plan(format!(

Review Comment:
   I’ve tried using it once, but it returned a `Result`, what is needed here is 
an `Error`.
   



-- 
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]

Reply via email to