yihua commented on a change in pull request #1149: [WIP] [HUDI-472] Introduce configurations and new modes of sorting for bulk_insert URL: https://github.com/apache/incubator-hudi/pull/1149#discussion_r362302021
########## File path: hudi-client/src/main/java/org/apache/hudi/HoodieWriteClient.java ########## @@ -367,20 +370,30 @@ public static SparkConf registerClasses(SparkConf conf) { } } + private BulkInsertMapFunction<T> getBulkInsertMapFunction( + boolean isSorted, String commitTime, HoodieWriteConfig config, HoodieTable<T> hoodieTable, + List<String> fileIDPrefixes) { + if (isSorted) { + return new BulkInsertMapFunctionForSortedRecords( + commitTime, config, hoodieTable, fileIDPrefixes); + } + return new BulkInsertMapFunctionForNonSortedRecords( + commitTime, config, hoodieTable, fileIDPrefixes); + } + private JavaRDD<WriteStatus> bulkInsertInternal(JavaRDD<HoodieRecord<T>> dedupedRecords, String commitTime, HoodieTable<T> table, Option<UserDefinedBulkInsertPartitioner> bulkInsertPartitioner) { Review comment: I thought `UserDefinedBulkInsertPartitioner` is user-facing so I didn't touch the interface. Looking at the source code again, I find that `UserDefinedBulkInsertPartitioner` is only used here. Then we can just keep a single one as `BulkInsertInternalPartitioner `. BTW, is this interface (`UserDefinedBulkInsertPartitioner`) intended for user to implement a custom partitioner? I don't seem to see a config to pass in a custom implementation. wondering if we should provide such flexibility. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services