- Java.util Package Classes
I am trying to load data from file into sas and load the same file into a hive table. Is there anyway i can generate a unique id in hive table at record level? Is there any transformaton which helps in unique key generation in hive? Also is it possible to keep the unique keys in synch in both sas and hive? Regards, Sheeba. Apr 20, 2006 How to Generate Sequences and Surrogate Keys in Generic SQL Published Apr 20, 2006. Database designers sometimes introduce a surrogate key, which uniquely identifies every row in the table and is “more minimal” than the inherently unique aspect of the data. The usual choice is a monotonically increasing integer, which is small. Random String Key Generator. This little library makes it easy to generate short, unique, YouTube-like IDs that you can use instead of UUID in your application. Using shorter (but still unique) ids will have positive inpact on database performance (especially MySQL, which don't handle UUID well).
- Java.util Package Extras
- Java.util Useful Resources
- Selected Reading
Description
The randomUUID() method is used to retrieve a type 4 (pseudo randomly generated) UUID. The UUID is generated using a cryptographically strong pseudo random number generator.
Declaration
Following is the declaration for java.util.UUID.randomUUID() method.
Parameters
NA
Candidate Key
Primary Key
Return Value
Hive Unique Key Generator Random Uuid
The method call returns a randomly generated UUID.
Exception
NA
Example
The following example shows the usage of java.util.UUID.randomUUID()
Let us compile and run the above program, this will produce the following result.
java_util_uuid.htm