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
ConstructorsConstructorDescriptionPartitionedTableImpl(@NotNull Table table, @NotNull Collection<String> keyColumnNames, boolean uniqueKeys, @NotNull String constituentColumnName, @NotNull TableDefinition constituentDefinition, boolean constituentChangesPermitted, boolean validateConstituents) -
Method Summary
Modifier and TypeMethodDescriptionbooleanCan the constituents of the underlyingpartitioned tablechange?Get the name of the "constituent" column oftables.constituentFor(@NotNull Object... keyColumnValues) Get a singleconstituentby its corresponding key column values.Table[]Get all the currentconstituents.filter(@NotNull Collection<? extends Filter> filters) Make a new PartitionedTable from the result of applyingfiltersto the underlying partitioned table.Get the names of all "key" columns that are part oftable().getDefinition().merge()Make a newTablethat 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) Applytransformerto all constituenttablesfound inthisandotherwith the same key column values, and produce a new PartitionedTable containing the results.proxy(boolean requireMatchingKeys, boolean sanityCheckJoinOperations) Make a proxy that allowstable operationsto be applied to the constituent tables of this PartitionedTable.sort(@NotNull Collection<SortColumn> sortColumns) Make a new PartitionedTable from the result of applyingsortColumnsto the underlying partitioned table.table()Get the "raw"partitioned tableunderlying this PartitionedTable.toString()transform(@Nullable ExecutionContext executionContext, @NotNull UnaryOperator<Table> transformer, boolean expectRefreshingResults, @NotNull NotificationQueue.Dependency... dependencies) Applytransformerto all constituenttables, and produce a new PartitionedTable containing the results.booleanAre the keys (key column values for a row considered as a tuple) in the underlyingpartitioned tableunique?Methods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScopeMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, tryManage, tryUnmanage, tryUnmanage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods inherited from interface io.deephaven.base.log.LogOutputAppendable
appendMethods 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:
toStringin classReferenceCounted
-
table
Description copied from interface:PartitionedTableGet the "raw"partitioned tableunderlying 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:
tablein interfacePartitionedTable- Returns:
- The underlying
partitioned table
-
keyColumnNames
Description copied from interface:PartitionedTableGet 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:
keyColumnNamesin interfacePartitionedTable- Returns:
- The key column names
-
uniqueKeys
Description copied from interface:PartitionedTableAre the keys (key column values for a row considered as a tuple) in the underlying
partitioned tableunique?If keys are unique, one can expect that
table().selectDistinct(keyColumnNames.toArray(String[]::new))is equivalent totable().view(keyColumnNames.toArray(String[]::new)).- Specified by:
uniqueKeysin interfacePartitionedTable- Returns:
- Whether the keys in the underlying partitioned table are unique
-
constituentColumnName
Description copied from interface:PartitionedTableGet the name of the "constituent" column oftables.- Specified by:
constituentColumnNamein interfacePartitionedTable- Returns:
- The constituent column name
-
constituentDefinition
Description copied from interface:PartitionedTable- Specified by:
constituentDefinitionin interfacePartitionedTable- Returns:
- The constituent definition
-
constituentChangesPermitted
Description copied from interface:PartitionedTableCan the constituents of the underlying
partitioned tablechange?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() == falsemust 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:
constituentChangesPermittedin 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:PartitionedTableMake a proxy that allows
table operationsto 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:
proxyin interfacePartitionedTable- Parameters:
requireMatchingKeys- Whether to ensure that both partitioned tables have all the same keys present when a proxied operation usesthisand anotherPartitionedTableas inputs for apartitioned transformsanityCheckJoinOperations- Whether to check that proxied join operations will only find a given join key in one constituent table forthisand thetableargument if it is also aproxy- Returns:
- A proxy that allows
table operationsto be applied to the constituent tables of this PartitionedTable
-
merge
Description copied from interface:PartitionedTableMake a newTablethat 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:
mergein interfacePartitionedTable- Returns:
- A merged representation of the constituent tables
-
filter
@ConcurrentMethod public PartitionedTableImpl filter(@NotNull @NotNull Collection<? extends Filter> filters) Description copied from interface:PartitionedTableMake a new PartitionedTable from the result of applying
filtersto the underlying partitioned table.filtersmust not reference the constituent column.- Specified by:
filterin 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:PartitionedTableMake a new PartitionedTable from the result of applying
sortColumnsto the underlying partitioned table.sortColumnsmust not reference the constituent column.- Specified by:
sortin 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:PartitionedTableApply
transformerto all constituenttables, and produce a new PartitionedTable containing the results. Thetransformerwill be invoked in the provided ExecutionContext.transformermust be stateless, safe for concurrent use, and able to return a valid result for an empty input table.- Specified by:
transformin interfacePartitionedTable- Parameters:
executionContext- The ExecutionContext to use for thetransformertransformer- TheUnaryOperatorto apply to all constituenttablesexpectRefreshingResults- Whether to expect that the results of applyingtransformermay 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 specifyingfalsewill result in exceptions.dependencies- Additional dependencies that must be satisfied before applyingtransformerto added or modified constituents during update processing; use this whentransformeruses additionalTableorPartitionedTableinputs 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:PartitionedTableApply
transformerto all constituenttablesfound inthisandotherwith the same key column values, and produce a new PartitionedTable containing the results. Thetransformerwill be invoked in the provided ExecutionContext.Note that
other's key columns must matchthisPartitionedTable'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 typeandcomponent 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 typeandcomponent type.
transformermust 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:
partitionedTransformin interfacePartitionedTable- Parameters:
other- The other PartitionedTable to find constituents inexecutionContext- The ExecutionContext to use for thetransformertransformer- TheBinaryOperatorto apply to all pairs of constituenttablesexpectRefreshingResults- Whether to expect that the results of applyingtransformermay 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 specifyingfalsewill result in exceptions.dependencies- Additional dependencies that must be satisfied before applyingtransformerto added, modified, or newly-matched constituents during update processing; use this whentransformeruses additionalTableorPartitionedTableinputs besides the constituents ofthisorother- Returns:
- The new PartitionedTable containing the resulting constituents
- Match by column name. Both PartitionedTables must have all the same
-
constituentFor
Description copied from interface:PartitionedTableGet a single
constituentby its corresponding key column values.The
keyColumnValuescan 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, anUnsupportedOperationExceptionis thrown.The result will be
managedby the enclosingliveness scope.Note that if
PartitionedTable.constituentChangesPermitted(), this method may return different results if invoked multiple times.- Specified by:
constituentForin interfacePartitionedTable- Parameters:
keyColumnValues- Ordered, boxed values for the key columns in the same order asPartitionedTable.keyColumnNames()- Returns:
- The
constituentat the single row inPartitionedTable.table()matching thekeyColumnValues, ornullif no matches were found
-
constituents
Description copied from interface:PartitionedTableGet all the currentconstituents.The results will be
managedby the enclosingliveness scope.Note that if
PartitionedTable.constituentChangesPermitted(), this method may return different results if invoked multiple times.- Specified by:
constituentsin interfacePartitionedTable- Returns:
- An array of all current
constituents
-