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 map_zip_with Presto lambda function #2711

Closed
wants to merge 1 commit into from

Conversation

mbasmanova
Copy link
Contributor

No description provided.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 2, 2022
@netlify
Copy link

netlify bot commented Oct 2, 2022

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 618edd1
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/633c995b9729230008492d41

@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

mbasmanova added a commit to mbasmanova/velox-1 that referenced this pull request Oct 4, 2022
Summary: Pull Request resolved: facebookincubator#2711

Differential Revision: D40010436

Pulled By: mbasmanova

fbshipit-source-id: 48de1a2ce59b1869d08e847bd68a889b69a78d82
const auto numLeft = leftSorted.size();
const auto numRight = rightSorted.size();

if (numLeft == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like these 2 if blocks can be omitted, if one side is empty, it will skip the while and jump to one of the for loops later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Let me change that.


// Make sure already populated entries in newElements do not get
// overwritten.
VarSetter finalSelection(
Copy link
Contributor

Choose a reason for hiding this comment

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

VarSetter is renamed in #2399. We need to rebase to newest main.

mbasmanova added a commit to mbasmanova/velox-1 that referenced this pull request Oct 4, 2022
Summary: Pull Request resolved: facebookincubator#2711

Differential Revision: D40010436

Pulled By: mbasmanova

fbshipit-source-id: 5e0529ddb31655308245f170d9f8eeaed29a69b1
Summary: Pull Request resolved: facebookincubator#2711

Reviewed By: Yuhta

Differential Revision: D40010436

Pulled By: Yuhta

fbshipit-source-id: 054de3325c0104c9307146c78776df9d31c75d2c
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40010436

mbasmanova added a commit to mbasmanova/velox-1 that referenced this pull request Oct 4, 2022
Summary: Pull Request resolved: facebookincubator#2711

Differential Revision: D40010436

Pulled By: mbasmanova

fbshipit-source-id: 7c963fea21427e2c50296b1754a9b8776bd88a04
mbasmanova added a commit to mbasmanova/velox-1 that referenced this pull request Oct 4, 2022
Summary: Pull Request resolved: facebookincubator#2711

Differential Revision: D40010436

Pulled By: mbasmanova

fbshipit-source-id: c4f578d5de3c4261b533d607a7a4fe5d08cd6022
Copy link
Contributor

@bikramSingh91 bikramSingh91 left a comment

Choose a reason for hiding this comment

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

Looks good, just one small question

(k, v1, v2) -> (v1, v2));
SELECT map_zip_with(MAP(ARRAY['a', 'b', 'c'], ARRAY[1, 8, 27]), -- {a -> a1, b -> b4, c -> c9}
MAP(ARRAY['a', 'b', 'c'], ARRAY[1, 2, 3]),
(k, v1, v2) -> k || CAST(v1/v2 AS VARCHAR));
Copy link
Contributor

Choose a reason for hiding this comment

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

is the '||' valid syntax for concatenation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok, I only ask because I tried using it in a unit test and our expression parser threw an error: "Function:resolveScalarFunctionType, Expression: Scalar function doesn't exist: ||", should we add support for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bikramSingh91 Sure. That would be handy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Filed #2747

mbasmanova added a commit to mbasmanova/velox-1 that referenced this pull request Oct 5, 2022
Summary: Pull Request resolved: facebookincubator#2711

Differential Revision: D40010436

Pulled By: mbasmanova

fbshipit-source-id: 857a5cfbe17c0f6206f3be2c98612a368dd66350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants