docs: @SuppressWarnings("VariableNotUsedInsideIf")
    public Stage stage()
    {
      if (sortProject != null) {
        return Stage.SORT_PROJECT;
      } else if (sort != null) {
        return Stage.SORT;
      } else if (aggregateProject != null) {
        return Stage.AGGREGATE_PROJECT;
      } else if (havingFilter != null) {
        return Stage.HAVING_FILTER;
      } else if (aggregate != null) {
        return Stage.AGGREGATE;
      } else if (selectSort != null) {
        return Stage.SELECT_SORT;
      } else if (selectProject != null) {
        return Stage.SELECT_PROJECT;
      } else if (whereFilter != null) {
        return Stage.WHERE_FILTER;
      } else {
        return Stage.SCAN;
      }
    }