Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

avatar
 
1 ACCEPTED SOLUTION

avatar
Expert Contributor

Use the reflect UDF to generate UUIDs.

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

View solution in original post

4 REPLIES 4

avatar
Expert Contributor

Use the reflect UDF to generate UUIDs.

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

avatar

Thanks siva

Note : The following syntax worked and helpful

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

avatar
New Member

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]

avatar
New Member

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