[
https://issues.apache.org/jira/browse/SPARK-27837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16848123#comment-16848123
]
Liang-Chi Hsieh commented on SPARK-27837:
-----------------------------------------
The problem isn't that val1 isn't an int, but it isn't a literal. Seed to rand
must be a literal.
> 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: [email protected]
For additional commands, e-mail: [email protected]