Attempted to generate class with no column

14/12/23 04:31:03 ERROR tool.ImportTool: Imported Failed: Attempted to generate class with no column

1、导致该问题的原因是
sqoop import --connect jdbc:oracle:thin:@192.168.1.136:1521/jist --username UAP --password uap --table YKBZ_DETAIL --hive-import
中将用户名小写,
解决办法:将小写uap改为大写UAP

Sqoop 把数据从Oracle中迁移到Hive中时发生错误:

[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了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
解决办法。在导入包时,使用了相对引用方式(import module)去引用包,但是没有找到父级包,导致了ImportError: attempted relative import with no known parent package的错误。为了解决这个问题,可以采取以下几个步骤:首先,确保你的目录结构正确,确保你的脚本文件与父级包在同一级目录下。其次,将父级包所在的文件夹添加到sys.path中,这样Python就能找到父级包了。可以通过以下代码实现: import sys sys.path.append('父级包所在的文件夹路径') 最后,重新运行脚本,应该就可以成功导入包了。如果还有问题,建议查阅相关文档或在Stack Overflow等技术社区寻求帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [ImportError: attempted relative import with no known parent package](https://blog.csdn.net/qq_41558095/article/details/128483159)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [相对导入问题解决,ImportError:attempted relative import with no known parent package](https://blog.csdn.net/weixin_41699811/article/details/84965328)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [【一分钟解决】Python报错ImportError: attempted relative import with no known parent package](https://blog.csdn.net/weixin_43958105/article/details/114012590)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值