private static void setSortingColsIfComplete(BucketingSortingCtx bctx,
      Operator<? extends OperatorDesc> op, SortCol[] newSortCols) {

    if (newSortCols != null) {
      List<SortCol> newSortColList = Arrays.asList(newSortCols);
      // If newSortColList had a null value it means that at least one of the input sort
      // columns did not have a representative found in the output columns, so assume the data
      // is no longer sorted
      if (!newSortColList.contains(null)) {
        bctx.setSortedCols(op, newSortColList);
      }
    }
  }
If the list of output sort columns has been populated and every column has at least
one representative in the output they can be inferred

@param bctx - BucketingSortingCtx containing inferred columns
@param op - The operator we are inferring information about the output of
@param newSortCols - An array of columns on which the output is sorted, e.g. as output by
                       the method findBucketingSortingColumns
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/BucketingSortingOpProcFactory.java