devanbenz commented on code in PR #12466: URL: https://github.com/apache/datafusion/pull/12466#discussion_r1766966988
########## datafusion/sql/src/statement.rs: ########## @@ -1136,14 +1136,29 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { schema: &DFSchemaRef, planner_context: &mut PlannerContext, ) -> Result<Vec<Vec<SortExpr>>> { - // Ask user to provide a schema if schema is empty. + let mut all_results = vec![]; if !order_exprs.is_empty() && schema.fields().is_empty() { - return plan_err!( - "Provide a schema before specifying the order while creating a table." - ); + let mut results = vec![]; + for expr in order_exprs { + for ordered_expr in expr { Review Comment: I've noticed that a lot of this codebase prefers `maps` over for loops like this. I personally think for loops are easier to read but I can modify this to use a map and collect instead if that its preferred. Not sure if either is "more performant". -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org