jayzhan211 commented on code in PR #24598:
URL: https://github.com/apache/datafusion/pull/24598#discussion_r3863207293


##########
datafusion/physical-plan/src/repartition/mod.rs:
##########
@@ -999,25 +1009,31 @@ impl BatchPartitioner {
     /// # Parameters
     /// - `range_partitioning`: `RangePartitioning` struct used for ordering, 
split points, and number of partitions
     /// - `timer`: Metric used to record time spent during repartitioning.
-    pub fn new_range_partitioner(
+    pub fn try_new_range_partitioner(
         range_partitioning: &RangePartitioning,
         timer: metrics::Time,
-    ) -> Self {
+    ) -> Result<Self> {
         let ordering = range_partitioning.ordering().clone();
-        let split_points = range_partitioning.split_points().to_vec();
+        let split_points = range_partitioning.split_points();
         let num_partitions = range_partitioning.partition_count();
         let sort_options: Vec<SortOptions> = ordering.iter().map(|e| 
e.options).collect();
+        let data_types: Vec<DataType> = if !split_points.is_empty() {
+            (0..ordering.len())
+                .map(|col_idx| split_points[0].values()[col_idx].data_type())
+                .collect()
+        } else {
+            vec![]
+        };

Review Comment:
   Should the key types come from the ordering exprs rather than 
split_points[0]? RowConverter needs an exact type match where compare_rows 
tolerated decimal precision / timestamp tz differences.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to