BsoBird commented on code in PR #5891: URL: https://github.com/apache/hive/pull/5891#discussion_r2167059912
########## ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java: ########## @@ -23,26 +23,41 @@ import org.apache.hadoop.hive.ql.exec.FunctionRegistry; import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import org.junit.Test; +import java.util.concurrent.TimeUnit; + /** * TestUDFUUID. */ public class TestUDFUUID { @Test public void testUUID() throws Exception { UDFUUID udf = new UDFUUID(); - String id1 = udf.evaluate().toString(); String id2 = udf.evaluate().toString(); - assertFalse(id1.equals(id2)); - assertEquals(id1.length(), 36); assertEquals(id2.length(), 36); - GenericUDFBridge bridge = new GenericUDFBridge("uuid", false, UDFUUID.class.getName()); assertFalse(FunctionRegistry.isDeterministic(bridge)); } + + @Test + public void testUUIDv7() throws Exception { + UDFUUIDv7 udf = new UDFUUIDv7(); + String id1 = udf.evaluate(null).toString(); + TimeUnit.MILLISECONDS.sleep(1); Review Comment: @deniskuzZ Because UUIDV7 is incrementing over time, I want to prove that the UUID generated after 1 millisecond must have a larger lexicographical order than the previous UUID. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org