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

feat: Add support for multi-partition parquet:kv tables #1580

Merged
merged 7 commits into from
Nov 2, 2023

Conversation

georgecwan
Copy link
Contributor

@georgecwan georgecwan commented Oct 18, 2023

Added feature to IrisGridPartitionSelector to display additional partition selector dropdowns when more than one partition column is present. The values displayed in the dropdown depend on the selected partitions of columns to the left of it.

The "Append Command" button and associated functions are removed in preparation for #1143.

Closes #1438

Testing instructions:

  1. Create and open a multi-partition table:
from deephaven import empty_table

part = empty_table(4).update("II=ii")

from deephaven.parquet import write, read

write(part, "/tmp/pt-1438/x=0/y=0/part.parquet")
write(part, "/tmp/pt-1438/x=0/y=1/part.parquet")
write(part, "/tmp/pt-1438/x=1/y=0/part.parquet")
write(part, "/tmp/pt-1438/x=1/y=1/part.parquet")

partition_table = read("/tmp/pt-1438")
  1. Use the dropdown to select any combination of partitions and check that it updates the table correctly.
    • The dropdown should only display values that are available after filtering for all the partitions left of it. (E.g. A state/province dropdown should only contain the states/provinces corresponding to the selected country.)
  2. Test filtering by typing directly in the dropdown and searching by using the search bar above the list of available partitions.
  3. Retest using other data types for partition columns (dates, strings, chars, doubles). E.g:
from deephaven.parquet import write, read

write(part, "/tmp/pt2-1438/date_partition=2023-08-01/id_partition=id-001/decimal=0.1/part.parquet")
write(part, "/tmp/pt2-1438/date_partition=2023-08-01/id_partition=id-002/decimal=0.15/part.parquet")
write(part, "/tmp/pt2-1438/date_partition=2023-08-02/id_partition=id-001/decimal=0.08/part.parquet")
write(part, "/tmp/pt2-1438/date_partition=2023-08-02/id_partition=id-002/decimal=0.08/part.parquet")
write(part, "/tmp/pt2-1438/date_partition=2023-08-02/id_partition=id-003/decimal=0.1/part.parquet")

partition_table = read("/tmp/pt2-1438")

@georgecwan georgecwan requested a review from mofojed October 18, 2023 18:08
@georgecwan georgecwan self-assigned this Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 103 lines in your changes are missing coverage. Please review.

Comparison is base (f440a38) 46.65% compared to head (c80cd42) 46.73%.
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1580      +/-   ##
==========================================
+ Coverage   46.65%   46.73%   +0.08%     
==========================================
  Files         575      583       +8     
  Lines       36189    36324     +135     
  Branches     9063     9095      +32     
==========================================
+ Hits        16883    16977      +94     
- Misses      19254    19295      +41     
  Partials       52       52              
Flag Coverage Δ
unit 46.73% <40.46%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...s/dashboard-core-plugins/src/panels/ChartPanel.tsx 61.09% <ø> (+0.12%) ⬆️
...ashboard-core-plugins/src/panels/IrisGridPanel.tsx 42.97% <ø> (+0.53%) ⬆️
packages/iris-grid/src/IrisGridModel.ts 30.76% <ø> (ø)
...ckages/iris-grid/src/IrisGridTableModelTemplate.ts 46.28% <100.00%> (ø)
packages/iris-grid/src/IrisGridTestUtils.ts 72.58% <100.00%> (ø)
packages/iris-grid/src/PartitionSelectorSearch.tsx 69.81% <100.00%> (+0.05%) ⬆️
...ode-studio/src/styleguide/MockIrisGridTreeModel.ts 34.75% <0.00%> (ø)
packages/iris-grid/src/IrisGridUtils.ts 57.02% <47.22%> (+1.48%) ⬆️
packages/iris-grid/src/IrisGrid.tsx 27.00% <10.52%> (+0.03%) ⬆️
...ckages/iris-grid/src/IrisGridPartitionSelector.tsx 44.02% <43.02%> (+9.54%) ⬆️

... and 50 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@georgecwan georgecwan force-pushed the 1438-multi-partition branch from 5326170 to ac3d366 Compare October 23, 2023 14:16
@georgecwan georgecwan force-pushed the 1438-multi-partition branch from ac3d366 to c8b5b1f Compare October 23, 2023 14:16
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Need to worry about legacy format from dehydrated state, so update that type and handle it correctly in hydrateIrisGridPanelState.

packages/iris-grid/src/IrisGridPartitionSelector.test.tsx Outdated Show resolved Hide resolved
packages/iris-grid/src/IrisGridPartitionSelector.tsx Outdated Show resolved Hide resolved
@georgecwan georgecwan force-pushed the 1438-multi-partition branch from 9610545 to a6d31a1 Compare October 25, 2023 17:53
@georgecwan georgecwan requested a review from mofojed October 26, 2023 18:38
@georgecwan georgecwan force-pushed the 1438-multi-partition branch from b0a89a9 to 9c9d099 Compare October 26, 2023 19:50
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

It looks good, but with the added hydration method and the imperative that we handle legacy data correctly, we need to add unit tests that cover those hydration cases.

packages/iris-grid/src/IrisGridUtils.test.ts Show resolved Hide resolved
@georgecwan georgecwan requested a review from mofojed October 27, 2023 18:29
@georgecwan georgecwan force-pushed the 1438-multi-partition branch from 0548e5d to 4875616 Compare October 27, 2023 19:00
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Tests need a bit of cleanup

packages/iris-grid/src/IrisGridTestUtils.ts Outdated Show resolved Hide resolved
packages/iris-grid/src/IrisGridUtils.test.ts Outdated Show resolved Hide resolved
Comment on lines 715 to 730
'hydrateIrisGridPanelStateV1 unselected partition',
{
isSelectingPartition: false,
partition: '',
partitionColumn: 'name_0',
advancedSettings: [],
},
],
[
'hydrateIrisGridPanelStateV1 one selected partition',
{
isSelectingPartition: true,
partition: '',
partitionColumn: 'name_0',
advancedSettings: [],
},
Copy link
Member

Choose a reason for hiding this comment

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

These tests don't seem right. A selected partition should have a value for partition,. and the "unselected partition" test - are we testing the empty string? Or isSelectingPartition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that the first test is testing for isSelectingPartition being false (in which case the value of partition) shouldn't matter and the second test is just testing for selecting a partition normally. partition should be null to signify a partition without a value so the second test is just testing for the empty string. I can use a non-empty string to make the test clearer.

@@ -680,3 +667,131 @@ describe('dehydration methods', () => {
).toBe(true);
});
});

describe('hydration methods', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Should have cases for no partition column as well.

@georgecwan georgecwan requested a review from mofojed November 1, 2023 17:52
@georgecwan georgecwan force-pushed the 1438-multi-partition branch from a9b210f to cfd3ff2 Compare November 1, 2023 17:53
@georgecwan georgecwan force-pushed the 1438-multi-partition branch from cfd3ff2 to c80cd42 Compare November 1, 2023 17:59
@georgecwan georgecwan merged commit d92c91e into deephaven:main Nov 2, 2023
5 checks passed
@georgecwan georgecwan deleted the 1438-multi-partition branch November 2, 2023 14:50
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-Partition parquet:kv tables do not display multiple partition drop-downs
3 participants