• Hive操作之向分区表中导入数据的语义错误


    1.建完分区表之后,向表中导入数据

    命令为:

    load data local inpath '/home/admin/Desktop/2015082818' into table db_web_data.track_log partition(data='20150828',hour='18');

    2.错误类型提醒

    FAILED: SemanticException Partition spec {data=20150828, hour=18} contains non-partition columns

    3.原因是导入数据时,字段写成了data string 应该是date string

    建表命令

    create table if not exists db_web_data.track_log(
    
    id              string,
    
    url            string, 
    
    referer        string, 
    
    keyword        string, 
    
    type            string, 
    
    guid            string, 
    
    pageId          string, 
    
    moduleId        string, 
    
    linkId          string, 
    
    attachedInfo    string,
    
    sessionId      string,
    
    trackerU        string, 
    
    trackerType    string, 
    
    ip              string, 
    
    trackerSrc      string, 
    
    cookie          string, 
    
    orderCode      string, 
    
    trackTime      string,
    
    endUserId      string,
    
    firstLink      string,
    
    sessionViewNo  string,
    
    productId      string,
    
    curMerchantId  string,
    
    provinceId      string,
    
    cityId          string,
    
    fee            string,
    
    edmActivity    string,
    
    edmEmail        string,
    
    edmJobId        string,
    
    ieVersion      string,
    
    platform        string,
    
    internalKeyword string,
    
    resultSum      string,
    
    currentPage    string,
    
    linkPosition    string,
    
    buttonPosition  string
    
    )
    partitioned by (date string,hour string)
    row format delimited fields terminated by '	';
    

      

  • 相关阅读:
    2.2.16锁对象的改变
    2.2.15内置类与同步:测试2
    2.2.14内置类与同步:测试1
    2.2.13内置类与静态内置类
    libev客户端
    Linux下sqlite3编程
    ds18b20驱动及应用程序
    ds18b20采集温度并上报服务器
    linux下GPRS模块ppp拨号上网
    linux下GPRS模块的应用程序
  • 原文地址:https://www.cnblogs.com/developmental-t-xxg/p/10277069.html
Copyright © 2020-2023  润新知