boneanxs commented on code in PR #9053:
URL: https://github.com/apache/hudi/pull/9053#discussion_r1243349318


##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/hudi/execution/RangeSample.scala:
##########
@@ -258,7 +258,7 @@ object RangeSampleSort {
     val fieldNum = df.schema.fields.length
     val checkCols = orderByCols.filter(col => columnsMap(col) != null)
 
-    if (orderByCols.isEmpty || checkCols.isEmpty) {
+    if (orderByCols.isEmpty || checkCols.isEmpty || df.take(2).length < 2L) {

Review Comment:
   What abt to check rangeBounds' size? This way we don't need to read 
dataframe to get result again.



-- 
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]

Reply via email to