| 49 | } |
| 50 | |
| 51 | IntVal ValidTupleIdExpr::GetIntValInterpreted( |
| 52 | ScalarExprEvaluator* eval, const TupleRow* row) const { |
| 53 | // Validate that exactly one tuple is non-NULL. |
| 54 | int num_tuples = tuple_ids_.size(); |
| 55 | DCHECK_EQ(1, ComputeNonNullCount(row, num_tuples)); |
| 56 | for (int i = 0; i < num_tuples; ++i) { |
| 57 | if (row->GetTuple(i) != nullptr) return IntVal(tuple_ids_[i]); |
| 58 | } |
| 59 | return IntVal::null(); |
| 60 | } |
| 61 | |
| 62 | // Sample IR output (with 3 tuple ids in the vector): |
| 63 | // |