zoukankan      html  css  js  c++  java
  • problems_spark

    1 执行sparksql报错

    报错内容如下:
    org.apache.spark.sql.AnalysisException: Unable to generate an encoder for inner class cn.develop.spark.sql.Intro$Person without access to the scope that this class was defined in.Try moving this class out of its parent class.

    解决方法:将case class Person(name:String,age:Int)这个样例类移动到父类的外面,就是移到最外面,不要让其包含在任何的类中。

    2 wordcount程序报错

    报错内容如下:
    Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrder
    解决步骤:

    1. 根据网上的方法,在maven中添加如下依赖:
    <dependency>
              <groupId>com.fasterxml.jackson.core</groupId>
              <artifactId>jackson-core</artifactId>
              <version>2.2.4</version>
          </dependency>
          <dependency>
              <groupId>com.fasterxml.jackson.core</groupId>
              <artifactId>jackson-databind</artifactId>
              <version>2.2.4</version>
          </dependency>
    
    1. 再次执行,又报以下错误:
      Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.module.scala.deser.BigDecimalDeserializer$.handledType()Ljava/lang/Class;
      根据网上方法,maven中删除之前添加的依赖,改为添加以下依赖:
    <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-scala_2.11</artifactId>
                <version>2.7.4</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-jaxb-annotations</artifactId>
                <version>2.7.4</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.7.4</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.7.4</version>
            </dependency>
    

    3

    4

    5

    6

    7

  • 相关阅读:
    js库链接
    小程序实现textarea行数自动增加
    小程序中公告消息自动向左滚动(关闭三次之后不再提示公告信息)
    jQuery实现点击div外的区域,来隐藏指定节点
    Unity AssetBundle爬坑手记
    换装demo随手记
    Untiy PoolManager随手记
    unity常用插件
    Untiy一些方法前特殊标签记录
    Unity网格合并_材质合并
  • 原文地址:https://www.cnblogs.com/mediocreWorld/p/15178478.html
Copyright © 2011-2022 走看看