Sqoop 把数据从Oracle中迁移到Hive中时发生错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[hadoop@Master ~]$ sqoop import --connect jdbc:oracle:thin:@192.168.6.77:1521:orcl --username micmiu -P --table T_DEMO --warehouse-dir /user/sqoop --hive-import --create-hive-table Warning: /usr/lib/hcatalog does not exist! HCatalog jobs will fail. Please set $HCAT_HOME to the root of your HCatalog installation. Enter password: 14/04/11 11:30:18 INFO tool.BaseSqoopTool: Using Hive-specific delimiters for output. You can override 14/04/11 11:30:18 INFO tool.BaseSqoopTool: delimiters with --fields-terminated-by, etc. 14/04/11 11:30:18 WARN tool.BaseSqoopTool: It seems that you've specified at least one of following: 14/04/11 11:30:18 WARN tool.BaseSqoopTool: --hive-home 14/04/11 11:30:18 WARN tool.BaseSqoopTool: --hive-overwrite 14/04/11 11:30:18 WARN tool.BaseSqoopTool: --create-hive-table 14/04/11 11:30:18 WARN tool.BaseSqoopTool: --hive-table 14/04/11 11:30:18 WARN tool.BaseSqoopTool: --hive-partition-key 14/04/11 11:30:18 WARN tool.BaseSqoopTool: --hive-partition-value 14/04/11 11:30:18 WARN tool.BaseSqoopTool: --map-column-hive 14/04/11 11:30:18 WARN tool.BaseSqoopTool: Without specifying parameter --hive-import. Please note that 14/04/11 11:30:18 WARN tool.BaseSqoopTool: those arguments will not be used in this session. Either 14/04/11 11:30:18 WARN tool.BaseSqoopTool: specify --hive-import to apply them correctly or remove them 14/04/11 11:30:18 WARN tool.BaseSqoopTool: from command line to remove this warning. 14/04/11 11:30:18 INFO tool.BaseSqoopTool: Please note that --hive-home, --hive-partition-key, 14/04/11 11:30:18 INFO tool.BaseSqoopTool: hive-partition-value and --map-column-hive options are 14/04/11 11:30:18 INFO tool.BaseSqoopTool: are also valid for HCatalog imports and exports 14/04/11 11:30:18 INFO manager.SqlManager: Using default fetchSize of 1000 14/04/11 11:30:18 INFO tool.CodeGenTool: Beginning code generation 14/04/11 11:30:19 INFO manager.OracleManager: Time zone has been set to GMT 14/04/11 11:30:19 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM T_DEMO t WHERE 1=0 14/04/11 11:30:19 ERROR tool.ImportTool: Imported Failed: Attempted to generate class with no columns! |
这个原因是因为:-username
micmiu 用户名这个参数, 需要把用户名大写:-username
MICMIU ,再执行就ok了。
—————– EOF @Michael Sun —————–
0 条评论。