scala 用于 DataFrame 的 Spark 隐式 $

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42214227/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:05:03  来源:igfitidea点击:

Spark Implicit $ for DataFrame

scalaapache-sparkimplicit-conversion

提问by Ben Nelson

Where in the sqlContext.implicits._does it define the $"string" to represent a dataframe call to the parent dataframe's column? Specifically I was confused on seeing something like the following:

它在哪里sqlContext.implicits._定义了 $"string" 来表示对父数据框列的数据框调用?具体来说,我对看到以下内容感到困惑:

import sqlContext.implicits._
df.where($"type".isin("type1","type2") and $"status".isin("completed","inprogress"))

回答by user2844511

If you see the following link

如果您看到以下链接

class SQLContext.implicits$.StringToColumn

Converts $"col name" into an Column.

类 SQLContext.implicits$.StringToColumn

将 $"col name" 转换为 Column。

Here is the link for latest version.

这是最新版本的链接