dtenedor commented on code in PR #49210:
URL: https://github.com/apache/spark/pull/49210#discussion_r1894346022


##########
sql/core/src/test/resources/sql-tests/results/random.sql.out:
##########
@@ -361,6 +361,46 @@ struct<result:string>
 ceV0PXaR2I
 
 
+-- !query
+SELECT randstr(CAST(10 AS TINYINT), 0) AS result
+-- !query schema
+struct<result:string>
+-- !query output
+ceV0PXaR2I
+
+
+-- !query
+SELECT randstr(CAST(10 AS BIGINT), 0) AS result
+-- !query schema
+struct<result:string>
+-- !query output
+ceV0PXaR2I
+
+
+-- !query
+SELECT randstr(1.0F, 0) AS result
+-- !query schema
+struct<result:string>
+-- !query output
+c
+
+
+-- !query
+SELECT randstr(1.0D, 0) AS result

Review Comment:
   Yes, for the first argument representing the length of the random string to 
generate. This is per request from @srielau in 
https://issues.apache.org/jira/browse/SPARK-50560. 
   
   No, for the second argument representing the random seed to use. This 
behavior is consistent with the existing `RAND` and `RANDN` functions which 
specify that the random seed must be `IntegerType` or `LongType` (but may be 
positive, zero, or negative).
   
   I added a few tests to exercise this.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to