1.
Caused by: java.lang.RuntimeException: Row arity of from does not match serializers.
at org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:89)
at org.apache.flink.api.java.typeutils.runtime.RowSerializer.copy(RowSerializer.java:47)
at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.pushToOperator(OperatorChain.java:577)
... 22 more
这种情况就是你返回的row的类型和配置的输出字段个数不匹配,也有可能是你的代码出现了null值。
2.java.lang.NumberFormatException:For input string:" "
这个是因为空字符串在flink sql里面不能cast 为数值类型的,可以在你的代码脚本里面,对于空字符串设置为null,row.setField(i, null)
3.Exception in thread "main" org.apache.flink.table.api.TableException: Result field does not match requested type. Requested: String; Actual: Long
这种情况有可能是你的表对应的返回字段格式不正确,还有可能是你没有导入
import org.apache.flink.streaming.api.scala._ 这个隐式转换,很坑!!!
4. SQL parse failed. Lexical error at line 4, column 3. Encountered: "uff0c" (65292), after : ""
Flinksql语句中的特殊符号 , 你可能用了中文输入法,切换英文输入法即可
5.Exception in thread "main" org.apache.flink.table.api.TableException: Field reference expression or alias on field expression expected.
字段中使用了别名
6.datastream row类型map的时候需要隐式转换
导入这个即可 import org.apache.flink.api.scala._
一般需要隐式转换的时候,不管是datastream api和table api导入以下几个依赖试试即可:
import org.apache.flink.api.scala._
import org.apache.flink.table.api.scala._
import org.apache.flink.streaming.api.scala._
7. Class 'class SQL.WindowTest$Student$3' described in type information 'SQL.WindowTest$Student$3(id: String, name: String, score: Long)' must be static and globally accessible.