Skip to content

External table with complex order expression not allowed #17411

@pepijnve

Description

@pepijnve

Describe the bug

At https://datafusion.apache.org/user-guide/sql/ddl.html#example-with-order-clause the documentation states

This applies even if the expression used for sorting is complex, allowing for greater flexibility.

and then an example is given using

WITH ORDER (c2 ASC, c5 + c8 DESC NULL FIRST)

If you actually try to run this you get an error stating

Expected single column reference in sort_order[0][0], got c5 + c8

I've traced the origin of this check all the way back to a change by @alamb for #4170

To Reproduce

Run a query on the table from the example at https://datafusion.apache.org/user-guide/sql/ddl.html#example-with-order-clause

Expected behavior

The example works

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions