Class PartitionedTableImpl
- All Implemented Interfaces:
LogOutputAppendable
,LivenessManager
,LivenessNode
,LivenessReferent
,PartitionedTable
,Serializable
- Direct Known Subclasses:
SourcePartitionedTable
PartitionedTable
implementation.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.PartitionedTable
PartitionedTable.Proxy
-
Constructor Summary
ConstructorDescriptionPartitionedTableImpl
(@NotNull Table table, @NotNull Collection<String> keyColumnNames, boolean uniqueKeys, @NotNull String constituentColumnName, @NotNull TableDefinition constituentDefinition, boolean constituentChangesPermitted, boolean validateConstituents) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Can the constituents of the underlyingpartitioned table
change?Get the name of the "constituent" column oftables
.constituentFor
(@NotNull Object... keyColumnValues) Get a singleconstituent
by its corresponding key column values.Table[]
Get all the currentconstituents
.filter
(@NotNull Collection<? extends Filter> filters) Make a new PartitionedTable from the result of applyingfilters
to the underlying partitioned table.Get the names of all "key" columns that are part oftable().getDefinition()
.merge()
Make a newTable
that contains the rows from all the constituent tables of this PartitionedTable, in the same relative order as the underlying partitioned table and its constituents.partitionedTransform
(@NotNull PartitionedTable other, @Nullable ExecutionContext executionContext, @NotNull BinaryOperator<Table> transformer, boolean expectRefreshingResults, @NotNull NotificationQueue.Dependency... dependencies) Applytransformer
to all constituenttables
found inthis
andother
with the same key column values, and produce a new PartitionedTable containing the results.proxy
(boolean requireMatchingKeys, boolean sanityCheckJoinOperations) Make a proxy that allowstable operations
to be applied to the constituent tables of this PartitionedTable.sort
(@NotNull Collection<SortColumn> sortColumns) Make a new PartitionedTable from the result of applyingsortColumns
to the underlying partitioned table.table()
Get the "raw"partitioned table
underlying this PartitionedTable.toString()
transform
(@Nullable ExecutionContext executionContext, @NotNull UnaryOperator<Table> transformer, boolean expectRefreshingResults, @NotNull NotificationQueue.Dependency... dependencies) Applytransformer
to all constituenttables
, and produce a new PartitionedTable containing the results.boolean
Are the keys (key column values for a row considered as a tuple) in the underlyingpartitioned table
unique?Methods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScope
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanage
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReference
Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, tryDecrementReferenceCount, tryIncrementReferenceCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, tryManage
Methods inherited from interface io.deephaven.engine.liveness.LivenessNode
tryUnmanage, tryUnmanage, unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
Methods inherited from interface io.deephaven.base.log.LogOutputAppendable
append
Methods inherited from interface io.deephaven.engine.table.PartitionedTable
partitionedTransform, proxy, transform
-
Constructor Details
-
PartitionedTableImpl
@InternalUseOnly public PartitionedTableImpl(@NotNull @NotNull Table table, @NotNull @NotNull Collection<String> keyColumnNames, boolean uniqueKeys, @NotNull @NotNull String constituentColumnName, @NotNull @NotNull TableDefinition constituentDefinition, boolean constituentChangesPermitted, boolean validateConstituents) - See Also:
- ApiNote:
- Only engine-internal tools should call this constructor directly
-
-
Method Details
-
toString
- Overrides:
toString
in classReferenceCounted
-
table
Description copied from interface:PartitionedTable
Get the "raw"partitioned table
underlying this PartitionedTable.The raw table can be converted back into a partitioned table using
PartitionedTableFactory.of(Table)
orPartitionedTableFactory.of(Table, Collection, boolean, String, TableDefinition, boolean)
.- Specified by:
table
in interfacePartitionedTable
- Returns:
- The underlying
partitioned table
-
keyColumnNames
Description copied from interface:PartitionedTable
Get the names of all "key" columns that are part oftable().getDefinition()
. If there are no key columns, the result will be empty. This set is explicitly ordered.- Specified by:
keyColumnNames
in interfacePartitionedTable
- Returns:
- The key column names
-
uniqueKeys
Description copied from interface:PartitionedTable
Are the keys (key column values for a row considered as a tuple) in the underlying
partitioned table
unique?If keys are unique, one can expect that
table().selectDistinct(keyColumnNames.toArray(String[]::new))
is equivalent totable().view(keyColumnNames.toArray(String[]::new))
.- Specified by:
uniqueKeys
in interfacePartitionedTable
- Returns:
- Whether the keys in the underlying partitioned table are unique
-
constituentColumnName
Description copied from interface:PartitionedTable
Get the name of the "constituent" column oftables
.- Specified by:
constituentColumnName
in interfacePartitionedTable
- Returns:
- The constituent column name
-
constituentDefinition
Description copied from interface:PartitionedTable
- Specified by:
constituentDefinition
in interfacePartitionedTable
- Returns:
- The constituent definition
-
constituentChangesPermitted
Description copied from interface:PartitionedTable
Can the constituents of the underlying
partitioned table
change?This is completely unrelated to whether the constituents themselves are
refreshing
, or whether the underlying partitioned table is refreshing. Note that the underlying partitioned table must be refreshing if it contains any refreshing constituents.PartitionedTables that specify
constituentChangesPermitted() == false
must be guaranteed to never change their constituents. Formally, it is expected thattable()
will never report additions, removals, or shifts, and that any modifications reported will not change values in the constituent column (that is,table().getColumnSource(constituentColumnName())
).- Specified by:
constituentChangesPermitted
in interfacePartitionedTable
- Returns:
- Whether the constituents of the underlying partitioned table can change
-
proxy
@ConcurrentMethod public PartitionedTable.Proxy proxy(boolean requireMatchingKeys, boolean sanityCheckJoinOperations) Description copied from interface:PartitionedTable
Make a proxy that allows
table operations
to be applied to the constituent tables of this PartitionedTable.Each operation thus applied will produce a new PartitionedTable with the results as in
PartitionedTable.transform(UnaryOperator, Dependency...)
orPartitionedTable.partitionedTransform(PartitionedTable, BinaryOperator, Dependency...)
, and return a new proxy to that PartitionedTable.- Specified by:
proxy
in interfacePartitionedTable
- Parameters:
requireMatchingKeys
- Whether to ensure that both partitioned tables have all the same keys present when a proxied operation usesthis
and anotherPartitionedTable
as inputs for apartitioned transform
sanityCheckJoinOperations
- Whether to check that proxied join operations will only find a given join key in one constituent table forthis
and thetable
argument if it is also aproxy
- Returns:
- A proxy that allows
table operations
to be applied to the constituent tables of this PartitionedTable
-
merge
Description copied from interface:PartitionedTable
Make a newTable
that contains the rows from all the constituent tables of this PartitionedTable, in the same relative order as the underlying partitioned table and its constituents. If constituent tables contain extra columns not in theconstituent definition
, those columns will be ignored. If constituent tables are missing columns in the constituent definition, the corresponding output rows will benull
.- Specified by:
merge
in interfacePartitionedTable
- Returns:
- A merged representation of the constituent tables
-
filter
@ConcurrentMethod public PartitionedTableImpl filter(@NotNull @NotNull Collection<? extends Filter> filters) Description copied from interface:PartitionedTable
Make a new PartitionedTable from the result of applying
filters
to the underlying partitioned table.filters
must not reference the constituent column.- Specified by:
filter
in interfacePartitionedTable
- Parameters:
filters
- The filters to apply. Must not reference the constituent column.- Returns:
- The filtered PartitionedTable
-
sort
@ConcurrentMethod public PartitionedTable sort(@NotNull @NotNull Collection<SortColumn> sortColumns) Description copied from interface:PartitionedTable
Make a new PartitionedTable from the result of applying
sortColumns
to the underlying partitioned table.sortColumns
must not reference the constituent column.- Specified by:
sort
in interfacePartitionedTable
- Parameters:
sortColumns
- The columns to sort by. Must not reference the constituent column.- Returns:
- The sorted PartitionedTable
-
transform
@ConcurrentMethod public PartitionedTable transform(@Nullable @Nullable ExecutionContext executionContext, @NotNull @NotNull UnaryOperator<Table> transformer, boolean expectRefreshingResults, @NotNull @NotNull NotificationQueue.Dependency... dependencies) Description copied from interface:PartitionedTable
Apply
transformer
to all constituenttables
, and produce a new PartitionedTable containing the results. Thetransformer
will be invoked in the provided ExecutionContext.transformer
must be stateless, safe for concurrent use, and able to return a valid result for an empty input table.- Specified by:
transform
in interfacePartitionedTable
- Parameters:
executionContext
- The ExecutionContext to use for thetransformer
transformer
- TheUnaryOperator
to apply to all constituenttables
expectRefreshingResults
- Whether to expect that the results of applyingtransformer
may berefreshing
. Iftrue
, the resulting PartitionedTable will always be backed by a refreshingtable
. This hint is important for transforms to static inputs that might produce refreshing output, in order to ensure correct liveness management; incorrectly specifyingfalse
will result in exceptions.dependencies
- Additional dependencies that must be satisfied before applyingtransformer
to added or modified constituents during update processing; use this whentransformer
uses additionalTable
orPartitionedTable
inputs besides the constituents ofthis
- Returns:
- The new PartitionedTable containing the resulting constituents
-
partitionedTransform
public PartitionedTable partitionedTransform(@NotNull @NotNull PartitionedTable other, @Nullable @Nullable ExecutionContext executionContext, @NotNull @NotNull BinaryOperator<Table> transformer, boolean expectRefreshingResults, @NotNull @NotNull NotificationQueue.Dependency... dependencies) Description copied from interface:PartitionedTable
Apply
transformer
to all constituenttables
found inthis
andother
with the same key column values, and produce a new PartitionedTable containing the results. Thetransformer
will be invoked in the provided ExecutionContext.Note that
other
's key columns must matchthis
PartitionedTable's key columns. Two matching mechanisms are supported, and will be attempted in the order listed:- Match by column name. Both PartitionedTables must have all the same
key column names
. Like-named columns must have the samedata type
andcomponent type
. - Match by column order. Both PartitionedTables must have their matchable columns in the same order within
their
key column names
. Like-positioned columns must have the samedata type
andcomponent type
.
transformer
must be stateless, safe for concurrent use, and able to return a valid result for empty input tables. It is required to install an ExecutionContext to access any QueryLibrary/QueryScope/QueryCompiler functionality from thetransformer
.- Specified by:
partitionedTransform
in interfacePartitionedTable
- Parameters:
other
- The other PartitionedTable to find constituents inexecutionContext
- The ExecutionContext to use for thetransformer
transformer
- TheBinaryOperator
to apply to all pairs of constituenttables
expectRefreshingResults
- Whether to expect that the results of applyingtransformer
may berefreshing
. Iftrue
, the resulting PartitionedTable will always be backed by a refreshingtable
. This hint is important for transforms to static inputs that might produce refreshing output, in order to ensure correct liveness management; incorrectly specifyingfalse
will result in exceptions.dependencies
- Additional dependencies that must be satisfied before applyingtransformer
to added, modified, or newly-matched constituents during update processing; use this whentransformer
uses additionalTable
orPartitionedTable
inputs besides the constituents ofthis
orother
- Returns:
- The new PartitionedTable containing the resulting constituents
- Match by column name. Both PartitionedTables must have all the same
-
constituentFor
Description copied from interface:PartitionedTable
Get a single
constituent
by its corresponding key column values.The
keyColumnValues
can be thought of as a tuple constraining the values for the corresponding key columns for the result row. If there are no matching rows, the result isnull
. If there are multiple matching rows, anUnsupportedOperationException
is thrown.The result will be
managed
by the enclosingliveness scope
.Note that if
PartitionedTable.constituentChangesPermitted()
, this method may return different results if invoked multiple times.- Specified by:
constituentFor
in interfacePartitionedTable
- Parameters:
keyColumnValues
- Ordered, boxed values for the key columns in the same order asPartitionedTable.keyColumnNames()
- Returns:
- The
constituent
at the single row inPartitionedTable.table()
matching thekeyColumnValues
, ornull
if no matches were found
-
constituents
Description copied from interface:PartitionedTable
Get all the currentconstituents
.The results will be
managed
by the enclosingliveness scope
.Note that if
PartitionedTable.constituentChangesPermitted()
, this method may return different results if invoked multiple times.- Specified by:
constituents
in interfacePartitionedTable
- Returns:
- An array of all current
constituents
-