Fixed partitions produced by layout optimization in case order-by key is composed of a single column (#4183)
This commit is contained in:
@@ -100,7 +100,7 @@ public class OrderingIndexHelper {
|
|||||||
}
|
}
|
||||||
// only one col to sort, no need to use z-order
|
// only one col to sort, no need to use z-order
|
||||||
if (sortCols.size() == 1) {
|
if (sortCols.size() == 1) {
|
||||||
return df.repartitionByRange(fieldNum, org.apache.spark.sql.functions.col(sortCols.get(0)));
|
return df.repartitionByRange(fileNum, org.apache.spark.sql.functions.col(sortCols.get(0)));
|
||||||
}
|
}
|
||||||
Map<Integer, StructField> fieldMap = sortCols
|
Map<Integer, StructField> fieldMap = sortCols
|
||||||
.stream().collect(Collectors.toMap(e -> Arrays.asList(df.schema().fields()).indexOf(columnsMap.get(e)), e -> columnsMap.get(e)));
|
.stream().collect(Collectors.toMap(e -> Arrays.asList(df.schema().fields()).indexOf(columnsMap.get(e)), e -> columnsMap.get(e)));
|
||||||
|
|||||||
Reference in New Issue
Block a user