zoukankan      html  css  js  c++  java
  • sqoop报错之 ERROR tool.ImportTool: Import failed: Partition key orddate cannot be a column to import.

    出错原句为:

    sqoop import 
     --connect jdbc:mysql://192.168.56.111:3306/test 
     --driver com.mysql.jdbc.Driver 
     --query "select * from orders where orddate = '2020-11-10' and $CONDITIONS" 
     --username root 
     --password root 
     --delete-target-dir 
     --hive-import 
     --hive-database default 
     --hive-table orderinfos 
     --hive-partition-key 'orddate' 
     --hive-partition-value '20201110' 
     --target-dir /mytmp/orderinfos 
     -m 1 

    原因:

     orddate  column is present in your SQLServer table.

    +-------+------------+
    | ordid | orddate |
    +-------+------------+
    | 1 | 2020-11-10 |
    +-------+------------+

    修改字段名字: alter table orders change orddate orderdate date not null ; 

    sqoop import 
     --connect jdbc:mysql://192.168.56.111:3306/test 
     --driver com.mysql.jdbc.Driver 
     --query "select * from orders where orderdate = '2020-11-10' and $CONDITIONS" 
     --username root 
     --password root 
     --delete-target-dir 
     --hive-import 
     --hive-database default 
     --hive-table orderinfos 
     --hive-partition-key 'orddate' 
     --hive-partition-value '20201110' 
     --target-dir /mytmp/orderinfos 
     -m 1 
  • 相关阅读:
    PS封装ES流
    win7无法删除文件夹,提示“找不到该项目”
    声明
    ZR#1005
    ZR#1004
    ZR#1009
    ZR#1008
    ZR#1015
    ZR#1012
    ZR#985
  • 原文地址:https://www.cnblogs.com/sabertobih/p/13962586.html
Copyright © 2011-2022 走看看