Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryTable#renameColumns: Propagate Attributes #3537

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,7 @@ public void onUpdate(final TableUpdate upstream) {
}
propagateFlatness(queryTable);

copyAttributes(queryTable, CopyAttributeOperation.RenameColumns);
copySortableColumns(queryTable, pairs);
maybeCopyColumnDescriptions(queryTable, pairs);

Expand Down