Comments (3)
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.
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.
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)
- A multi-release jar maybe better, if no extra classes for Java 9+ HOT 1
- Change Tuple v1 to fst and v2 to snd HOT 3
- IllegalStateException on Seq#append after Seq#forEach HOT 9
- Implement shortcut for 0.0 and 1.0 percentile calculations HOT 3
- Add Seq.toMap() with mergeFunction HOT 1
- Add support for PERCENTILE_CONT semantics HOT 6
- Add @param javadoc to Agg methods
- Add Agg.covarianceDouble HOT 1
- Add Agg.correlationDouble()
- Add Predicate<Tuple[N]<T...>> Tuple.predicate(Predicate[N]<T...>) HOT 5
- A strange issue on java 8: consumer isn't being called HOT 1
- Add Gradle build with Error-Prone in addition to maven HOT 3
- Add set of Predicates 0-16 (similar to Function 0-16) HOT 1
- Some interesting additions (Predicates, fixed Javadoc errors, Wrapped/Safe version of Unchecked/Sneaky) HOT 4
- Wrong result for Agg.regrR2Double() HOT 6
- Fix Javadoc errors, Error prone errors and most obvious warnings HOT 9
- Excess type variables in Agg::bitAndInt and Agg::bitAndLong
- Replace <code><pre> by <pre><code> in Javadoc HOT 1
- Release 0.9.15 HOT 3
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 jool.