proxy
The proxy
method creates a new PartitionedTableProxy
from the provided PartitionedTable
.
A PartitionedTableProxy
is a table operation proxy object for the underlying PartitionedTable
. The PartitionedTableProxy
gives users access to a variety of Deephaven table operations that are not available to a PartitionedTable
. When a user has made all the desired changes to the PartitionedTableProxy
, they can use the target
attribute to return the underlying PartitionedTable
with the changes applied.
A query can achieve the same results by using either transform
or a partitioned table proxy. Proxy objects provide convenience by making it simpler to apply transformations to a partitioned table, but with less control.
Syntax
PartitionedTable.proxy(
require_matching_keys: bool = True,
sanity_check_joins: bool = True
) -> PartitionedTableProxy
Parameters
Parameter | Type | Description |
---|---|---|
require_matching_keys | bool | Whether to ensure that both |
sanity_check_joins | bool | Whether to check that for proxied join operations, a given join key only occurs in exactly one constituent table of the underlying |
Returns
A PartitionedTableProxy
.
Available methods
The following methods are available to a PartitionedTableProxy
:
The following links are for the Table
version of each of these methods. The PartitionedTableProxy
version of each method is identical, except that it returns a PartitionedTableProxy
instead of a Table
.
abs_sum_by()
agg_all_by()
agg_by()
aj()
avg_by()
count_by()
exact_join()
first_by()
group_by()
head()
is_refreshing
join()
last_by()
max_by()
median_by()
min_by()
natural_join()
raj()
reverse()
select()
select_distinct()
snapshot()
snapshot_when()
sort()
sort_descending()
std_by()
sum_by()
tail()
update()
update_by()
update_graph
update_view()
var_by()
view()
weighted_avg_by()
weighted_sum_by()
where()
where_in()
where_not_in()
Example
The following example shows how a partitioned table proxy can be used to apply standard table operations to every constituent of a partitioned table. The example uses reverse
to reverse the ordering of the original table.
from deephaven import empty_table
source = empty_table(10).update(["Key = (i % 2 == 0) ? `X` : `Y`", "Value = i"])
partitioned_table = source.partition_by(["Key"])
pt_proxy = partitioned_table.proxy()
result = source.reverse()
proxy_reversed = pt_proxy.reverse()
result_from_proxy = proxy_reversed.target.merge()
- result_from_proxy
- result
- source