Skip to content

fix: Native window operator should be CometUnaryExec#774

Merged
viirya merged 1 commit intoapache:mainfrom
viirya:fix_window_op
Aug 4, 2024
Merged

fix: Native window operator should be CometUnaryExec#774
viirya merged 1 commit intoapache:mainfrom
viirya:fix_window_op

Conversation

@viirya
Copy link
Copy Markdown
Member

@viirya viirya commented Aug 4, 2024

Which issue does this PR close?

Closes #775.

Rationale for this change

What changes are included in this PR?

How are these changes tested?

this.serializedPlanOpt == other.serializedPlanOpt
case _ =>
false
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This native plan is incorrect. This uses the window operator's output as the pseudo scan's output, but it should be the child plan's output. The incorrect output causes errors in DataFusion Window operator.

Copy link
Copy Markdown
Member Author

@viirya viirya Aug 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides, native window operator requires correct partitioning and ordering information from its child operator. The current native scan operator doesn't have these information. That also causes DataFusion Window operator cannot produce correct ordering partition by info.

}

object CometWindowExec {
def getNativePlan(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Window is native operator, we should chain it in the native operators instead of creating a pseudo scan for it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also can improve performance as we don't need additional native/JVM bridge.

Copy link
Copy Markdown
Contributor

@huaxingao huaxingao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching the problem!

@viirya viirya merged commit a635798 into apache:main Aug 4, 2024
@viirya
Copy link
Copy Markdown
Member Author

viirya commented Aug 4, 2024

Thanks @huaxingao

@viirya viirya deleted the fix_window_op branch August 4, 2024 02:55
himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native window operator should be CometUnaryExec

2 participants