-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Multijoin
feature to community
#4170
Conversation
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTable.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTable.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTable.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTable.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTable.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CharacterArraySource.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CharacterArraySource.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/CharacterArraySource.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ObjectArraySource.java
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/BooleanArraySource.java
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of just the changes since Tuesday.
engine/api/src/main/java/io/deephaven/engine/table/MultiJoinInput.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinStateManager.java
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/by/typed/HasherConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP on review
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Show resolved
Hide resolved
Review should continue with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but maybe this should look like NanosBasedTimeArraySource
, and be a wrapper around a ByteArraySource
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #4272 to track this request.
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
...main/java/io/deephaven/engine/table/impl/multijoin/StaticMultiJoinStateManagerTypedBase.java
Show resolved
Hide resolved
...main/java/io/deephaven/engine/table/impl/multijoin/StaticMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
...main/java/io/deephaven/engine/table/impl/multijoin/StaticMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
...main/java/io/deephaven/engine/table/impl/multijoin/StaticMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
...main/java/io/deephaven/engine/table/impl/multijoin/StaticMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP. Only incremental state managers left.
...io/deephaven/engine/table/impl/multijoin/typed/staticopen/gen/StaticMultiJoinHasherChar.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
...main/java/io/deephaven/engine/table/impl/multijoin/StaticMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed current state of incremental state managers.
...java/io/deephaven/engine/table/impl/multijoin/IncrementalMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
...java/io/deephaven/engine/table/impl/multijoin/IncrementalMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
...java/io/deephaven/engine/table/impl/multijoin/IncrementalMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
...java/io/deephaven/engine/table/impl/multijoin/IncrementalMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
...java/io/deephaven/engine/table/impl/multijoin/IncrementalMultiJoinStateManagerTypedBase.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
.../deephaven/engine/table/impl/multijoin/typed/incopen/gen/IncrementalMultiJoinHasherChar.java
Show resolved
Hide resolved
.../deephaven/engine/table/impl/multijoin/typed/incopen/gen/IncrementalMultiJoinHasherChar.java
Outdated
Show resolved
Hide resolved
.../deephaven/engine/table/impl/multijoin/typed/incopen/gen/IncrementalMultiJoinHasherChar.java
Outdated
Show resolved
Hide resolved
.../deephaven/engine/table/impl/multijoin/typed/incopen/gen/IncrementalMultiJoinHasherChar.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Show resolved
Hide resolved
return QueryPerformanceRecorder.withNugget("multiJoin", | ||
() -> new MultiJoinTableImpl(joinControl, multiJoinInputs)); | ||
|
||
final Table[] tables = Arrays.stream(multiJoinInputs).map(MultiJoinInput::inputTable).toArray(Table[]::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably memoize this, using the memoization cache on the first table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can hold for another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue #4273 to track this.
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinTableImpl.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/MultiJoinModifiedSlotTracker.java
Outdated
Show resolved
Hide resolved
mainKeySources[ii] = InMemoryColumnSource.getImmutableMemoryColumnSource(tableSize, | ||
alternateKeySources[ii].getType(), alternateKeySources[ii].getComponentType()); | ||
mainKeySources[ii].ensureCapacity(tableSize); | ||
} | ||
alternateTableSize = oldTableSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this assignment effect anything? I think it's immaterial, since we'll ignore any hashed values that are greater than the rehashPointer (which is zero). Some part of me wants to assign it to oldTableSize in newAlternate, and back to 1 in clearAlternate, just for cleanliness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oldTableSize
is local to doRehash()
and the newAlternate()
signature is determined by the core hash generation code. Adding the old size as a parameter is a significant change that will affect all existing hashing routines.
The alternative is to push oldTableSize
into a member variable so it can be accessed by newAlternate()
. Do you want me to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you have done is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I don't love that you're clearing it in clearAlternate, and assigning it after newAlternate, I think this is good enough for now.
Labels indicate documentation is required. Issues for documentation have been opened: How-to: https://github.com/deephaven/deephaven.io/issues/2995 |
Port the enterprise
multijoin
feature to allow more efficient computation of multiple table joins.The multiJoin operation collects the set of distinct keys from the input tables, and then joins one row from each of the input tables onto the result. Input tables need not have a match row for each key, but they may not have multiple matching rows for a given key. The operation can be thought of as a merge of the key columns, followed by a selectDistinct and then a series of iterative naturalJoin operations as follows: