-
Notifications
You must be signed in to change notification settings - Fork 706
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(functions): add map_contains_key scalar function #15465
feat(functions): add map_contains_key scalar function #15465
Conversation
When performing unit tests, I encountered a problem: cargo test --package databend-common-functions --test it -- scalars::map::test_map --exact --show-output error: running 1 test
test scalars::map::test_map ... FAILED
successes:
successes:
failures:
---- scalars::map::test_map stdout ----
thread 'scalars::map::test_map' panicked at /Users/hanfox/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/goldenfile-1.6.0/src/differs.rs:15:5:
assertion failed: `(left == right)`'
left: `"ast : map([], [])\nraw expr : map(array(), array())\nchecked expr : map<Array(Nothing), Array(Nothing)>(array<>(), array<>())\noptimized expr : {} :: Map(Nothing)\noutput type : Map(..."` (truncated)
right: `"ast : map([], [])\nraw expr : map(array(), array())\nchecked expr : map<Array(Nothing), Array(Nothing)>(array<>(), array<>())\noptimized expr : {} :: Map(Nothing)\noutput type : Map(..."` (truncated)
Differences (-left|+right):
output type : Boolean
output domain : {TRUE}
output : true
+ I have two areas of doubt:
Thank you for taking the time to assist me with this task. |
Hi, @hanxuanliang thanks for your contribution. The unit test is failed because you missed some blank lines, just add those lines will pass the test.
you should also modify the function list file
You can run |
src/query/functions/tests/it/scalars/testdata/function_list.txt
Outdated
Show resolved
Hide resolved
d5704bd
to
5d38461
Compare
tests/sqllogictests/suites/query/functions/02_0074_function_map.test
Outdated
Show resolved
Hide resolved
tests/sqllogictests/suites/query/functions/02_0074_function_map.test
Outdated
Show resolved
Hide resolved
tests/sqllogictests/suites/query/functions/02_0074_function_map.test
Outdated
Show resolved
Hide resolved
tests/sqllogictests/suites/query/functions/02_0074_function_map.test
Outdated
Show resolved
Hide resolved
this PR is almost OK, please fix sql logic test reviews. |
But when I was running the SQL logic test locally, I encountered a problem: first I need to start databend server: Databend Metasrv started
panicked at src/meta/client/src/lib.rs:47:28:
run `git fetch --tags` to solve this error,
to learn more about this error, please visit https://crates.io/crates/semver: Error("unexpected character 'D' while parsing major version number")
0: std::backtrace_rs::backtrace::libunwind::trace
at /rustc/8ace7ea1f7cbba7b4f031e66c54ca237a0d65de6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
1: std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/8ace7ea1f7cbba7b4f031e66c54ca237a0d65de6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
...
Databend Query start failure, cause: MetaServiceError. Code: 2001, Text = meta-client dedicated runtime error: tokio::sync::oneshot::error::RecvError: channel closed while: when recv resp from MetaGrpcClient worker. An error occurred when starting databend-query. I initially thought it was an issue with port 8000, but even after switching to port 8001, the same problem persisted. |
databend use github tags to calculate the version, otherwise the meta and query version is incorrect, which will cause the startup failed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @hanxuanliang Thanks for your contribution.
@b41sh Thank you for your help, I can successfully complete the development.. At the same time, during the development, I feel that the develop process of scalar func is not very clear in the documentation. Is there also support to contribute? |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Tests
Type of change
This change is