From 3a844c1aaf85f1a6260169efc9082798e4e6d839 Mon Sep 17 00:00:00 2001 From: Nathaniel Bauernfeind Date: Mon, 13 Mar 2023 12:17:27 -0600 Subject: [PATCH] QueryTable#renameColumns: Propagate Attributes --- .../main/java/io/deephaven/engine/table/impl/BaseTable.java | 6 +++++- .../java/io/deephaven/engine/table/impl/QueryTable.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java index e7805f550e1..de8c404214f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/BaseTable.java @@ -158,7 +158,7 @@ public enum CopyAttributeOperation { // legacy attributes Flatten, Sort, UpdateView, Join, Filter, // new attributes - DropColumns, View, Reverse, + DropColumns, RenameColumns, View, Reverse, /** * The result tables that go in a PartitionBy TableMap */ @@ -199,6 +199,7 @@ public enum CopyAttributeOperation { // into constituent tables tempMap.put(MERGED_TABLE_ATTRIBUTE, EnumSet.of( CopyAttributeOperation.DropColumns, + CopyAttributeOperation.RenameColumns, CopyAttributeOperation.View)); tempMap.put(INITIALLY_EMPTY_COALESCED_SOURCE_TABLE_ATTRIBUTE, EnumSet.complementOf(EnumSet.of( @@ -271,12 +272,14 @@ public enum CopyAttributeOperation { tempMap.put(ADD_ONLY_TABLE_ATTRIBUTE, EnumSet.of( CopyAttributeOperation.DropColumns, + CopyAttributeOperation.RenameColumns, CopyAttributeOperation.PartitionBy, CopyAttributeOperation.Coalesce)); tempMap.put(APPEND_ONLY_TABLE_ATTRIBUTE, EnumSet.of( CopyAttributeOperation.DropColumns, + CopyAttributeOperation.RenameColumns, CopyAttributeOperation.FirstBy, CopyAttributeOperation.Flatten, CopyAttributeOperation.PartitionBy, @@ -318,6 +321,7 @@ public enum CopyAttributeOperation { CopyAttributeOperation.View, // and Select, if added CopyAttributeOperation.UpdateView, // and Update, if added CopyAttributeOperation.DropColumns, + CopyAttributeOperation.RenameColumns, CopyAttributeOperation.Join, CopyAttributeOperation.WouldMatch)); diff --git a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java index d6da597e095..dc4bd5598b0 100644 --- a/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java +++ b/engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java @@ -1636,6 +1636,7 @@ public void onUpdate(final TableUpdate upstream) { } propagateFlatness(queryTable); + copyAttributes(queryTable, CopyAttributeOperation.RenameColumns); copySortableColumns(queryTable, pairs); maybeCopyColumnDescriptions(queryTable, pairs);