Skip to content

Sorted rows returned by DataFusion sort operator could be in different order than Spark on irrelevant columns #629

@viirya

Description

@viirya

What is the problem the feature request solves?

During debugging incorrect TPCDS queries in #613, these incorrect rows are not ordered as Spark.

I found that the order of returned rows are not related to the sorting columns. For example, if you sort on [a, b], there are some rows with same [a, b] so the order of these rows are irrelevant to the sorting order, i.e., either

|a|b|c|
|0|1|1|
|0|1|2|

or

|a|b|c|
|0|1|2|
|0|1|1|

are correct results for sorting on [a, b]. In these failed queries, Spark sort produces one and DataFusion sort produces another one. Because we compare the results as string, they are considered incorrect now by CometTPCDSQuerySuite.

Describe the potential solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions