Skip to content
Closed
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
9 changes: 5 additions & 4 deletions datafusion/physical-expr/src/expressions/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,11 @@ fn filter_array(
/// │└─────────┘│ ├─────────┤ ─────────────────────────▶ ├─────────┤
/// │┌─────────┐│ │ None │ │ NULL │
/// ││ C ││ ├─────────┤ ├─────────┤
/// │├─────────┤│ │ 2 │ │ C │
/// ││ D ││ ├─────────┤ ├─────────┤
/// │└─────────┘│ │ 2 │ │ D │
/// └───────────┘ └─────────┘ └─────────┘
/// │└─────────┘│ │ 2 │ │ C │
/// │┌─────────┐│ ├─────────┤ ├─────────┤
/// ││ D ││ │ 2 │ │ C │
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fix is that the last entry of result should be C - not D because the last entry in indices is also 2

Copy link
Contributor

@pepijnve pepijnve Oct 29, 2025

Choose a reason for hiding this comment

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

@alamb I hate to be the 'well actually' guy. The diagram was actually correct. An index n value means 'take a value from array n'. So the first 2 takes the first element from array 2 which is C. The second 2 takes the second element which is D.

The input arrays in the example were the vecs ["A"], ["B"], ["C", "D"].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the clarification!

/// │└─────────┘│ └─────────┘ └─────────┘
/// └───────────┘
/// values indices result
///
/// ```
Expand Down