[ 
https://issues.apache.org/jira/browse/SPARK-27837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16848200#comment-16848200
 ] 

Jason Ferrell commented on SPARK-27837:
---------------------------------------

Is there any way to get this into an enhancement request?  It doesn't seem 
quite functional as part of the SQL code that I would pass a literal to every 
single row of an operation.  The behavior I think would be most advantageous 
would be to pass an int corresponding to a column within the row so that I can 
get a random value for each row, seeded by a value on that row.  

> Running rand() in SQL with seed of column results in error (rand(col1))
> -----------------------------------------------------------------------
>
>                 Key: SPARK-27837
>                 URL: https://issues.apache.org/jira/browse/SPARK-27837
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Jason Ferrell
>            Priority: Major
>
> Running this sql:
> with a as
> (
>  select 123 val1
>  union all
>  select 123 val1
>  union all
>  select 123 val1
> )
> select val1,rand(123),rand(val1)
> from a
> Results in error:  org.apache.spark.sql.AnalysisException: Input argument to 
> rand must be an integer, long or null literal.;
> It doesn't appear to recognize the value of the column as an int.  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to