关注 spark技术分享,
撸spark源码 玩spark最佳实践

Sort

Sort Unary Logical Operator

Sort is a unary logical operator that represents the following in a logical plan:

Sort takes the following when created:

  • SortOrder ordering expressions

  • global flag for global (true) or partition-only (false) sorting

  • Child logical plan

The output schema of a Sort operator is the output of the child logical operator.

The maxRows of a Sort operator is the maxRows of the child logical operator.

Tip
Use orderBy or sortBy operators from the Catalyst DSL to create a Sort logical operator, e.g. for testing or Spark SQL internals exploration.
Note
Sorting is supported for columns of orderable type only (which is enforced at analysis when CheckAnalysis is requested to checkAnalysis).
Note
Sort logical operator is resolved to SortExec unary physical operator when BasicOperators execution planning strategy is executed.

Catalyst DSL — orderBy and sortBy Operators

orderBy and sortBy create a Sort logical operator with the global flag on and off, respectively.

赞(0) 打赏
未经允许不得转载:spark技术分享 » Sort
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏