cxzl25 commented on PR #5591:
URL: https://github.com/apache/kyuubi/pull/5591#issuecomment-1837993078
> The output seems to be in order even when outputting multiple files.
When Spark reads datasource, it will be sorted by file length, so there is
no guarantee.
org.apache.spark.sql.execution.datasources.v2.FileScan#partitions
```scala
partition.files.flatMap { file =>
PartitionedFileUtil.splitFiles(
file = file,
isSplitable = isSplitable(file.getPath),
maxSplitBytes = maxSplitBytes,
partitionValues = partitionValues
)
}.toArray.sortBy(_.length)(implicitly[Ordering[Long]].reverse)
```
https://github.com/apache/spark/blob/4398bb5d37328e2f3594302d98f98803a379a2e9/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileScan.scala#L146-L160
--
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]