当我在这里阅读火花源代码时,我看到了类似的代码$(a_variable).这是什么意思?
我在这里复制代码:
final val blockSize: IntParam = new IntParam(this, "blockSize",
"Block size for stacking input data in matrices. Data is stacked within partitions." +
" If block size is more than remaining data in a partition then " +
"it is adjusted to the size of this data. Recommended size is between 10 and 1000",
ParamValidators.gt(0))
/** @group getParam */
final def getBlockSize: Int = $(blockSize)
Run Code Online (Sandbox Code Playgroud)
Mic*_*jac 23
这不是特殊的Scala语法,它是一个方法名称.在Scala中$是一个合法的标识符.该方法继承自org.apache.spark.ml.param.Param特征.
查看来源.