kangkaisen commented on a change in pull request #4439:
URL: https://github.com/apache/incubator-doris/pull/4439#discussion_r476391638



##########
File path: fe/fe-core/src/test/java/org/apache/doris/analysis/ExprTest.java
##########
@@ -159,4 +184,42 @@ public void testUncheckedCastTo() throws AnalysisException 
{
         StringLiteral castStringLiteral2 = (StringLiteral) 
stringLiteral.uncheckedCastTo(Type.VARCHAR);
         Assert.assertTrue(stringLiteral == castStringLiteral2);
     }
+
+    @Test
+    public void testRandFunction() {
+        try {
+            ConnectContext ctx = UtFrameUtils.createDefaultCtx();
+            String selectStmtStr = "select rand(db1.tbl1.k1) from db1.tbl1;";
+            UtFrameUtils.parseAndAnalyzeStmt(selectStmtStr, ctx);
+        } catch (Exception e) {
+            Assert.assertTrue(e.getMessage().contains("The param of rand 
function must be literal"));
+        }
+
+        try {
+            ConnectContext ctx = UtFrameUtils.createDefaultCtx();
+            String selectStmtStr = "select rand(1234) from db1.tbl1;";
+            UtFrameUtils.parseAndAnalyzeStmt(selectStmtStr, ctx);
+        } catch (Exception e) {
+            Assert.assertFalse(e.getMessage().contains("The param of rand 
function must be literal"));
+        }
+        Assert.assertTrue(1 == 1);

Review comment:
       What's the meaning of `  Assert.assertTrue(1 == 1);` ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to