Raw text
Exception:不啦不啦的一大堆~,熟悉不!?我们只要看Exception冒号后面说的那一句提示就好了,里面会有什么错了、错在哪了的信息。
会有哪些报错信息?
# 1/8
报错信息:
java.sql.SQLException: org.apache.spark.sql.AnalysisException: cannot resolve '`a`' given input columns:
关键信息:
cannot resolve `a`
无法解析a,说明a不存在,这时就去看具体报错位置,列a在SQL里被改了名字,还是压根不存在。
# 2/8
报错信息:
java.sql.SQLException: org.apache.spark.sql.catalyst.parser.ParseException: mismatched input '1' expecting <EOF>(line 1, pos 9)
关键信息:
mismatched input '1'
这种报错问题比较不好找,但问题往往很简单,无非就是书写问题:比如字段名中间不小心插入了空格、符号、数字等。
# 3/8
报错信息:
java.sql.SQLException: org.apache.spark.sql.AnalysisException: expression 'aa.`qualityscoreentforprofile`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;;
关键信息:
is neither present in the group by, nor is it an aggregate function
有分组函数,但是承担分组作用的字段select后面和group by后面不一致,比如前面有5个字段,后面只有4个字段分组,或者此处应为字段类型,而你输入了字符串等等。
# 4/8
报错信息:
java.sql.SQLException: org.apache.spark.sql.AnalysisException: Undefined function: 'cout'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7
render preview: