Skip to content

Ordered without nulls_first set should not be treated as if it's set to False #6494

@stnguyen

Description

@stnguyen

nulls_last = not nulls_first

Shouldn't we check if nulls_first is None then nulls_last is also None instead of True?

The problem can be seen with Databricks dialect:

In [1]: sqlglot.select('c1').from_('t1').order_by(sqlglot.exp.Ordered(this='c1')).sql()
Out[1]: 'SELECT c1 FROM t1 ORDER BY c1 NULLS LAST'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions