Coder Social home page Coder Social logo

Comments (13)

amitkdutta avatar amitkdutta commented on September 27, 2024

CC: @tdcmeehan @aditi-pandit @majetideepak

from presto.

mbasmanova avatar mbasmanova commented on September 27, 2024

CC: @feilong-liu @mlyublena @kaikalur

from presto.

AaronGhebretinsae avatar AaronGhebretinsae commented on September 27, 2024

it seems like the 6th parameter is marked false when it should be true. is that the only problem? or am I misunderstanding the issue?

from presto.

mbasmanova avatar mbasmanova commented on September 27, 2024

it seems like the 6th parameter is marked false when it should be true. is that the only problem? or am I misunderstanding the issue?

This is the only issue.

from presto.

feilong-liu avatar feilong-liu commented on September 27, 2024

Should return same result across multiple runs.

Why it should return the same result? arbitrary is supposed to be ok to return any values right?

from presto.

mbasmanova avatar mbasmanova commented on September 27, 2024

@feilong-liu The expectation is that arbitrary(x ORDER BY x) would always return same result, no?

from presto.

feilong-liu avatar feilong-liu commented on September 27, 2024

@feilong-liu The expectation is that arbitrary(x ORDER BY x) would always return same result, no?

Not sure about this. I think when the user use arbitrary function, it already specifies the intention that an arbitrary value is good.

from presto.

kaikalur avatar kaikalur commented on September 27, 2024

@feilong-liu The expectation is that arbitrary(x ORDER BY x) would always return same result, no?

No arbitrary definitely does not return the same result. ORDER BY is done in a very hacky way because its expensive (prevents partial agg :() so we do some filtering in the plan to say certain operations are not affected by order by (in fact we use allowlist). So only things like array_agg etc. respect it.

from presto.

kaikalur avatar kaikalur commented on September 27, 2024

see:

https://github.com/prestodb/presto/blob/master/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PruneOrderByInAggregation.java#L63

That uses implementation property to do planning!

from presto.

mbasmanova avatar mbasmanova commented on September 27, 2024

Here is what Presto documentation says:

https://prestodb.io/docs/current/functions/aggregate.html

"Some aggregate functions such as array_agg() produce different results depending on the order of input values. This ordering can be specified by writing an ORDER BY Clause within the aggregate function:"

My reading of this statement suggests that any function whose results depend on order of inputs (arbitrary, min_by, max_by, etc.) can be forced to return same result if we add an ORDER BY.

Furthermore, I understand that evaluating aggregate functions on sorted inputs is expensive and it makes sense to skip ORDER BY if it is not needed. For example, the results of min/max don't depend on whether inputs are sorted, hence, it is safe to drop ORDER BY. However, the results of min_by, max_by, arbitrary do depend on the order of inputs, hence, it is not safe to drop ORDER BY.

from presto.

atikkk avatar atikkk commented on September 27, 2024

Can you help me to setup project locally

from presto.

mbasmanova avatar mbasmanova commented on September 27, 2024

Can you help me to setup project locally

@tdcmeehan @majetideepak Tim, Deepak, do we have instructions somewhere?

from presto.

tdcmeehan avatar tdcmeehan commented on September 27, 2024

@atikkk please read through CONTRIBUTING. If you have any questions please ask in #dev in our Slack channel (found from prestodb.io).

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.