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 built-in function to find duplicates #642

Closed
saig0 opened this issue May 24, 2023 · 4 comments · Fixed by #688
Closed

Add new built-in function to find duplicates #642

saig0 opened this issue May 24, 2023 · 4 comments · Fixed by #688
Assignees
Labels
scope: Camunda 8 Required in the context of Camunda 8 support relates to a support case type: enhancement

Comments

@saig0
Copy link
Member

saig0 commented May 24, 2023

Is your feature request related to a problem? Please describe.
Currently, we don't have a direct function that can return us all the duplicates from a list. We managed to use a workaround with the use of list expressions, functions, and control flows. This functionality would be the exact opposite of distinct values().

// repeated_item_list = 
for x in list return if count(list[item = x]) > 1 then x else null
// distinct_repeated_list
distinct values(repeated_item_list[item != null])

Describe the solution you'd like
Add a new function to find duplicate values in a list.

Signature:

duplicate values(list: list): list

Examples:

duplicate values([1,2,3,2,1])
// [1, 2]

Related issues

@saig0 saig0 added type: enhancement scope: Camunda 8 Required in the context of Camunda 8 labels May 24, 2023
@saig0 saig0 self-assigned this May 24, 2023
@saig0
Copy link
Member Author

saig0 commented May 24, 2023

Workaround

We could use the following expression to find the duplicate values:

distinct values(list[count(index of(list, item)) > 1])

@saig0
Copy link
Member Author

saig0 commented May 24, 2023

@aleksander-dytko please prioritize this feature in the context of this support case.

@saig0 saig0 removed their assignment May 25, 2023
@koevskinikola
Copy link
Member

ZPA triage:

  • @aleksander-dytko do you have any information on the priority of this issue?
  • Is a good candidate for a mob programming session.

@abbasadel
Copy link

@saig0 since this is a support case, I think it makes sense to add "support" label so we don't lose track of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: Camunda 8 Required in the context of Camunda 8 support relates to a support case type: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants