class BeamSqlCaseExpression extends BeamSqlExpression {

  @Override
  public BeamSqlPrimitive evaluate(
      Row inputRow, BoundedWindow window, BeamSqlExpressionEnvironment env) {
    for (int i = 0; i < operands.size() - 1; i += 2) {
      Boolean wasOpEvaluated = (Boolean) opValueEvaluated(i, inputRow, window, env);
      if (wasOpEvaluated != null && wasOpEvaluated) {
        return BeamSqlPrimitive.of(outputType, opValueEvaluated(i + 1, inputRow, window, env));
      }
    }
    return BeamSqlPrimitive.of(
        outputType, opValueEvaluated(operands.size() - 1, inputRow, window, env));
  }

  public  BeamSqlCaseExpression(List<BeamSqlExpression> operands);

}