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

feat(function): Add MAP() signature for MapFunction. #12115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spershin
Copy link
Contributor

Summary:
Some queries can fail with the following error:
Scalar function presto.default.map not registered with arguments: ()

MAP() is supported in Presto and works by creating an emtpy map of the output type.
Add the same capability to Velox.

Differential Revision: D68359107

Summary:
Some queries can fail with the following error:
Scalar function presto.default.map not registered with arguments: ()

MAP() is supported in Presto and works by creating an emtpy map of the output type.
Add the same capability to Velox.

Differential Revision: D68359107
@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 Jan 17, 2025
@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 4b6348d
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/678aed4c7c38af0008f2b252

@spershin spershin changed the title feat: Add MAP() signature for MapFunction. feat(functions): Add MAP() signature for MapFunction. Jan 17, 2025
Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

LGTM. Please make sure to have a full fuzzer run .

@@ -591,6 +591,12 @@ class MapVector : public ArrayVectorBase {
type->childAt(1)->toString());
}

/// Constructor for creating an empty MapVector for the given rows.
MapVector(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should something like this exist for arrays and rows ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kgpai
Arrays have ARRAY[], which I haven't seen any errors for so far.
Similarly Rows - haven't seen errors either.

Maybe they will fail too if coordinator sends the expression rather than constant blob, like in the case we have discovered.

In any case, these would be separate changes.

@spershin
Copy link
Contributor Author

LGTM. Please make sure to have a full fuzzer run .

@kgpai
Will fuzzer even create anything like MAP()?

@spershin spershin changed the title feat(functions): Add MAP() signature for MapFunction. feat(function): Add MAP() signature for MapFunction. Jan 18, 2025
@spershin
Copy link
Contributor Author

@kgpai
@kagamiori

Biased Expression Fuzzer with Only Added/Updated Functions and Presto as source of truth has failure:
https://github.com/facebookincubator/velox/actions/runs/12838678726/job/35808153214?pr=12115

What's interesting is that there is map(c0, c1) present in the query.

ExpressionVerifier.cpp:318, Function:verify, Expression: Reference path throws for query: SELECT try(map(c0, c1)) as p0, try(row_number) as p1 FROM (t_values)

It can be related to the change. How do I debug and fix fuzzer failures?

@spershin spershin requested review from kagamiori and kgpai January 18, 2025 04:05
@kagamiori
Copy link
Contributor

@kgpai @kagamiori

Biased Expression Fuzzer with Only Added/Updated Functions and Presto as source of truth has failure: https://github.com/facebookincubator/velox/actions/runs/12838678726/job/35808153214?pr=12115

What's interesting is that there is map(c0, c1) present in the query.

ExpressionVerifier.cpp:318, Function:verify, Expression: Reference path throws for query: SELECT try(map(c0, c1)) as p0, try(row_number) as p1 FROM (t_values)

It can be related to the change. How do I debug and fix fuzzer failures?

The fuzzer was affected by a recent change for the join fuzzer: #11801.
@DanielHunte, could you take a look and help fix this bug?

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. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants