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

feat:implement calcite style 'levenshtein' string function #8168

Merged
merged 16 commits into from
Nov 17, 2023

Conversation

Syleechan
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

https://calcite.apache.org/docs/reference.html#:~:text=LEVENSHTEIN(string1%2C%20string2,string1%20and%20string2

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added logical-expr Logical plan and expressions physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt) labels Nov 14, 2023
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 for the contribution @Syleechan . I think we can avoid the new dependency but otherwise this looks great

@@ -67,6 +67,7 @@ regex = { version = "1.8", optional = true }
sha2 = { version = "^0.10.1", optional = true }
unicode-segmentation = { version = "^1.7.1", optional = true }
uuid = { version = "^1.2", features = ["v4"] }
edit-distance = "2.1.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can avoid this new dependency by either reusing our existing implementation (see below)

# Conflicts:
#	datafusion/proto/proto/datafusion.proto
#	datafusion/proto/src/generated/pbjson.rs
#	datafusion/proto/src/generated/prost.rs
#	datafusion/proto/src/logical_plan/from_proto.rs
@Syleechan
Copy link
Contributor Author

@alamb thanks, I have changed to use exsiting implementation. But the code checks maybe something wrong, I have used the checking command to run local all have passed.

@alamb
Copy link
Contributor

alamb commented Nov 15, 2023

I believe the failures are due to some logical conflicts since fixed in #8187

Updating to the latest main should work I think

# Conflicts:
#	datafusion/proto/proto/datafusion.proto
#	datafusion/proto/src/generated/pbjson.rs
#	datafusion/proto/src/generated/prost.rs
@Syleechan
Copy link
Contributor Author

@alamb thanks, it works. And wait for your code review.

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.

looks good to me -- thank you @Syleechan

@Ted-Jiang Ted-Jiang merged commit 7618e4d into apache:main Nov 17, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants