Giter Club home page Giter Club logo

Comments (3)

lukaseder avatar lukaseder commented on July 21, 2024

Would a zipWithIndexAndSize() make sense for you or is there a way around that I'm not seeing right now?

The fact that there is a keyword and in your method name hints at this practice not scaling at all in terms of API design. If we did this here, then we'd have to do it everywhere, as someone might eventually request crossJoinAndSize() or flatMapAndSize(), or just plain zipWithSize()

When in fact, you could just write:

seq.zipWithIndex()
   .map(t -> tuple(t.v1, t.v2, list.size()))

Or, if you don't have access to the original list, use jOOλ's window API:

seq.window()
   .map(w -> tuple(w.value(), w.rowNumber(), w.count()));

from jool.

Spike2050 avatar Spike2050 commented on July 21, 2024

Hi, thx for the feedback.

Window functions! Seq has window functions! I cant see this here. And I couldn't see it on your github page. I found your blog post after googling it. How did I not know this? Why isn't that advertised on your github page?

from jool.

lukaseder avatar lukaseder commented on July 21, 2024

Why isn't that advertised on your github page?

I'm still reluctant to advertise it too much, because the implementation is not optimised as much as it could have been. Once you use window frames, algorithms tend to be O(n^2) instead of O(n log n).

Some limitations include:

There's a lot of research in this area, which we have currently not investigated: http://vldb.org/pvldb/vol5/p1244_yucao_vldb2012.pdf

from jool.

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.