alamb commented on code in PR #4902:
URL: https://github.com/apache/arrow-datafusion/pull/4902#discussion_r1072794220


##########
datafusion/sql/src/statement.rs:
##########
@@ -253,6 +259,93 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
                 table_name,
                 filter,
             } => self.show_columns_to_plan(extended, full, table_name, filter),
+
+            Statement::Insert {
+                or,
+                into,
+                table_name,
+                columns,
+                overwrite,
+                source,
+                partitioned,
+                after_columns,
+                table,
+                on,
+                returning,
+            } => {
+                if or.is_some() {
+                    Err(DataFusionError::Plan(
+                        "Inserts with or clauses not supported".to_owned(),
+                    ))?;
+                }
+                if overwrite {
+                    Err(DataFusionError::Plan(
+                        "Insert overwrite is not supported".to_owned(),
+                    ))?;
+                }
+                if partitioned.is_some() {
+                    Err(DataFusionError::Plan(
+                        "Partitioned inserts not yet supported".to_owned(),
+                    ))?;
+                }
+                if !after_columns.is_empty() {
+                    Err(DataFusionError::Plan(
+                        "After-columns clause not supported".to_owned(),
+                    ))?;
+                }
+                if table {
+                    Err(DataFusionError::Plan(
+                        "Table clause not supported".to_owned(),
+                    ))?;
+                }
+                if on.is_some() {
+                    Err(DataFusionError::Plan(
+                        "Insert-on clause not supported".to_owned(),
+                    ))?;
+                }
+                if returning.is_some() {
+                    Err(DataFusionError::Plan(
+                        "Insert-returning clause not yet supported".to_owned(),
+                    ))?;
+                }
+                let _ = into; // optional keyword doesn't change behavior

Review Comment:
   awesome



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