我注意到
docs for BigQuery Standard SQL Mathematical functions
我们可以用
IS_INF()
功能如下:
WITH demo_tbl AS (
SELECT 1 AS val UNION ALL
SELECT 100 AS val
)
SELECT
val,
IS_INF(val) as is_infinity
FROM demo_tbl
哪些产出:
+---+-----+-------------+
| | val | is_infinity |
+---+-----+-------------+
| 0 | 1 | False |
| 1 | 100 | False |
+---+-----+-------------+
但是有可能吗
明确地
也许是这样的:
WITH demo_tbl AS (
SELECT 1 AS val UNION ALL
SELECT +inf AS val -- <-- THIS doesnt work
)
SELECT
val,
IS_INF(val) as is_infinity
FROM demo_tbl
+---+-----+-------------+
| | val | is_infinity |
+---+-----+-------------+
| 0 | 1 | False |
| 1 | inf | True |
+---+-----+-------------+