You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "ryanschneider (via GitHub)" <gi...@apache.org> on 2025/07/23 16:25:11 UTC

[I] Support `COLUMNS(* EXLCUDE(col1, col2))` syntax [datafusion-sqlparser-rs]

ryanschneider opened a new issue, #1972:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1972

   DuckDB supports excluding columns via this syntax:
   
   ```
   SELECT COLUMNS(* EXCLUDE(col1, col2)) FROM tbl
   ```
   
   Currently this format gives a syntax error:
   
   ```
   Parse error: sql parser error: Expected: ), found: EXCLUDE at Line: 1, Column: 18
   ```
   
   More details at: https://duckdb.org/docs/stable/sql/expressions/star.html#columns-expression
   
   Note that other modifiers beyond `EXCLUDE` are supported, such as `REPLACE`, `RENAME`, `LIKE` etc, see the syntax diagram at https://duckdb.org/docs/stable/sql/query_syntax/select.html#syntax (click `star-options` on the digram to expand).
   
   This highly suggests that the general solution for this would be to add a new `Expr::Columns` expression enum with parsing logic somewhat similiar to `Expr::MatchAgainst`, and then add logic in `parse_select_item` to support returning a `SelectItem::UnnamedExpr(Expr::Columns)`.


-- 
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@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Support `COLUMNS(* EXLCUDE(col1, col2))` syntax [datafusion-sqlparser-rs]

Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 commented on issue #1972:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1972#issuecomment-5779442315

   Closing as completed in https://github.com/apache/datafusion-sqlparser-rs/pull/2231


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Support `COLUMNS(* EXLCUDE(col1, col2))` syntax [datafusion-sqlparser-rs]

Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 closed issue #1972: Support `COLUMNS(* EXLCUDE(col1, col2))` syntax
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1972


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org