有没有办法在BigQuery Standard SQL中播种随机数生成过程 [英] Is there a way to seed the random number generation process in BigQuery Standard SQL

查看:37
本文介绍了有没有办法在BigQuery Standard SQL中播种随机数生成过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用了LegacySQL rand()函数(

I have used the LegacySQL rand() function (found here) before which takes an integer as an argument for seeding the random number generation process.

当我开始在StandardSQL中使用相同的 rand()函数时(

When I started using the same rand() function in StandardSQL (found here), it does not allow me to provide a seed. So my question is if I want do some seeding when generating number, is there a way to do it in StandardSQL in BigQuery?

这很重要,因为在科学研究中有时我们需要处理随机数,但结果也需要可重现.

This is important because in scientific research sometimes we need to deal with random numbers but also the results need to be reproducible.

推荐答案

不幸的是,没有办法为此公共问题跟踪器中,您可以看到整数类型在 RAND()函数.这些问题已在标准SQL中得到纠正,因此,一些内置函数被修改.

Unfortunately, there is no way to provide a seed into the RAND() function in the standard SQL language. In this public issue tracker you can see that the integer types created a problematic scenario in the RAND() function. These issues were corrected in standard SQL and, as a consequence, some built-in functions were modified.

这篇关于有没有办法在BigQuery Standard SQL中播种随机数生成过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆