You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "comphead (via GitHub)" <gi...@apache.org> on 2023/03/15 15:14:18 UTC

[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #5606: create table default to null

comphead commented on code in PR #5606:
URL: https://github.com/apache/arrow-datafusion/pull/5606#discussion_r1137257666


##########
datafusion/sql/src/statement.rs:
##########
@@ -127,42 +129,66 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
                 && table_properties.is_empty()
                 && with_options.is_empty() =>
             {
-                let plan = self.query_to_plan(*query, planner_context)?;
-                let input_schema = plan.schema();
-
-                let plan = if !columns.is_empty() {
-                    let schema = self.build_schema(columns)?.to_dfschema_ref()?;
-                    if schema.fields().len() != input_schema.fields().len() {
-                        return Err(DataFusionError::Plan(format!(
+                match query {
+                    Some(query) => {

Review Comment:
   looks like this code will handle traditoinal create table no just CTAS, do you think we can remove ```
               Statement::CreateTable { .. } => Err(DataFusionError::NotImplemented(
                   "Only `CREATE TABLE table_name AS SELECT ...` statement is supported"
                       .to_string(),
               )),
               ```
               condition?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org