// 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 (pos < sortColumnsFirstPartition.size()) {
if (o.getOrder() != sortColumnsFirstPartition.get(pos).getOrder()) {
return false;
}
}
sortColNames.add(o.getCol());
}
// The column names and order (ascending/descending) matched
// The first 'n' sorted columns should be the same as the joinCols, where
// 'n' is the size of join columns.