Coder Social home page Coder Social logo

Comments (9)

rschlussel avatar rschlussel commented on June 26, 2024 2

I don't know what the behavior is supposed to be for all these cases (how do you scale -1 and 1 so that they sum to 1?). But the variety of behaviors is a bug and some of these clearly should be summing to 1. e.g. the second example should be returning {1=null, 2=1} and the third should be returning `{1=0.5, 2=0.5}.

The function is definitely lacking tests for any of these examples. https://github.com/prestodb/presto/blob/master/presto-main/src/main/java/com/facebook/presto/operator/scalar/sql/MapNormalizeFunction.java is the function and https://github.com/prestodb/presto/blob/master/presto-main/src/test/java/com/facebook/presto/operator/scalar/sql/TestMapNormalize.java has the tests.

from presto.

rschlussel avatar rschlussel commented on June 26, 2024 1

(I'll add that this is the first time i've seen this function, so my opinion isn't based on any special knowledge).

from presto.

steveburnett avatar steveburnett commented on June 26, 2024 1

Thanks for the tag @mbasmanova! Following for potential doc fix PR material.

from presto.

kaikalur avatar kaikalur commented on June 26, 2024 1

My main goals here are a) let's not unnecessarily implement it natively in prestissimo and b) to show how to pull out nested lambdas that can be outside the loop.

from presto.

mbasmanova avatar mbasmanova commented on June 26, 2024

I'm going to match these semantics in Velox and document them clearly: facebookincubator/velox#9086

from presto.

kaikalur avatar kaikalur commented on June 26, 2024

(I'll add that this is the first time i've seen this function, so my opinion isn't based on any special knowledge).

There was an internal Spark UDF with exact same semantics and someone coded it up in presto. I see it used quite a bit though here in prod.

from presto.

tdcmeehan avatar tdcmeehan commented on June 26, 2024

@kaikalur given that this was developed to match some sort of internal Spark UDF at Meta and it has strange semantics, does it make sense to deprecate this function (we can think of a sensible deprecation strategy)? It could be ported to an internal UDF for Meta?

from presto.

kaikalur avatar kaikalur commented on June 26, 2024

@kaikalur given that this was developed to match some sort of internal Spark UDF at Meta and it has strange semantics, does it make sense to deprecate this function (we can think of a sensible deprecation strategy)? It could be ported to an internal UDF for Meta?

I'm ok with making it meta only! It's a rather strange UDF

from presto.

tdcmeehan avatar tdcmeehan commented on June 26, 2024

OK. In terms of deprecation, I propose we introduce a feature toggle for this function, and over the course of a few releases change the default from true to false. We can provide a warning in the release notes (linking to a new issue) indicating we are beginning to deprecate the function. Once it's disabled for a few releases we can delete it with final announcement in the release notes.

from presto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.