Skip to content

ORDER BY does not work with literals: Sort operation is not applicable to scalar value 'foo' #1195

@alamb

Description

@alamb

Reproducer:

echo "1" > /tmp/foo.csv
cargo run -p datafusion-cli
CREATE EXTERNAL TABLE foo(x int)
STORED AS CSV
LOCATION '/tmp/foo.csv';
> select x from foo order by 'foo';
ArrowError(ExternalError(Internal("Sort operation is not applicable to scalar value foo")))
select x from foo order by null;
ArrowError(ExternalError(Internal("Sort operation is not applicable to scalar value NULL")))
>  select x from foo order by x, null;
ArrowError(ExternalError(Internal("Sort operation is not applicable to scalar value NULL")))```

I found this while working on #1184, but I am not sure it is related to null literals. I think we simply need to teach the sort operation about literals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions