Skip to content
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

Port DH-11168: Indexing enhancements to Community. #3851

Merged
merged 183 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
ce98a62
Compiles, many tests failing.
lbooker42 May 16, 2023
b557b94
Existing tests passing, may need to port additional tests.
lbooker42 May 17, 2023
613a5b0
Tests passing, but getting 'too many files open' error on MacOS in Te…
lbooker42 May 19, 2023
7a4a1c6
Add'l changes.
lbooker42 May 22, 2023
d612c3d
Import change.
lbooker42 May 22, 2023
589adc2
Why does this fail?
lbooker42 May 22, 2023
6b210ad
Rebased to main.
lbooker42 Jun 8, 2023
dc669ea
Tests passing lcoally.
lbooker42 Jun 12, 2023
a7a0756
More changes.
lbooker42 Jun 12, 2023
16f3fe8
Large merge
lbooker42 Oct 12, 2023
48de58c
So close to building, much testing needed.
lbooker42 Oct 19, 2023
4962ee3
More small stuff.
lbooker42 Oct 19, 2023
d787ef5
rebase attempt
lbooker42 Oct 19, 2023
429347d
Pre-review changes.
lbooker42 Oct 19, 2023
c62d524
local changes.
lbooker42 Oct 19, 2023
de5fb92
Remove the comparison based on wrong assumption (#4672)
jmao-denver Oct 19, 2023
7c98a17
Cleanup, removed unneeded files.
lbooker42 Oct 20, 2023
4c8c31c
More cleanup
lbooker42 Oct 20, 2023
096ddc8
Even more cleanup.
lbooker42 Oct 20, 2023
3728027
Even more cleanup.
lbooker42 Oct 20, 2023
ffd9369
Even more cleanup.
lbooker42 Oct 20, 2023
df9fbc5
Even more cleanup.
lbooker42 Oct 20, 2023
fc5019b
Bug fixes and improvements.
lbooker42 Oct 23, 2023
a849c97
Small changes.
lbooker42 Oct 24, 2023
e27b196
PR comments and some bugfixes.
lbooker42 Oct 26, 2023
07b2cc2
Minor changes.
lbooker42 Oct 27, 2023
82f7bdc
More changes.
lbooker42 Oct 27, 2023
3469269
More tests passing.
lbooker42 Oct 31, 2023
fba2ccb
More tests passing.
lbooker42 Nov 2, 2023
9cdb07f
More tests passing.
lbooker42 Nov 3, 2023
74826f5
More PR comments addressed.
lbooker42 Nov 6, 2023
2982b37
Update.
lbooker42 Nov 9, 2023
39d5ce1
Morning changes.
lbooker42 Nov 9, 2023
e1593ca
End of week.
lbooker42 Nov 11, 2023
c165c8c
Testing bug fix.
lbooker42 Nov 13, 2023
1d4a295
Some bug fixes and improvements
lbooker42 Nov 15, 2023
1a652ce
Refactoring
lbooker42 Nov 17, 2023
cba4591
Finish index-ifying ChunkedOperatorAggregationHelper
rcaudy Nov 17, 2023
7ecaddc
Improvements to RegionedColumnSourceManager
rcaudy Nov 17, 2023
6ab57f8
Refactor DelayedErrorNotifier pattern to share code. Update SourceTab…
rcaudy Nov 20, 2023
cb87382
Rename AbstractDataIndex to BaseDataIndex. Correct implementation for…
rcaudy Nov 20, 2023
a5e12b0
Review pass over QueryTable
rcaudy Nov 20, 2023
8cfd8de
A bit of work on the data index impls
rcaudy Nov 20, 2023
691efd6
Fix key type in PartitioningColumnDataIndexImpl
rcaudy Nov 21, 2023
01912d8
Merge pull request #8 from rcaudy/rwc-di-collab2
lbooker42 Nov 21, 2023
1f50998
Bug fixes to get tests passing
lbooker42 Nov 21, 2023
90afec5
More bug fixes.
lbooker42 Nov 21, 2023
9e68237
Notes/code review on 2023-11-21
rcaudy Nov 21, 2023
f35d14c
partial merge with main
lbooker42 Nov 21, 2023
6b46650
Minor renames. Test still failing.
lbooker42 Nov 22, 2023
556ea13
More tests passing.
lbooker42 Nov 22, 2023
219dcb5
UpdateBy grouping bug fix.
lbooker42 Nov 22, 2023
c81a077
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab2
rcaudy Nov 22, 2023
2b4918c
Fix legacy grouping table discovery.
lbooker42 Nov 22, 2023
20c5204
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab2
rcaudy Nov 22, 2023
a97b132
AJ indexing expansion and tests. Also rename-cleanup of Index v. RowSet
lbooker42 Nov 23, 2023
66997e5
NaturalJoin with indexes added.
lbooker42 Nov 28, 2023
a74730c
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab2
rcaudy Nov 28, 2023
5057cbc
Added indexing support to SortOperation and helper classes.
lbooker42 Nov 28, 2023
d4f9e74
Small update to SortOperation indexing.
lbooker42 Nov 29, 2023
a6469e6
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab2
rcaudy Nov 29, 2023
1844b1e
Some where-related changes and TODOs
rcaudy Nov 29, 2023
2649595
Changes to OperationSnapshotControlEx, some other cleanup.
lbooker42 Nov 30, 2023
a77c873
Utilities for working with boxed, reinterpreted keys
rcaudy Dec 5, 2023
e1ef9ad
RWC Changes
rcaudy Dec 5, 2023
b48fc91
Accepted RWC changes, additional improvements and DynamicWhereFilter …
lbooker42 Dec 5, 2023
e16c979
Minor changes for tests.
lbooker42 Dec 7, 2023
c39123e
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab2
rcaudy Dec 7, 2023
8c63d78
Bug fixes and more index-enabled tests.
lbooker42 Dec 7, 2023
f93a373
Some cleanups to RowSetColumnSourceWrapper
rcaudy Dec 7, 2023
aeef011
More bug fixes.
lbooker42 Dec 8, 2023
eb72bc9
Split DataIndexKeySet into two impls, and rename DataIndexBoxedKeySou…
rcaudy Dec 8, 2023
813b847
Significant cleanup to partititioning column data index impl; address…
rcaudy Dec 9, 2023
4ba77e8
RegionedPartitioningColumnDataIndex: Get rid of the added builder, an…
rcaudy Dec 10, 2023
d65a1f5
Trivial cleanups to TableLocation JavaDocs, and delete unused getColu…
rcaudy Dec 11, 2023
777c685
Further cleanups, and work on MergedDataIndex; planning to make Merge…
rcaudy Dec 12, 2023
f1da851
Refactor DataIndex interface and add DerivedDataIndex tests.
lbooker42 Dec 12, 2023
2f1e19d
Refactored DataIndex transformations.
lbooker42 Dec 12, 2023
2e44973
Refactored DataIndex interfaces.
lbooker42 Dec 13, 2023
0d1d3f6
Renamed DataIndex interfaces.
lbooker42 Dec 14, 2023
fe24926
MergedDataIndex is now static-only, and optimized accordingly. Did so…
rcaudy Dec 14, 2023
6632b97
A bit of cleanup to MergedDataIndex, plus a few other cleanups/spotless
rcaudy Dec 14, 2023
3a8c077
TableLocation
lbooker42 Dec 14, 2023
e44c51a
WIP on refactoring into the RCSM
rcaudy Dec 14, 2023
df6f1a0
Finish integrating my index changes into SourceTable and RegionedColu…
rcaudy Dec 15, 2023
cf276d4
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab2
rcaudy Dec 15, 2023
03bbde1
Some cleanup and comments
rcaudy Dec 15, 2023
8c45079
Address a few code review issues in the collab code
rcaudy Dec 15, 2023
21cf775
Address compilation errors
rcaudy Dec 15, 2023
a80d597
Merge pull request #9 from rcaudy/rwc-di-collab2
lbooker42 Dec 15, 2023
b21c85b
Merged with main.
lbooker42 Dec 15, 2023
89ba6d1
Import changes.
lbooker42 Dec 15, 2023
6365d35
Address unit test compilation issues
rcaudy Dec 15, 2023
7280297
Fix some in RCSM, and address spotless issues. Unit tests are a WIP.
rcaudy Dec 15, 2023
5a98e0a
Get TestRCSM in proper shape, so that the data indexes are actually t…
rcaudy Dec 17, 2023
8b63d77
Major refactoring to filtering and select-distinct behavior in Partit…
rcaudy Dec 19, 2023
0a016be
Finished fixing TestPartitionAwareSourceTable and TestSimpleSourceTable
rcaudy Dec 19, 2023
d280eb8
Make spotless leave me alone
rcaudy Dec 19, 2023
4d1aca3
Clean up the TableLocation infrastructure changes, and start on Parqu…
rcaudy Dec 19, 2023
c91b50f
spotless
rcaudy Dec 19, 2023
f2ead6d
Merge pull request #10 from rcaudy/rwc-di-collab3
lbooker42 Dec 19, 2023
506a844
Make TestEventDrivenUpdateGraph.testUpdatePerformanceTracker more len…
rcaudy Dec 19, 2023
f180b73
Addressed changes to column definition.
lbooker42 Dec 20, 2023
d8e0d08
Make TestEventDrivenUpdateGraph.testUpdatePerformanceTracker more len…
rcaudy Dec 20, 2023
c32688b
Finish cleanup pass over the parquet changes
rcaudy Dec 20, 2023
314a3d9
Fix bug in my optional usage.
rcaudy Dec 20, 2023
07de4bd
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab4
rcaudy Dec 20, 2023
fc017b6
Fix typo
rcaudy Dec 20, 2023
ac2ea20
Be more explicit in my JavaDoc.
rcaudy Dec 20, 2023
8564062
RedefinableTable must *copy* SelectColumn.initDef results before muta…
rcaudy Dec 20, 2023
0284894
updated groovy static imports
lbooker42 Dec 20, 2023
148624c
Merge pull request #11 from rcaudy/rwc-di-collab4
lbooker42 Dec 20, 2023
d4335e3
Added out-order tests for parquet and table indexes.
lbooker42 Dec 20, 2023
a8e48a9
Revert changes to BinSearch.ftl, cleanup and bugfixes.
lbooker42 Dec 20, 2023
7a86447
Fairly major re-write of data structures in DataIndexer. Not yet prop…
rcaudy Dec 23, 2023
4724b6f
Codify updated JoinControl rules.
rcaudy Jan 30, 2024
c21044c
Updated AsOjJoinHelper
rcaudy Jan 30, 2024
c77863b
Finished cleaning up AJ code
rcaudy Feb 7, 2024
9cb8161
Addressed some replication cleanliness
rcaudy Feb 13, 2024
e8fecb0
Some spotless
rcaudy Feb 13, 2024
fa82e96
Work on cleaning up some DataIndexer usages
rcaudy Feb 24, 2024
889aec2
Audit remaining DataIndexer usages
rcaudy Feb 29, 2024
e872af4
Semi-blind cleanup of join control overrides in test.
rcaudy Mar 1, 2024
5251db8
Clean up BucketingContext
rcaudy Mar 11, 2024
cba2dd4
A bit more work on BucketingContext and some cleanup in DataIndexer
rcaudy Mar 11, 2024
5c6ca35
WIP on JoinControl and NaturalJoinHelper
rcaudy Mar 11, 2024
4b01eab
Address satisfaction issue for data indexes used from within the upda…
rcaudy Mar 12, 2024
cf96258
NaturalJoinHelper compiles now
rcaudy Mar 12, 2024
27424ab
Commit partial clean up to JoinControl for posterity
rcaudy Mar 12, 2024
fe8b961
JoinControl cleaned up further, NaturalJoinHelper "correct"
rcaudy Mar 12, 2024
f8f70f3
Some "beautification"
rcaudy Mar 12, 2024
b5ee654
Address some leaky row set usage in NaturalJoinHelper
rcaudy Mar 12, 2024
f85da23
Clean up CrossJoinHelper
rcaudy Mar 12, 2024
0225eac
Spotless
rcaudy Mar 12, 2024
881a77d
Merge remote-tracking branch 'larry/lab-dh-11168' into rwc-di-collab5
rcaudy Mar 13, 2024
575442b
Handle empty key columns as input to DataIndexer methods
rcaudy Mar 13, 2024
765e195
Clean up NaturalJoinHelper helper a bit, and fix bug related to hash …
rcaudy Mar 13, 2024
56b828c
Fix management bug in TableBackedDataIndex
rcaudy Mar 13, 2024
5e3fab7
Shrink "benchmark" tests in MultiColumnSortTest
rcaudy Mar 13, 2024
70f1d83
Correct OperationSnapshotControlEx.usePreviousValues to properly hand…
rcaudy Mar 14, 2024
c6fdf24
Replayer cleanup; we should be computing missing indexes
rcaudy Mar 14, 2024
de6c8c0
Rename methods per code review
rcaudy Mar 14, 2024
0e3a802
Clean up DynamicWhereFilter a bit, and make TestConcurrentInstantiati…
rcaudy Mar 14, 2024
48c6a65
Merge pull request #12 from rcaudy/rwc-di-collab5
lbooker42 Mar 14, 2024
10ce355
Merge remote-tracking branch 'upstream/main' into lab-dh-11168
rcaudy Mar 14, 2024
78831dc
Spotless license headers
rcaudy Mar 14, 2024
6af0bc7
Clean up Parquet conflicts and tests
rcaudy Mar 14, 2024
2b3acae
Address selenium build issue
rcaudy Mar 14, 2024
f6fc68d
Quick test cleanup
rcaudy Mar 14, 2024
b9c34cb
Spotless!
rcaudy Mar 14, 2024
4c935e3
Merge pull request #13 from rcaudy/rwc-di-collab6-mainmerge1
lbooker42 Mar 14, 2024
c450467
Fix failing unit tests caused by removal of wrapping exception in Sou…
rcaudy Mar 15, 2024
85e8e8f
OperationSnapshotControlEx to accept any NotificationQueue.Dependency…
rcaudy Mar 15, 2024
e572aa5
Finish fixing up DataIndex dependency and liveness management in wher…
rcaudy Mar 15, 2024
ac25845
Finish pass over DynamicWhereFilter
rcaudy Mar 16, 2024
c70a582
Change match to use a row set for accumulation, and avoid iterating n…
rcaudy Mar 16, 2024
b742933
Delete TupleSource.getColumnSources()
rcaudy Mar 16, 2024
5799b1f
Cleaned up TableBackedDataIndex and some related agg code
rcaudy Mar 16, 2024
16b037d
Clean up ChunkedOperatorAggregationHelper
rcaudy Mar 16, 2024
c6dbdba
Cleanups from a quick review pass over files I hadn't checked off
rcaudy Mar 17, 2024
e2b1868
Review and cleanup pass over sort
rcaudy Mar 17, 2024
7f1578e
Don't reinterpret index key columns!
rcaudy Mar 17, 2024
95e0b7d
Minor cleanups to StandaloneDataIndex
rcaudy Mar 17, 2024
be80201
Fix TimeTableTest
rcaudy Mar 17, 2024
38772bb
Many cleanups and refactorings to DataIndex code
rcaudy Mar 18, 2024
f7c978f
Bug fixes and code review comments
rcaudy Mar 18, 2024
2f49a87
BaseDataIndex to AbstractDataIndex
rcaudy Mar 18, 2024
5d12888
Rename TestDerivedDataIndex to TestTransformedDataIndex
rcaudy Mar 18, 2024
b0e19af
Clean up TstUtils delegation behavior for table creation. Ensure that…
rcaudy Mar 18, 2024
4a5b110
Fix liveness handling in TransformedDataIndex
rcaudy Mar 18, 2024
d32bfc1
Re-write IndexValidator
rcaudy Mar 18, 2024
d3d1a35
Clarify and correct rowset ownership for TransformedDataIndex
rcaudy Mar 18, 2024
8adf2d6
Rename a function and some variables
rcaudy Mar 18, 2024
14568c8
Merge pull request #14 from rcaudy/rwc-di-collab7
lbooker42 Mar 18, 2024
9bc8786
Remove unnecessary empty check
rcaudy Mar 18, 2024
a7bc940
Make use of RowSetCodec instead of ExternalizableCodec for Parquet Ro…
rcaudy Mar 19, 2024
c6ff002
Be sure to correctly re-map RowSet column names when writing persiste…
rcaudy Mar 19, 2024
76ac4be
Merge pull request #15 from rcaudy/rwc-di-collab8
lbooker42 Mar 19, 2024
3c62391
Bug fix and test improvements for DynamicWhereFilter
lbooker42 Mar 19, 2024
ada6540
Spotless
lbooker42 Mar 19, 2024
c41d04a
PR comments.
lbooker42 Mar 19, 2024
c221bd0
Additional tests, improving coverage for MatchFilter CI String matchi…
lbooker42 Mar 19, 2024
37eb588
Retain data index references in RegionedColumnSourceManager
lbooker42 Mar 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Util/src/main/java/io/deephaven/util/SafeCloseableList.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;

/**
* {@link SafeCloseable} that will close an internal list of other {@link SafeCloseable}s.
Expand Down Expand Up @@ -57,4 +63,35 @@ public final void close() {
}
list.clear();
}

public static final Collector<SafeCloseable, SafeCloseableList, SafeCloseableList> COLLECTOR = new Collector<>() {

@Override
public Supplier<SafeCloseableList> supplier() {
return SafeCloseableList::new;
}

@Override
public BiConsumer<SafeCloseableList, SafeCloseable> accumulator() {
return SafeCloseableList::add;
}

@Override
public BinaryOperator<SafeCloseableList> combiner() {
return (left, right) -> {
left.addAll(right.list);
return left;
};
}

@Override
public Function<SafeCloseableList, SafeCloseableList> finisher() {
return a -> a;
}

@Override
public Set<Characteristics> characteristics() {
return Set.of(Characteristics.IDENTITY_FINISH);
}
};
}
1 change: 1 addition & 0 deletions docker/registry/selenium/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
io.deephaven.project.ProjectType=DOCKER_REGISTRY
deephaven.registry.imageName=selenium/standalone-firefox:4.16.1-20231219
deephaven.registry.imageId=selenium/standalone-firefox@sha256:a405fe92b3ce5d7eb31a07e1f99be3d628fdc0e5bdc81febd8dc11786edef024
deephaven.registry.platform=linux/amd64
118 changes: 118 additions & 0 deletions engine/api/src/main/java/io/deephaven/engine/table/BasicDataIndex.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.engine.table;

import io.deephaven.engine.liveness.LivenessReferent;
import io.deephaven.engine.rowset.RowSet;
import io.deephaven.util.annotations.FinalDefault;
import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
* Implementations of BasicDataIndex provide a data index for a {@link Table}. The index is itself a {@link Table} with
* columns corresponding to the indexed column(s) ("key" columns) and a column of {@link RowSet RowSets} that contain
* the row keys for each unique combination of key values (that is, the "group" or "bucket"). The index itself is a
* Table containing the key column(s) and the RowSets associated with each unique combination of values. Implementations
* may be loaded from persistent storage or created at runtime, e.g. via aggregations.
*/
public interface BasicDataIndex extends LivenessReferent {

/**
* Get a map from indexed {@link ColumnSource ColumnSources} to key column names for the index {@link #table()
* table}. This map must be ordered in the same order presented by {@link #keyColumnNames()} and used for lookup
* keys.
*
* @return A map designating the key column names for each indexed {@link ColumnSource}
*/
@NotNull
Map<ColumnSource<?>, String> keyColumnNamesByIndexedColumn();

/**
* Get a list of the key column names for the index {@link #table() table}.
*
* @return The key column names
*/
@NotNull
List<String> keyColumnNames();

/**
* Get the {@link RowSet} column name for the index {@link #table() table}.
*
* @return The {@link RowSet} column name
*/
@NotNull
String rowSetColumnName();

/**
* Get the key {@link ColumnSource ColumnSources} of the index {@link #table() table}.
*
* @return An array of the key {@link ColumnSource ColumnSources}, to be owned by the caller
*/
@FinalDefault
@NotNull
default ColumnSource<?>[] keyColumns() {
final Table indexTable = table();
return keyColumnNames().stream()
.map(indexTable::getColumnSource)
.toArray(ColumnSource[]::new);
}

/**
* Get the key {@link ColumnSource ColumnSources} of the index {@link #table() table} in the relative order of
* {@code indexedColumnSources}.
*
* @param indexedColumnSources The indexed {@link ColumnSource ColumnSources} in the desired order; must match the
* keys of {@link #keyColumnNamesByIndexedColumn()}
* @return An array of the key {@link ColumnSource ColumnSources} in the specified order, to be owned by the caller
*/
@FinalDefault
@NotNull
default ColumnSource<?>[] keyColumns(@NotNull final ColumnSource<?>[] indexedColumnSources) {
final Table indexTable = table();
final Map<ColumnSource<?>, String> keyColumnNamesByIndexedColumn = keyColumnNamesByIndexedColumn();
// Verify that the provided columns match the indexed columns.
if (keyColumnNamesByIndexedColumn.size() != indexedColumnSources.length
|| !keyColumnNamesByIndexedColumn.keySet().containsAll(Arrays.asList(indexedColumnSources))) {
throw new IllegalArgumentException(String.format(
"The provided columns %s do not match the index's indexed columns %s",
Arrays.toString(indexedColumnSources),
keyColumnNamesByIndexedColumn.keySet()));
}
return Arrays.stream(indexedColumnSources)
.map(keyColumnNamesByIndexedColumn::get)
.map(indexTable::getColumnSource)
.toArray(ColumnSource[]::new);
}

/**
* Get the {@link RowSet} {@link ColumnSource} of the index {@link #table() table}.
*
* @return The {@link RowSet} {@link ColumnSource}
*/
@FinalDefault
@NotNull
default ColumnSource<RowSet> rowSetColumn() {
return table().getColumnSource(rowSetColumnName(), RowSet.class);
}

/**
* Get the {@link Table} backing this data index.
*
* @return The {@link Table}
*/
@NotNull
Table table();

/**
* Whether the index {@link #table()} {@link Table#isRefreshing() is refreshing}. Some transformations will force
* the index to become static even when the source table is refreshing.
*
* @return {@code true} if the index {@link #table()} {@link Table#isRefreshing() is refreshing}, {@code false}
* otherwise
*/
boolean isRefreshing();
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ public enum ColumnType {
*/
Normal,

/**
* A column that has "grouping" metadata associated with it, possibly allowing for indexed filters, joins, and
* aggregations.
*/
Grouping,

/**
* A column that helps define underlying partitions in the storage of the data, which consequently may also be
* used for very efficient filtering.
Expand Down Expand Up @@ -393,10 +387,6 @@ public ColumnDefinition<TYPE> withPartitioning() {
return isPartitioning() ? this : new ColumnDefinition<>(name, dataType, componentType, ColumnType.Partitioning);
}

public ColumnDefinition<TYPE> withGrouping() {
return isGrouping() ? this : new ColumnDefinition<>(name, dataType, componentType, ColumnType.Grouping);
}

public ColumnDefinition<TYPE> withNormal() {
return columnType == ColumnType.Normal
? this
Expand All @@ -414,16 +404,12 @@ public ColumnDefinition<?> withName(@NotNull final String newName) {
return newName.equals(name) ? this : new ColumnDefinition<>(newName, dataType, componentType, columnType);
}

public boolean isGrouping() {
return (columnType == ColumnType.Grouping);
}

public boolean isPartitioning() {
return (columnType == ColumnType.Partitioning);
}

public boolean isDirect() {
return (columnType == ColumnType.Normal || columnType == ColumnType.Grouping);
return (columnType == ColumnType.Normal);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
package io.deephaven.engine.table;

import io.deephaven.base.verify.Require;
import io.deephaven.chunk.attributes.Values;
import io.deephaven.chunk.ChunkType;
import io.deephaven.engine.rowset.WritableRowSet;
import io.deephaven.chunk.attributes.Values;
import io.deephaven.engine.rowset.RowSet;
import io.deephaven.engine.rowset.WritableRowSet;
import io.deephaven.util.annotations.FinalDefault;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nullable;
import javax.annotation.OverridingMethodsMustInvokeSuper;
import java.util.Map;

/**
* A "source" for column data - allows cell values to be looked up by (long) keys.
Expand All @@ -40,10 +39,26 @@ default ChunkType getChunkType() {
return ChunkType.fromElementType(dataType);
}

/**
* Return a {@link RowSet row set} where the values in the column source match the given keys.
*
* @param invertMatch Whether to invert the match, i.e. return the rows where the values do not match the given keys
* @param usePrev Whether to use the previous values for the ColumnSource
* @param caseInsensitive Whether to perform a case insensitive match
* @param dataIndex An optional data index that can be used to accelerate the match (the index table must be
* included in snapshot controls or otherwise guaranteed to be current)
* @param mapper Restrict results to this row set
* @param keys The keys to match in the column
*
* @return The rows that match the given keys
*/
WritableRowSet match(
boolean invertMatch, boolean usePrev, boolean caseInsensitive, @NotNull RowSet mapper, Object... keys);

Map<T, RowSet> getValuesMapping(RowSet subRange);
boolean invertMatch,
boolean usePrev,
boolean caseInsensitive,
@Nullable final DataIndex dataIndex,
@NotNull RowSet mapper,
Object... keys);

/**
* ColumnSource implementations that track previous values have the option to not actually start tracking previous
Expand All @@ -59,21 +74,6 @@ default void startTrackingPrevValues() {
}
}

/**
* Compute grouping information for all keys present in this column source.
*
* @return A map from distinct data values to a RowSet that contains those values
*/
Map<T, RowSet> getGroupToRange();

/**
* Compute grouping information for (at least) all keys present in rowSet.
*
* @param rowSet The RowSet to consider
* @return A map from distinct data values to a RowSet that contains those values
*/
Map<T, RowSet> getGroupToRange(RowSet rowSet);

/**
* Determine if this column source is immutable, meaning that the values at a given row key never change.
*
Expand Down
Loading
Loading