Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache spark 将Spark数据帧插入配置单元表会导致配置单元设置损坏_Apache Spark_Hive_Spark Dataframe - Fatal编程技术网

Apache spark 将Spark数据帧插入配置单元表会导致配置单元设置损坏

Apache spark 将Spark数据帧插入配置单元表会导致配置单元设置损坏,apache-spark,hive,spark-dataframe,Apache Spark,Hive,Spark Dataframe,摘要:尝试将Spark数据帧插入配置单元表会导致错误循环和数据库损坏 详情: 错误循环: df.show(5) df.write.mode(SaveMode.Overwrite).saveAsTable("dbnamexxx.tablenamexxx") 收益率: +---+---+------+---+-------+-------------------+---------------+-------------+--------+ | zz|zzz|zzzzzz| zz|zzzzzzz|

摘要:尝试将Spark数据帧插入配置单元表会导致错误循环和数据库损坏

详情:

  • 错误循环:

    df.show(5)
    df.write.mode(SaveMode.Overwrite).saveAsTable("dbnamexxx.tablenamexxx")
    
    收益率:

    +---+---+------+---+-------+-------------------+---------------+-------------+--------+
    | zz|zzz|zzzzzz| zz|zzzzzzz|         zzzzz_zzzz|zzzzzzzzzz_zzzz|zz_zzzzzzzzzz|zz_zzzzz|
    +---+---+------+---+-------+-------------------+---------------+-------------+--------+
    |833| 13|     1| 19|    477|2017-11-00 00000000|           null|            0|      29|
    |833|  3|     1| 13|    280|2017-11-00 00000000|           null|            0|      29|
    |833|  9|     1| 13|    442|2017-11-00 00000000|           null|            0|      29|
    |833|  3|     1| 19|    173|2017-11-00 00000000|           null|            0|      29|
    |833| 14|     1| 17|    360|2017-11-00 00000000|           null|            0|      29|
    +---+---+------+---+-------+-------------------+---------------+-------------+--------+
    
    (包括在内只是为了表明表格正常)

    然后是错误(每2秒重复一次):

    (由我插入换行符)

  • 整个配置单元设置已损坏:

    $ clear ; hive -e "use xxx; show tables;"                 
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/home/xxx/bin/hive/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/home/xxx/bin/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
    
    Logging initialized using configuration in jar:file:/home/xxx/bin/hive/lib/hive-common-2.3.2.jar!/hive-log4j2.properties Async: true
    FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
    
  • 数据和某些路径已清理

    为了恢复顺序,我删除了
    metastore\u db
    derby.log
    文件,然后:
    schematool-initSchema-dbType derby

    我昨天开始摆弄这个Spark+Hive配置,欢迎任何解决方法


    提前谢谢

    在寻找更多备选方案后,我得到了:

    声明:
    目前最新发布的Hive版本为2.1.x,不支持Spark 2.x

    因此,我回到了以下版本:

    • apache-hive-1.2.2-bin.tar.gz

    • hadoop-2.7.5.tar.gz

    • spark-2.3.0-bin-hadoop2.7.tgz

    现在它的工作原理与预期一致

    以前我有:

    • apache-hive-2.3.2-bin.tar.gz

    • hadoop-3.0.0.tar.gz

    • spark-2.3.0-bin-hadoop2.7.tgz

    这是截至本帖发布时的最新版本


    祝你好运

    在寻找更多备选方案后,我得到了:

    声明:
    目前最新发布的Hive版本为2.1.x,不支持Spark 2.x

    因此,我回到了以下版本:

    • apache-hive-1.2.2-bin.tar.gz

    • hadoop-2.7.5.tar.gz

    • spark-2.3.0-bin-hadoop2.7.tgz

    现在它的工作原理与预期一致

    以前我有:

    • apache-hive-2.3.2-bin.tar.gz

    • hadoop-3.0.0.tar.gz

    • spark-2.3.0-bin-hadoop2.7.tgz

    这是截至本帖发布时的最新版本


    祝你好运

    我在spark 2.3中遇到了同样的问题

    使用最新的Hive 3.0可以修复此漏洞,Hive 3.0于2018年5月发布,其中包含了专门针对此漏洞的SQL修复。请注意,此修复程序仅随Hive 3.0和另一个SQL更新包一起发布,您可以从中看到。2018年5月之前发布的Hive版本不包含此修复程序


    如果您不知道如何使用最新的配置单元,则可能需要手动执行SQL来修复此错误。

    我在spark 2.3中遇到了相同的问题

    使用最新的Hive 3.0可以修复此漏洞,Hive 3.0于2018年5月发布,其中包含了专门针对此漏洞的SQL修复。请注意,此修复程序仅随Hive 3.0和另一个SQL更新包一起发布,您可以从中看到。2018年5月之前发布的Hive版本不包含此修复程序

    如果您不知道如何使用最新的配置单元,则可能需要手动执行SQL来修复此错误

        2018-03-25 01:13:04 WARN  Persist:96 - Insert of object
        "org.apache.hadoop.hive.metastore.model.MTable@5e251945"
        using statement "INSERT INTO TBLS (TBL_ID,CREATE_TIME,
        VIEW_EXPANDED_TEXT,SD_ID,OWNER,TBL_TYPE,LAST_ACCESS_TIME,
        VIEW_ORIGINAL_TEXT,TBL_NAME,DB_ID,RETENTION) VALUES
        (?,?,?,?,?,?,?,?,?,?,?)" failed : Column 'IS_REWRITE_ENABLED'
        cannot accept a NULL value.
    
    $ clear ; hive -e "use xxx; show tables;"                 
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/home/xxx/bin/hive/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/home/xxx/bin/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
    
    Logging initialized using configuration in jar:file:/home/xxx/bin/hive/lib/hive-common-2.3.2.jar!/hive-log4j2.properties Async: true
    FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient