需要在使用配置单元的表中添加自动增量列 [英] Need to add auto increment column in a table using hive

查看:119
本文介绍了需要在使用配置单元的表中添加自动增量列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用配置单元创建一个表。但我想用自动增量列创建该表。

我已经使用Google搜索,但无法找到确切的答案。
如果有人知道它的语法。请分享。

提前致谢。

解决方案

您需要为它使用UDF(用户定义的函数)。我已经成功地在这个链接中使用了UDF
http://svn.apache.org/repos/asf/hive/trunk/contrib/src/java/org/apache/hadoop/hive/contrib/udf/ UDFRowSequence.java



此外,您可以通过这个非常有用的教程


I have to create a table using hive. But I want to create that table with auto increment column.

i have googled but not able to find the exact answer. If Anybody knows the syntax for it . Please share it.

thanks in advance.

解决方案

You need to use a UDF (user defined function) for it. I have successfully used the UDF in this link http://svn.apache.org/repos/asf/hive/trunk/contrib/src/java/org/apache/hadoop/hive/contrib/udf/UDFRowSequence.java

Further you can learn the use of UDF in hive by this very helpful tutorial.

这篇关于需要在使用配置单元的表中添加自动增量列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆