Skip to content

Commit

Permalink
fix: Capture QueryCompiler for plotting PartitionedTable transform (#…
Browse files Browse the repository at this point in the history
…6199)

Also removes other dead/deprecated code.

Fixes #6187
  • Loading branch information
niloc132 authored Oct 16, 2024
1 parent b4ebd67 commit 064aa6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
18 changes: 3 additions & 15 deletions Plot/src/main/java/io/deephaven/plot/AxesImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import io.deephaven.api.ColumnName;
import io.deephaven.api.agg.Aggregation;
import io.deephaven.engine.context.ExecutionContext;
import io.deephaven.engine.table.impl.MemoizedOperationKey;
import io.deephaven.plot.axisformatters.AxisFormat;
import io.deephaven.plot.axisformatters.NanosAxisFormat;
Expand Down Expand Up @@ -277,24 +278,11 @@ private static SelectableDataSet getAggregatedSelectableDataSet(final Selectable
}
final Collection<? extends Aggregation> aggs = aggSupplier.get();
final Collection<? extends ColumnName> columnNames = ColumnName.from(cols);
final Function<Table, Table> applyAggs = t -> t.aggBy(aggs, columnNames);
ExecutionContext ctx = ExecutionContext.newBuilder().captureQueryCompiler().build();
final Function<Table, Table> applyAggs = t -> ctx.apply(() -> t.aggBy(aggs, columnNames));
return sds.transform(MemoizedOperationKey.aggBy(aggs, false, null, columnNames), applyAggs);
}

private static SelectableDataSet getLastBySelectableDataSet(final SelectableDataSet sds, final String... columns) {
final List<String> cols = new ArrayList<>();
Collections.addAll(cols, columns);
return getLastBySelectableDataSet(sds, cols);
}

private static SelectableDataSet getLastBySelectableDataSet(final SelectableDataSet sds,
final Collection<String> columns) {
if (sds instanceof SelectableDataSetOneClick) {
Collections.addAll(columns, ((SelectableDataSetOneClick) sds).getByColumns());
}
return sds.transform(columns, t -> ((Table) t).lastBy(columns));
}

public Set<SwappableTable> getSwappableTables() {
final Set<SwappableTable> result = new HashSet<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import io.deephaven.engine.table.TableDefinition;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.function.Function;

/**
Expand Down Expand Up @@ -45,19 +44,6 @@ default SwappableTable getSwappableTable(final Comparable seriesName, final Char
return getSwappableTable(seriesName, chart, null, cols);
}

/**
* Gets a version of the SelectableDataSet with a lastBy applied to the tables.
*
* @param groupByColumns The grouping columns for the lastBy
* @return a new SelectableDataSet with lastBy applied
*
* @deprecated This method will be removed in a future release, use {@link #transform(Object, Function)} instead.
*/
@Deprecated()
default SelectableDataSet<KEY_TYPE, VALUE_TYPE> getLastBy(final Collection<String> groupByColumns) {
return transform(groupByColumns, t -> t.lastBy(groupByColumns));
}

/**
* Produces a derivative {@link SelectableDataSet} with the specified transformation applied to all internal tables.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import io.deephaven.engine.table.Table;
import io.deephaven.engine.util.TableTools;

import static io.deephaven.plot.filters.Selectables.oneClick;

public class SimpleXYTable {

public static void main(String[] args) {
Expand Down

0 comments on commit 064aa6f

Please sign in to comment.