Skip to content

Filter multiple columns from TopK using Lexicographical ordering #15698

Open
@Dandandan

Description

@Dandandan

Is your feature request related to a problem or challenge?

In the PR #15697 we added support for filtering input values early on to speed up TopK execution.

The current code uses only the first value as filter (col[0] < threshold[0] for single columns and col[0] <= threshold[0] for multiple columns), but we could extend the expression to filter out multiple columns (either all of the columns or a prefix).

Describe the solution you'd like

We can write the filter that respects lexical ordering as:

col[0] < threshold[0] || (col[0] = threshold[0] && col[1] < threshold[1] || (...))

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestperformanceMake DataFusion faster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions