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

fix: JsPartitionedTable keyColumn and keyColumnTypes ordering #4931

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

georgecwan
Copy link
Contributor

@georgecwan georgecwan commented Dec 11, 2023

Fixes issue where JsPartitionedTable returns the keyColumns and keyColumn types in the constituent table's column order which doesn't always match the partitioned table's column order.

@georgecwan georgecwan self-assigned this Dec 11, 2023
@georgecwan georgecwan changed the title fix: JsPartitionedTable keyColumn and keyColumn types ordering fix: JsPartitionedTable keyColumn and keyColumnTypes ordering Dec 11, 2023
@georgecwan georgecwan closed this Dec 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2023
@georgecwan georgecwan reopened this Dec 11, 2023
@georgecwan georgecwan marked this pull request as ready for review December 11, 2023 17:48
Comment on lines 104 to 110
ColumnDefinition columnDefinition = tableDefinition.getColumnsByName().get(false).get(name);
int index = 0;
while (!columns[index].getName().equals(name)) {
index++;
}
keyColumnTypes.add(columnDefinition.getType());
keyColumns[keyColumns.length] = columns[index];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to loop twice, i think this would do the job too?

Suggested change
ColumnDefinition columnDefinition = tableDefinition.getColumnsByName().get(false).get(name);
int index = 0;
while (!columns[index].getName().equals(name)) {
index++;
}
keyColumnTypes.add(columnDefinition.getType());
keyColumns[keyColumns.length] = columns[index];
ColumnDefinition columnDefinition = tableDefinition.getColumnsByName().get(false).get(name);
keyColumnTypes.add(columnDefinition.getType());
keyColumns[keyColumns.length] = columns[columnDefinition.getIndex()];

@georgecwan georgecwan merged commit 98efe77 into deephaven:main Dec 19, 2023
19 checks passed
@georgecwan georgecwan deleted the fix-partition-keycolumn-order branch December 19, 2023 16:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants