Files
doc-exports/docs/dli/umn/dli_03_0278.html
Su, Xiaomeng b8dbeabef4 dli_umn_20250929
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2025-11-26 09:25:57 +00:00

1.0 KiB

How Do I Resolve the "Input argument to rand must be a constant" Error in Spark 3.3.1 SQL Statements?

Symptom

When the rand function is used in SQL statements of Spark 3.3.1, the error message "Input argument to rand must be a constant" is displayed.

Solution

In Spark 3.3.1, the rand function requires constant parameters.

To fix this error, update the parameters in the rand function within the SQL statements to constant parameters and rerun the SQL statements.