private void buildTable(TabularResultModel table, int startCount, int endCount) {
    int lastRowExclusive = Math.min(selectResult.size(), endCount + 1);
    List<SelectResultRow> paginatedRows = selectResult.subList(startCount, lastRowExclusive);

    // First find all the possible columns - not a Set because we want them ordered consistently
    List<String> possibleColumns = new ArrayList<>();
    for (SelectResultRow row : paginatedRows) {
      for (String column : row.getColumnValues().keySet()) {
        if (!possibleColumns.contains(column)) {
          possibleColumns.add(column);
        }
      }
    }

    for (SelectResultRow row : paginatedRows) {
      Map<String, String> columnValues = row.getColumnValues();
      for (String column : possibleColumns) {
        table.accumulate(column,
            columnValues.getOrDefault(column, DataCommandResult.MISSING_VALUE));
      }
    }
  }
This method returns result when flag interactive=false i.e. Command returns result in one go
and does not goes through steps waiting for user input. Method returns CompositeResultData
instead of Result as Command Step is required to add NEXT_STEP information to guide
executionStrategy to route it through final step.
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/domain/DataCommandResult.java