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 new function mapExtractKeyLike #30793

Merged

Conversation

lingtaolf
Copy link
Contributor

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
New function mapExtractKeyLike to get the map only kept elements matched specified pattern.

Usage
Table data:

┌─a─────────────────────────┐
│ {'abc':'abc','def':'def'} │
│ {'hij':'hij','klm':'klm'} │
└───────────────────────────┘
  

Sql:

SELECT mapExtractKeyLike(a, 'a%') FROM test;

Results:

┌─mapExtractKeyLike(a, 'a%')─┐
│ {'abc':'abc'}              │
│ {}                         │
└────────────────────────────┘

@robot-clickhouse robot-clickhouse added doc-alert pr-feature Pull request with new product feature labels Oct 28, 2021
@kssenii kssenii self-assigned this Oct 28, 2021
Copy link
Member

@kssenii kssenii left a comment

Choose a reason for hiding this comment

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

LGTM

src/Functions/map.cpp Outdated Show resolved Hide resolved
Co-authored-by: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com>
@kssenii kssenii merged commit 2050d0a into ClickHouse:master Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants