{"action":"created","issue":{"url":"https://api.github.com/repos/prestodb/presto/issues/5245","repository_url":"https://api.github.com/repos/prestodb/presto","labels_url":"https://api.github.com/repos/prestodb/presto/issues/5245/labels{/name}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/5245/comments","events_url":"https://api.github.com/repos/prestodb/presto/issues/5245/events","html_url":"https://github.com/prestodb/presto/pull/5245","id":154123542,"number":5245,"title":"Add ZIP function","user":{"login":"lacbs","id":2650088,"avatar_url":"https://avatars.githubusercontent.com/u/2650088?v=3","gravatar_id":"","url":"https://api.github.com/users/lacbs","html_url":"https://github.com/lacbs","followers_url":"https://api.github.com/users/lacbs/followers","following_url":"https://api.github.com/users/lacbs/following{/other_user}","gists_url":"https://api.github.com/users/lacbs/gists{/gist_id}","starred_url":"https://api.github.com/users/lacbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacbs/subscriptions","organizations_url":"https://api.github.com/users/lacbs/orgs","repos_url":"https://api.github.com/users/lacbs/repos","events_url":"https://api.github.com/users/lacbs/events{/privacy}","received_events_url":"https://api.github.com/users/lacbs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/prestodb/presto/labels/changes-requested","name":"changes-requested","color":"fbca04"},{"url":"https://api.github.com/repos/prestodb/presto/labels/CLA%20Signed","name":"CLA Signed","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-05-10T22:45:43Z","updated_at":"2016-05-11T15:49:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/5245","html_url":"https://github.com/prestodb/presto/pull/5245","diff_url":"https://github.com/prestodb/presto/pull/5245.diff","patch_url":"https://github.com/prestodb/presto/pull/5245.patch"},"body":"New scalar function: `zip`\r\nAggregate elements of the arrays passed as arguments into rows. The M-th element of the N-th argument will be the N-th field of the M-th output element.\r\nIf the arguments have uneven length, the length of the output will be the biggest length, missing values are filled with NULL. \r\nNull arguments are treated like empty arrays.\r\nSimilar to the combined use of UNNEST and ARRAY_AGG or python's `itertools.zip_longest`.\r\n\r\nChoosing to pad with NULLs, like `zip_longest` as that's similar to the behavior of UNNEST where it pads with NULLs.\r\n\r\nThe class actually registers a certain number functions, since it would be (unnecessarily) complicated to have variable number of type constraints in the framework. So, in this case, we have:\r\n- `zip(array[T1], array[T2]): array(row(T1, T2))`\r\n- `zip(array[T1], array[T2], array[T3]): array(row(T1, T2, T3))`\r\n- `zip(array[T1], array[T2], array[T3], array[T4]): array(row(T1, T2, T3, T4))`\r\nIt's easily modifiable by changing MIN_ARITY / MAX_ARITY in `ZipFunction`.\r\n\r\nIf more than `MAX_ARITY` arguments are necessary in the use of zip, you can use nested calls:\r\n- `zip(array[T1], zip(array[T2], array[T3])): array(row(T1, row(T2, T3)))`"},"comment":{"url":"https://api.github.com/repos/prestodb/presto/issues/comments/218502078","html_url":"https://github.com/prestodb/presto/pull/5245#issuecomment-218502078","issue_url":"https://api.github.com/repos/prestodb/presto/issues/5245","id":218502078,"user":{"login":"lacbs","id":2650088,"avatar_url":"https://avatars.githubusercontent.com/u/2650088?v=3","gravatar_id":"","url":"https://api.github.com/users/lacbs","html_url":"https://github.com/lacbs","followers_url":"https://api.github.com/users/lacbs/followers","following_url":"https://api.github.com/users/lacbs/following{/other_user}","gists_url":"https://api.github.com/users/lacbs/gists{/gist_id}","starred_url":"https://api.github.com/users/lacbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacbs/subscriptions","organizations_url":"https://api.github.com/users/lacbs/orgs","repos_url":"https://api.github.com/users/lacbs/repos","events_url":"https://api.github.com/users/lacbs/events{/privacy}","received_events_url":"https://api.github.com/users/lacbs/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T15:49:50Z","updated_at":"2016-05-11T15:49:50Z","body":"Thanks, I updated addressing the comments. :)"}}