java column viewmap,Sqoop函数'--map-column-hive'被忽略

I am trying to import a file into hive as parquet and the --map-column-hive column_name=timestamp is being ignored. The column 'column_name' is originally of type datetime in sql and it converts it into bigint in parquet. I want to convert it to timestamp format through sqoop but it is not working.

sqoop import \

--table table_name \

--driver com.microsoft.sqlserver.jdbc.SQLServerDriver \

--connect jdbc:sqlserver://servername \

--username user --password pw \

--map-column-hive column_name=timestamp\

--as-parquetfile \

--hive-import \

--hive-table table_name -m 1

When I view the table in hive, it still shows the column with its original datatype.

I tried column_name=string and that did not work either.

I think this may be an issue with converting files to parquet but I am not sure. Does anyone have a solution to fix this?

I get no errors when running the command, it just completes the import as if the command was did not exist.

解决方案

Before hive 1.2 version Timestmap support in ParquetSerde is not avabile. Only binary data type support is available in 1.1.0.

Please check the link

Please upgrade your version to 1.2 and after ,it should work.

Please check the issue log and release notes below.

https://issues.apache.org/jira/browse/HIVE-6384

https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12329345&styleName=Text&projectId=12310843

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值