zoukankan      html  css  js  c++  java
  • Hive报错之java.sql.SQLException: Field 'IS_STOREDASSUBDIRECTORIES' doesn't have a default value

    在创建表的时候报出如下错误:

    hive> create table if not exists testfile_table(
        > site string,
        > url  string,
        > pv   bigint,
        > label string)
        > row format delimited
        > fields terminated by '	'
        > stored as textfile;
    FAILED: Error in metadata: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MStorageDescriptor@5a75b5" using statement "INSERT INTO `SDS` (`SD_ID`,`OUTPUT_FORMAT`,`INPUT_FORMAT`,`CD_ID`,`SERDE_ID`,`NUM_BUCKETS`,`IS_COMPRESSED`,`LOCATION`) VALUES (?,?,?,?,?,?,?,?)" failed : Field 'IS_STOREDASSUBDIRECTORIES' doesn't have a default value
    NestedThrowables:
    java.sql.SQLException: Field 'IS_STOREDASSUBDIRECTORIES' doesn't have a default value
    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

    解决办法如下:

    [root@node3 ~]# mysql -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 17
    Server version: 5.5.22-log Source distribution
    
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> alter table SDS alter column IS_STOREDASSUBDIRECTORIES set default  0;

    再次创建表成功:

    hive> create table if not exists testfile_table(
        > site string,
        > url  string,
        > pv   bigint,
        > label string)
        > row format delimited
        > fields terminated by '	'
        > stored as textfile;
    OK
    Time taken: 0.173 seconds

     英文解释地址:http://mail-archives.apache.org/mod_mbox/hive-dev/201302.mbox/%3CJIRA.12631340.1360272250513.300651.1361168954618@arcas%3E

  • 相关阅读:
    lombok注解详细介绍
    基于注解的SpringMVC大致开发流程
    Thymeleaf知识点总结
    thymeleaf相关知识
    Windows 命令行查看占用端口,并关闭操作
    身份证号码的正则表达式及验证详解
    mysql的查询过程和SQL语句优化
    MySQL数据库知识点整理
    MySQL数据库
    MySQL数据库
  • 原文地址:https://www.cnblogs.com/Richardzhu/p/3613366.html
Copyright © 2011-2022 走看看