分享

sqoop 从sqlserver导入到hive因为列名是中文导致报错

zhufeng8407 发表于 2017-5-4 17:35:02 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 2 14098
sqoop 从sqlserver导入到hive因为列名是中文导致报错,报错信息如下:

17/05/04 17:26:28 INFO hive.metastore: Connected to metastore.
17/05/04 17:26:28 ERROR sqoop.Sqoop: Got exception running Sqoop: org.kitesdk.data.ValidationException: Field names are not alphanumeric (plus '_'): anlysprojectsale.月份, anlysprojectsale.美发_卡异动, anlysprojectsale.美容_卡异动, anlysprojectsale.美发_销卡服务_大项, anlysprojectsale.美发_销卡服务_小项, anlysprojectsale.美发_销卡产品, anlysprojectsale.美容_销卡服务_大项, anlysprojectsale.美容_销卡服务_小项, anlysprojectsale.美容_销卡产品, anlysprojectsale.美发_现金服务_大项, anlysprojectsale.美发_现金服务_小项, anlysprojectsale.美发_现金产品, anlysprojectsale.美容_现金服务_大项, anlysprojectsale.美容_现金服务_小项, anlysprojectsale.美容_现金产品
org.kitesdk.data.ValidationException: Field names are not alphanumeric (plus '_'): anlysprojectsale.月份, anlysprojectsale.美发_卡异动, anlysprojectsale.美容_卡异动, anlysprojectsale.美发_销卡服务_大项, anlysprojectsale.美发_销卡服务_小项, anlysprojectsale.美发_销卡产品, anlysprojectsale.美容_销卡服务_大项, anlysprojectsale.美容_销卡服务_小项, anlysprojectsale.美容_销卡产品, anlysprojectsale.美发_现金服务_大项, anlysprojectsale.美发_现金服务_小项, anlysprojectsale.美发_现金产品, anlysprojectsale.美容_现金服务_大项, anlysprojectsale.美容_现金服务_小项, anlysprojectsale.美容_现金产品
        at org.kitesdk.data.ValidationException.check(ValidationException.java:55)
        at org.kitesdk.data.spi.Compatibility.checkSchema(Compatibility.java:118)
        at org.kitesdk.data.spi.Compatibility.checkDescriptor(Compatibility.java:132)
        at org.kitesdk.data.spi.hive.HiveManagedMetadataProvider.create(HiveManagedMetadataProvider.java:44)
        at org.kitesdk.data.spi.hive.HiveManagedDatasetRepository.create(HiveManagedDatasetRepository.java:81)
        at org.kitesdk.data.Datasets.create(Datasets.java:239)
        at org.kitesdk.data.Datasets.create(Datasets.java:307)
        at org.apache.sqoop.mapreduce.ParquetJob.createDataset(ParquetJob.java:141)
        at org.apache.sqoop.mapreduce.ParquetJob.configureImportJob(ParquetJob.java:119)
        at org.apache.sqoop.mapreduce.DataDrivenImportJob.configureMapper(DataDrivenImportJob.java:130)
        at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:260)
        at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:692)
        at org.apache.sqoop.manager.SQLServerManager.importTable(SQLServerManager.java:163)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:507)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

请问如上错误怎么解决啊,谢谢。


已有(2)人评论

跳转到指定楼层
zhufeng8407 发表于 2017-5-4 17:43:48
只能自己给自己顶了,哪个高手来帮忙看一下啊。。。。
回复

使用道具 举报

qcbb001 发表于 2017-5-4 19:14:10
zhufeng8407 发表于 2017-5-4 17:43
只能自己给自己顶了,哪个高手来帮忙看一下啊。。。。

中文是识别的,应该是不识别下划线“_”.
楼主可以根据下面git的内容,修改下源码
https://github.com/kite-sdk/kite/commit/6eb26a9f45434714f50d23e7f0f693c52d6a2791
或则去掉下划线
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条