Cast Integer类型在BigQuery Standard Sql中浮动

abh*_*jha 6 google-bigquery

在BigQuery Legacy Sql中,我们可以使用float()函数将Integer列转换为float类型.

它在BigQuery Standard Sql中的等价物是什么?我试过这些命令:

我试过这些命令:

SELECT float(author.time_sec)FROM bigquery-public-data.github_repos.commitsLIMIT 1000

SELECT cast(author.time_sec as float)FROM bigquery-public-data.github_repos.commitsLIMIT 1000

他们都失败了.

Ell*_*ard 11

标准SQL支持CAST具有FLOAT64数据类型的函数,例如:

SELECT CAST(author.time_sec as FLOAT64)
FROM `bigquery-public-data.github_repos.commits`
LIMIT 1000;
Run Code Online (Sandbox Code Playgroud)