當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R SparkR orderBy用法及代碼示例

說明:

定義 WindowSpec 中的排序列。

用法:

orderBy(x, col, ...)

## S4 method for signature 'WindowSpec,character'
orderBy(x, col, ...)

## S4 method for signature 'WindowSpec,Column'
orderBy(x, col, ...)

參數:

  • x 一個窗口規範
  • col 表示排序列的字符或列
  • ... 額外的排序字段

返回:

一個窗口規範。

注意:

orderBy(WindowSpec, character) 自 2.0.0 起

orderBy(WindowSpec, Column) 自 2.0.0 起

例子:

orderBy(ws, "col1", "col2")
  orderBy(ws, df$col1, df$col2)

相關用法


注:本文由純淨天空篩選整理自spark.apache.org大神的英文原創作品 Ordering Columns in a WindowSpec。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。