// The join columns should contain all the sort columns
// The sort columns of all the tables should be in the same order
// compare the column names and the order with the first table/partition.
for (int pos = 0; pos < sortCols.size(); pos++) {
Order o = sortCols.get(pos);
if (o.getOrder() != sortColumnsFirstPartition.get(pos).getOrder()) {
return false;
}
sortColNames.add(o.getCol());
}
// The column names and order (ascending/descending) matched
// The join columns should contain sort columns
return sortColNames.containsAll(joinCols);