我有被分组BA与计数聚集一科拉姆火花数据帧: df.groupBy('一).agg(数( “A”))显示火花数据框中groupping不计空
+---------+----------------+
|a |count(a) |
+---------+----------------+
| null| 0|
| -90| 45684|
+---------+----------------+
df.select('a).filter('aisNull).count
返回
warning: there was one feature warning; re-run with -feature for details
res9: Long = 26834
这清楚地表明,空值不是最初计数。
这种行为的原因是什么?我会预料到(如果null
完全包含在分组结果中)以正确查看计数。