Scala 火花柱表达式

Scala 火花柱表达式,scala,apache-spark,Scala,Apache Spark,我遇到了以下快递,我知道它是什么意思-部门(“名称”)。我很想知道,它下定决心要做什么。请分享你的意见 部门(“名称”)-用于引用名为“名称”的列。希望我是对的?但是,它解决的问题是,它看起来像是辅助构造函数 从 department(“name”)只是调用apply函数的语法糖: department.apply(“name”)返回列 从Spark API,数据集对象: /** * Selects column based on the column name and returns i

我遇到了以下快递,我知道它是什么意思-部门(“名称”)。我很想知道,它下定决心要做什么。请分享你的意见

部门(“名称”)
-用于引用名为“名称”的列。希望我是对的?但是,它解决的问题是,它看起来像是辅助构造函数

department(“name”)
只是调用
apply
函数的语法糖:

department.apply(“name”)
返回

从Spark API,
数据集
对象:

/**
   * Selects column based on the column name and returns it as a [[Column]].
   *
   * @note The column name can also reference to a nested column like `a.b`.
   *
   * @group untypedrel
   * @since 2.0.0
   */
  def apply(colName: String): Column = col(colName)
/**
   * Selects column based on the column name and returns it as a [[Column]].
   *
   * @note The column name can also reference to a nested column like `a.b`.
   *
   * @group untypedrel
   * @since 2.0.0
   */
  def apply(colName: String): Column = col(colName)