Skip to content

Instantly share code, notes, and snippets.

@den-crane
Created April 26, 2019 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save den-crane/515ccb4d3b85d6058389e02d6af895c1 to your computer and use it in GitHub Desktop.
Save den-crane/515ccb4d3b85d6058389e02d6af895c1 to your computer and use it in GitHub Desktop.
CH arrays (K/V) iteration by arrayFilter
Right:
select arrayFilter((v, k) -> k = 'a', values, keys) from
(select ['a','a','b','a'] keys, [1,2,3,4] values)
Wrong:
select arrayMap(i -> values[i], arrayFilter( i -> keys[i] = 'a', arrayEnumerate(keys))) from
(select ['a','a','b','a'] keys, [1,2,3,4] values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment