【发布时间】:2019-07-20 08:30:06
【问题描述】:
每个 spark 程序都有这一行 import spark.implicits._。当我在网上查看以了解 scala 中“隐式”的使用时,我得到了这个定义:
Scala "implicits" allow you to omit calling methods or referencing variables directly but instead rely on the compiler to make the connections for you
我理解这个定义,但它给我带来了以下疑问。
其他导入语句不一样吗?每个导入语句都会带来我们希望在代码中使用它们的函数/选项/方法。
如果implicits 与常规导入语句不同,它们会带来什么以及它们有何不同?
谁能解释implicits参数和函数的真实用例
在 Scala 中?
【问题讨论】: