Giter Site home page Giter Site logo

Bug: Applying aggregation functions on select() to some fields and simple projection to other causes runtime errors about frameless HOT 7 CLOSED

imarios avatar imarios commented on June 4, 2024
Bug: Applying aggregation functions on select() to some fields and simple projection to other causes runtime errors

from frameless.

Comments (7)

kanterov avatar kanterov commented on June 4, 2024 1

@imarios it seems I fixed it in #123

from frameless.

OlivierBlanvillain avatar OlivierBlanvillain commented on June 4, 2024

That should be a compile time error, right?

I think TypedAggregateAndColumn shoudn't be <: TypedColumn, or every thing defined in AggregateFunctions becomes usable in select...

from frameless.

kanterov avatar kanterov commented on June 4, 2024

Hm.. I remember it worked before, probably something was changed, and we have tests only for agg case. We need to add tests and adjust types. And if it isn't relevant anymore for any instance of TypedAggregateAndColumn, then we can remove it.

from frameless.

imarios avatar imarios commented on June 4, 2024

Maybe we shouldn't have TypedAggregateAndColumn to be both a column and an aggregated I agree. What was the initial idea of having it as both?

from frameless.

kanterov avatar kanterov commented on June 4, 2024

At some point in Spark you could select(sum("a")), the problem there is a name collision between sum in select of TypedColumn and sum in agg of TypedAggregate, the idea was to create sort of union type for it :).

from frameless.

imarios avatar imarios commented on June 4, 2024

Obviously this is still an issue in Spark, if you do the same thing with datasets you get a nice runtime error. The issue here is that we are trying to give you a compiler error if things should fail at runtime. So now we need to think how we can do that here.

Running aggregations in select is useful when you don't really want any subgroups to be aggregated but you need the entire thing to be aggregated. It's like saying groupBy(no-thanks).agg(sum("i")).

What if we have a syntax like this ds.forAgg.agg( sum(ds('i)), max(ds('i)), etc. )?

This assumes that we no longer allow aggregation on select. So we might get the additional simplification of TypedAggregateAndColumn to just TypedAggregate.

from frameless.

OlivierBlanvillain avatar OlivierBlanvillain commented on June 4, 2024

Fixed in #123/#129.

from frameless.

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.