NVIDIA / NVIDIA/cudf

[FEA] Support if/else in AST

Open
#11,163 6 comments 0 reactions 0 assignees View on GitHub
0 - Backlog feature request libcudf
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
As a part of https://github.com/rapidsai/cudf/issues/11162 we really could use the ability to do if/else statements in AST.

**Describe the solution you'd like**
Just like I said. It would be great to have a way to do if/else statements in AST. Takes a boolean value, a true expression and a false expression as input. If the boolean predicate is true then the true expression is evaluated and returned. If boolean predicate is false, then the false expression is evaluated and returned. For performance/consistency reasons I am fine if we evaluate both paths and just pick the one needed at the end.

**Describe alternatives you've considered**
We really have no good way to simulate this with existing operators, except in some very rare corner cases.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.