Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

How to create auto increment key for a table in hive?

New Contributor
 
1 ACCEPTED SOLUTION

Contributor

Use the reflect UDF to generate UUIDs.

reflect("java.util.UUID", "randomUUID")

View solution in original post

4 REPLIES 4

Contributor

Use the reflect UDF to generate UUIDs.

reflect("java.util.UUID", "randomUUID")

New Contributor

Thanks siva

Note : The following syntax worked and helpful

select reflect("java.util.UUID", "randomUUID") mykey, name, .. from table_name

New Contributor

When I try this I get the error:

H110 Unable to submit statement. Error while compiling statement: FAILED: SemanticException UDF reflect is not allowed [ERROR_STATUS]

New Contributor

How to add auto increment culumn id in hive external table where we have to read the data from hdfs, i am not going to load or insert so please give the proper solution and syntax for that.

Thanks,

Sunny kumar