您好,欢迎来到暴趣科技网。
搜索
您的当前位置:首页Hive报错之java.sql.SQLException: Field 'IS_STOREDASSUBDIRECTORIES' doesn't have a default value

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 '\t'
    > 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 '\t'
    > stored as textfile;
OK
Time taken: 0.173 seconds

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- baoquwan.com 版权所有 湘ICP备2024080961号-7

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务