SparkSQL中使用count等聚合函数报错问题 select name,count(*) as pc from t where age is not null group by name; 在严格模式下,count等聚合函数必须与group by 同时出现相同的字段。 Mysql语法不报错,是因为其本身默认没有开启严格模式,所以不会报错。