15 Commits

Author SHA1 Message Date
Simon Vandel Sillesen 6479e43f86 Support JOIN pipe operator (#17969)
* support WHERE pipe operator

* support order by

* support limit

* select pipe

* extend support

* document supported pipe operators in user guide

* fmt

* fix where pipe before extend

* support AS

* support union

* support intersection

* support except

* support aggregate

* support join operator

* support pivot

* remove unused

* revert parquet-testing

* remove simon

* move docs to select.md

* remove unnecessary comments

* back out pivot operator

* remove prompt marker
2025-10-10 02:08:36 +00:00
Simon Vandel Sillesen a7b113c455 Support AS, UNION, INTERSECTION, EXCEPT, AGGREGATE pipe operators (#17312)
* support WHERE pipe operator

* support order by

* support limit

* select pipe

* extend support

* document supported pipe operators in user guide

* fmt

* fix where pipe before extend

* support AS

* support union

* support intersection

* support except

* support aggregate

* revert diff from main

* simplify using mut

* remove useless comments

* remove dummy data

* move docs to select.md

* simplify using alias_if_changed

* deduplicate fn

* add aggregate toc

* revert parquet testing
2025-10-03 01:53:18 +00:00
Simon Vandel Sillesen 23d91c59bc Support WHERE, ORDER BY, LIMIT, SELECT, EXTEND pipe operators (#17278)
* support WHERE pipe operator

* support order by

* support limit

* select pipe

* extend support

* document supported pipe operators in user guide

* fmt

* fix where pipe before extend

* don't rebind

* remove clone

* move docs into select.md

* avoid confusion by removing `>` in examples

---------

Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com>
2025-09-22 23:30:24 +00:00
Adrian Garcia Badaracco 5fd831fce9 Revert #17295 (Support from-first SQL syntax) (#17520)
* Add failing test

* Fix regression in SELECT FROM syntax with WHERE clause

When using 'SELECT FROM table WHERE condition', the query should create
an empty projection (no columns) while still filtering rows. This was
broken by PR #17295 which added FROM-first syntax support.

The issue was that both 'FROM table' and 'SELECT FROM table' resulted
in empty projection lists, making them indistinguishable. The fix checks
for the presence of a WHERE clause to differentiate:
- 'FROM table' (no WHERE) -> add wildcard projection (all columns)
- 'SELECT FROM table WHERE ...' -> keep empty projection

Also updates the test expectation to correctly show the empty Projection
node in the query plan.

Fixes #17513

* Revert

* Fix regression: SELECT FROM syntax should return empty projection

Removes automatic wildcard projection for empty projections, fixing
the regression where `SELECT FROM table` incorrectly returned all
columns instead of empty projection.

Note: This temporarily breaks FROM-first syntax. A proper fix would
require distinguishing between `FROM table` and `SELECT FROM table`
at the parser level.

Fixes #17513

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* add a better regression test

* remove comment

* fmt

* Update datafusion/sqllogictest/test_files/projection.slt

Co-authored-by: Oleks V <comphead@users.noreply.github.com>

* Update datafusion/core/tests/sql/select.rs

Co-authored-by: Oleks V <comphead@users.noreply.github.com>

* revert docs

* fmt

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Oleks V <comphead@users.noreply.github.com>
2025-09-12 15:55:37 -04:00
Simon Vandel Sillesen 85f879d41a Support from-first SQL syntax (#17295)
* Support from-first syntax

I noticed in https://github.com/apache/datafusion/pull/17278 that `from`
without an explicit projection did not work.
This should fix it

* add more tests

* document in user guide
2025-08-24 10:56:10 +10:00
Huaijin f3941b207e feat: implement QUALIFY clause (#16933)
* feat: implement QUALIFY clause

* add document

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2025-08-15 16:50:58 -04:00
Jonathan Chen 3a371ed6ef doc: Add SQL examples for SEMI + ANTI Joins (#16316)
* doc: Add SQL examples for SEMI + ANTI Joins

* prettier

* Update docs/source/user-guide/sql/select.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-12 18:17:11 -04:00
Phillip LeBlanc 41b3f5c6b0 Update links to datafusion.apache.org (#10195) 2024-04-23 13:52:12 -04:00
Chih Wang ae88235617 Fix sphinx warnings (#9142)
* Fix 'Configuration Settings' link in write_options.md

* Fix multiple reference definition in scalar_functions.md

* Fix typo: 'contcat_ws' to 'concat_ws' in scalar_functions.md

* Add missing section 'array_contains' in scalar_functions.md

* Fix reference warnings in operators.md

* Remove unsupported syntax 'csv' from code blocks of adding-udfs.md

* Fix syntax tag in example-usage.md

* Change syntax tag of code blocks that contain multiple syntaxes of
cli.md

* Remove 'sql' syntax tags from code blocks

* Remove leading ❯ in sql code blocks
2024-02-09 16:01:26 -05:00
Andrew Lamb 5ec14e1757 Minor: Add EXCEPT/EXCLUDE to SQL guide (#6512) 2023-06-02 14:08:52 -04:00
Mustafa Akur d8a92be182 Add support for ordering sensitive aggregation (#6332)
* Naive test pass

i

* Add new tests and simplifications

* move tests to the .slt file

* update requirement

* update tests

* Add support for partiallyOrdered aggregation sensitive.

* Resolve linter errors

* update comments

* minor changes

* retract changes in generated

* update proto files

* Simplifications

* Make types consistent in schema, and data

* Update todos

* Convert API to vector

* Convert get_finest to handle Vector inputs

* simplifications, update comment

* Minor code simplifications

* Update comment

* Update documents

* fix projection push down failure bug

* Simplifications, Address reviews

* Update comment

* Resolve linter errors

---------

Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
2023-05-15 12:43:48 -04:00
Jeffrey 3ad7734a7e Update sql doc (#6025)
* Update/touch-up user-guide sql doc pages

* Update ddl doc
2023-04-17 06:31:46 -04:00
nbr d5e6736dd2 Improve doc on lowercase treatment of columns on SQL (#3385)
* Improve doc

Adds specific note on lowercase treatment of columns on SQL

This example is the first thing newcomers see when they start with datafusion (literally the second page on the docs) so it should be clearer.

* Update select.md

add note on the use of default lower-case for SQL query

* prettier this

* improve example file link

* add capitalized example
2022-10-12 16:42:20 -04:00
Andy Grove 4cf0cf0dc5 User Guide: Add documentation for JOIN syntax (#3130)
* Documentation for JOIN syntax

* revert Cargo.lock

* prettier
2022-08-15 15:19:25 -04:00
QP Hou dcd34c6679 consolidate datafusion docs with sphinx (#993)
* consolidate datafusion docs with sphinx
* added python doc
* combined, cli, user-guide and specification docs into a single datafusion doc

Co-authored-by: Jiayu Liu <Jimexist@users.noreply.github.com>
2021-09-14 22:16:31 -07:00