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

add soundex function #3446

Merged
merged 11 commits into from
Dec 19, 2021
Merged

add soundex function #3446

merged 11 commits into from
Dec 19, 2021

Conversation

bestgopher
Copy link
Contributor

@bestgopher bestgopher commented Dec 13, 2021

I hereby agree to the terms of the CLA available at: https://databend.rs/policies/cla/

Summary

Summary about this PR

Changelog

  • New Feature

Related Issues

Fixes #issue

Test Plan

Unit Tests

Stateless Tests

@databend-bot databend-bot added pr-bugfix this PR patches a bug in codebase pr-doc-fix pr-feature this PR introduces a new feature to the codebase labels Dec 13, 2021
@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@vercel
Copy link

vercel bot commented Dec 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/databend/databend/DzdPyQUy5fHD3sqAjqumDm2jGJbJ
✅ Preview: https://databend-git-fork-bestgopher-main-databend.vercel.app

[Deployment for fefc821 canceled]

@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@databend-bot databend-bot added need-review pr-build this PR changes build/testing/ci steps labels Dec 13, 2021
@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify
Copy link
Contributor

mergify bot commented Dec 13, 2021

This pull request has merge conflicts that must be resolved before it can be merged. @bestgopher please rebase it 🙏

@bestgopher
Copy link
Contributor Author

bestgopher commented Dec 13, 2021

Fixes #3045

@sundy-li sundy-li removed pr-bugfix this PR patches a bug in codebase pr-other pr-build this PR changes build/testing/ci steps need-review labels Dec 13, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2021

Codecov Report

Merging #3446 (4359105) into main (db28c02) will decrease coverage by 0%.
The diff coverage is 6%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3446   +/-   ##
=====================================
- Coverage     61%     60%   -1%     
=====================================
  Files        624     625    +1     
  Lines      34781   34860   +79     
=====================================
+ Hits       21226   21252   +26     
- Misses     13555   13608   +53     
Impacted Files Coverage Δ
common/functions/src/scalars/strings/soundex.rs 5% <5%> (ø)
common/functions/src/scalars/strings/string.rs 97% <100%> (+<1%) ⬆️
common/management/src/cluster/cluster_mgr.rs 78% <0%> (-1%) ⬇️
query/src/common/mod.rs 85% <0%> (+14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db28c02...4359105. Read the comment docs.

};
}
DataType::Null => Ok(DataColumn::Constant(DataValue::Null, input_rows)),
_ => {
Copy link
Member

Choose a reason for hiding this comment

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

I did not know why this branch returns an empty String column.

Maybe we should cast the column into String column in previous.


// Null/Primitive array can cast into String column.
let column = columns[0].cast_with_type(DataType::String);
let column = column.string()?;

match column {
   Constant => {},
   Array(x) => {}
}


fn return_type(&self, args: &[DataType]) -> Result<DataType> {
match args[0] {
DataType::Null => Ok(DataType::Null),
Copy link
Member

Choose a reason for hiding this comment

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

  if args[0].is_numeric() || args[0] == DataType::String || args[0] == DataType::Null {
            Ok(DataType::String)
        } else {
            Err(ErrorCode::IllegalDataType(format!(
                "Expected string/numeric, but got {}",
                args[0]
            )))
        }

@BohuTANG
Copy link
Member

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2021

update

✅ Branch has been successfully updated

Hey, I reacted but my real name is @Mergifyio

@BohuTANG
Copy link
Member

Thank you @bestgopher

@BohuTANG BohuTANG merged commit 4a88729 into datafuselabs:main Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants