kosiew commented on code in PR #19221:
URL: https://github.com/apache/datafusion/pull/19221#discussion_r2645895445
##########
datafusion/sql/src/unparser/ast.rs:
##########
@@ -140,7 +140,15 @@ impl Default for QueryBuilder {
pub struct SelectBuilder {
distinct: Option<ast::Distinct>,
top: Option<ast::Top>,
- projection: Vec<ast::SelectItem>,
+ /// Projection items for the SELECT clause.
+ ///
+ /// This field uses `Option` to distinguish between three distinct states:
+ /// - `None`: No projection has been set (not yet initialized)
+ /// - `Some(vec![])`: Empty projection explicitly set (generates `SELECT
FROM ...` or `SELECT 1 FROM ...`)
+ /// - `Some(vec![...])`: Non-empty projection with specific
columns/expressions
+ ///
+ /// Use `projection()` to set this field and `already_projected()` to
check if it has been set.
+ projection: Option<Vec<ast::SelectItem>>,
Review Comment:
I'll update docstring.
--
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]