kosiew commented on code in PR #19221:
URL: https://github.com/apache/datafusion/pull/19221#discussion_r2629633466
##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -98,6 +98,16 @@ pub fn plan_to_sql(plan: &LogicalPlan) ->
Result<ast::Statement> {
}
impl Unparser<'_> {
+ /// Generates appropriate projection expression for empty projection lists.
+ /// Returns an empty vec for dialects supporting empty select lists,
+ /// or a dummy literal `1` for other dialects.
+ fn empty_projection_fallback(&self) -> Vec<Expr> {
+ if self.dialect.supports_empty_select_list() {
+ Vec::new()
+ } else {
+ vec![Expr::Literal(ScalarValue::Int64(Some(1)), None)]
+ }
+ }
Review Comment:
Will do.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]