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: DH-16595: Fix null partition filter #1954

Merged
merged 5 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion packages/iris-grid/src/IrisGridPartitionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ class IrisGridPartitionSelector extends Component<
getDisplayValue(index: number, value: unknown): string {
const { model } = this.props;

if (value == null || value === '') {
if (value === null) {
return 'null';
vbabich marked this conversation as resolved.
Show resolved Hide resolved
}

if (value === undefined || value === '') {
return '';
}
const column = model.partitionColumns[index];
Expand Down
15 changes: 9 additions & 6 deletions packages/iris-grid/src/IrisGridTableModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,15 @@ class IrisGridTableModel
for (let i = 0; i < this.partitionColumns.length; i += 1) {
const partition = partitions[i];
const partitionColumn = this.partitionColumns[i];

const partitionFilter = this.tableUtils.makeFilterRawValue(
partitionColumn.type,
partition
);
partitionFilters.push(partitionColumn.filter().eq(partitionFilter));
if (partition == null) {
partitionFilters.push(partitionColumn.filter().isNull());
} else {
const partitionFilter = this.tableUtils.makeFilterRawValue(
partitionColumn.type,
partition
);
partitionFilters.push(partitionColumn.filter().eq(partitionFilter));
}
}

const t = await this.table.copy();
Expand Down
Loading