Exception in thread “main“ java.lang.UnsupportedOperationException: Schema for type Any is not suppo

Posted jiangnianwangluo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Exception in thread “main“ java.lang.UnsupportedOperationException: Schema for type Any is not suppo相关的知识,希望对你有一定的参考价值。

报错信息

Exception in thread "main" java.lang.UnsupportedOperationException: Schema for type Any is not supported
    at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$schemaFor$1.apply(ScalaReflection.scala:809)
    at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$schemaFor$1.apply(ScalaReflection.scala:740)
    at scala.reflect.internal.tpe.TypeConstraints$UndoLog.undo(TypeConstraints.scala:56)
    at org.apache.spark.sql.catalyst.ScalaReflection$class.cleanUpReflectionObjects(ScalaReflection.scala:926)
    at org.apache.spark.sql.catalyst.ScalaReflection$.cleanUpReflectionObjects(ScalaReflection.scala:49)
    at org.apache.spark.sql.catalyst.ScalaReflection$.schemaFor(ScalaReflection.scala:739)
    at org.apache.spark.sql.catalyst.ScalaReflection$.schemaFor(ScalaReflection.scala:736)
    at org.apache.spark.sql.UDFRegistration.register(UDFRegistration.scala:192)
    at com.jn.Spark$.main(Spark.scala:66)
    at com.jn.Spark.main(Spark.scala)

 

 

 报错是不支持类型any的架构,spark udf自定义函数报这个错是因为返回值类型不一致,改成一样的返回类型就可以了,但我这里犯的错误是写的if与else if 没有else,当两个判断条件都不满足时就会报不支持的类型

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1

  • 场景:eclipse中编写java中用到数组

  • 问题:

      程序不报错但是运行过程中 终止,显示字样

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1

  • 截图:

  技术分享

 

  • 原因:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException

这句话表示异常出现在main这个线程里面,错误是java.lang.ArrayIndexOutOfBoundsException。这个错误是你下标获取超出范围了,一般是例如你数组长度为2.但是你获取数组[3].这时候就会报这个错

以上是关于Exception in thread “main“ java.lang.UnsupportedOperationException: Schema for type Any is not suppo的主要内容,如果未能解决你的问题,请参考以下文章

错误:Exception in thread “main“ java.lang.ClassCastException

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1

Exception in thread "main" java.lang.NullPointerException at Class.main

Exception in thread "main" java.lang.ClassCastException

Exception in thread "main" org.springframework.mail.MailSendException; nested exception de

Exception in thread “main“ java.lang.NoClassDefFoundError: org/apache/flink/