Conversation
Reviewer's GuideEnhance lambda return type handling by catching argument count mismatches, applying coercion within ExpressionAnalyzer when actual and expected return types differ, enabling return type coercion in the SignatureBinder, updating comparator function signatures to use bigint, and adding targeted tests for array_sort lambda return type coercion. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
0935468 to
36df319
Compare
|
@tdcmeehan This is a simple fix if you change the Velox lambda function signature to return integer (from bigint). We validated that it works with the side car. |
@kgpai is anyone working to add that to Velox? |
I agree — changing the Velox lambda function signature to return integer instead of bigint is a straightforward fix. That said, I also think we should support type coercion in lambdas more generally, so this kind of mismatch doesn’t surface again. |
|
@tdcmeehan Yes I am working on it - will have a PR out soon. |
|
Sounds good, so I'll remove the first commit from this PR. |
Description
Currently, Presto won't apply any coercion on the return type within a lambda. We should make it more flexible.
Motivation and Context
Recently, array_sort with transform was added to Presto, and this can cause conflicts with the older comparator approach.
Impact
Fix issues with array_sort and potential future issues with lambdas.
Test Plan
Included unit tests.
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.