Comments (9)
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.
(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.
Thanks for the tag @mbasmanova! Following for potential doc fix PR material.
from presto.
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.
I'm going to match these semantics in Velox and document them clearly: facebookincubator/velox#9086
from presto.
(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.
@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 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.
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)
- CI job SingleStore tests failing HOT 1
- Add ARM64 Support for Building Prestissimo Docker Image on Mac M1 HOT 3
- Backport https://github.com/prestodb/presto/pull/22926 into 0.285, 0.286 and 0.287
- Pushdown (partial) rowNumber under join
- Flaky test: TestMemoryManager.testReservedPoolDisabledMultiCoordinator
- Add documentation for Geospatial types in main types page HOT 1
- For each agg function with input param as <T>, Add an equivalent agg function with input param as array<T> HOT 1
- [docs] Combine the descriptions of session property with configuration property for history based optimization
- singlestore-dockerized-tests job is failing often HOT 1
- Getting error while building in intelli idea HOT 1
- How to build a custom connector?
- How to build and run presto in intellij idea? HOT 1
- [native] Flaky test Taskmanager.buildSpilledDirectory Failrue
- Writer scaling fails for Parquet with smaller files HOT 5
- Flaky test: TestNoisySumGaussianLongAggregation.testNoisySumGaussianLongClippingSomeNoiseScaleWithinSomeStd() HOT 1
- Iceberg $changelog read fails on table with only one snapshot version.
- Pushdown partial TopN and RowNumber into UNION
- Inline cosntant cross joins
- Allow Presto Coordinator to ignore (not throw) negative runtime metrics.
- Update the MongoDB connector to support binData data type HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presto.