Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support spaceship operator (<=>) support (alias for IS NOT DISTINCT FROM #14187

Merged

Conversation

Spaarsh
Copy link
Contributor

@Spaarsh Spaarsh commented Jan 18, 2025

Which issue does this PR close?

Closes #14098.

Rationale for this change

This change adds support for the Spaceship operator (<=>) by mapping it to the IsNotDistinctFrom operator and adds tests for the operator as well.

What changes are included in this PR?

  1. Mapping of Spaceship operator (<=>) with IsNotDistinctFrom
  2. Adds tests for the Spaceship operator
  3. Sanity test for the Spaceship operator

Are these changes tested?

Yes. Tests have been added in the sqllogictest/test_files/expr.slt as well.

Are there any user-facing changes?

The users can now use the Spaceship operator (<=>) in their queries.

@github-actions github-actions bot added sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Jan 18, 2025
@alamb alamb changed the title 14098/enhancement/add spaceship operator support Support spaceship operator (<=>) support (alias for IS NOT DISTINCT FROM Jan 18, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @Spaarsh

It would also be nice to add a section to the doc about this operator: https://datafusion.apache.org/user-guide/sql/operators.html#comparison-operators

However, we can do the docs as a follow on PR as well

@Spaarsh
Copy link
Contributor Author

Spaarsh commented Jan 19, 2025

@alamb sure. I will open a PR for updating the docs linked from your comment.

Could you also weigh-in on the sanity test as well? @ion-elgreco and I have discussed it here.

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Great PR thanks @Spaarsh

@comphead
Copy link
Contributor

Filed #14203 for documentation

@comphead comphead merged commit 52fb1a0 into apache:main Jan 19, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spaceship operator (<=>) not supported
3 participants