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

Additional higher order functions to work with arrays #2942

Closed
wants to merge 8 commits into from

Conversation

astudnev
Copy link
Contributor

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

I added couple functions to work with arrays, as i found no way to implement the functionality using the provided array functions.

  1. cumulative sum with limit ( if acc value less than 0, zero is accumulated ). Ideal solution would be to implement a reduce function, which accepts 2 parameters - array and accumulating value, but i fail to program so far

  2. difference between values in array. This could be implemented using mapArray and couple other functions, but this will be nice to do in one call

Copy link
Contributor

@VadimPlh VadimPlh left a comment

Choose a reason for hiding this comment

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

Hi, thanks for your PR!

  1. Could you add tests, please? (You can see examples here and tutorial here )
  2. Delete ci/default-config from your pr.
  3. Please, add info about new functions to the beginning of the file.
  4. On this simple test SELECT arrayDifference([0, 100, 2]) result is [0,100,18446744073709551518]. I think the result of arrayDifference() should always be a sign.

@alexey-milovidov
Copy link
Member

Do you have a time to do the required modifications?

@VadimPlh
Copy link
Contributor

#3009 Fix

@VadimPlh VadimPlh closed this Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants