是否可以在 Big Query 中禁用 firebase 事件的空值?
Is it possible to disable null values from firebase events in Big Query?
是否可以禁用或完全忽略 BigQuery 中来自(移动)应用程序的 firebase 事件的空值?
示例:
键=>my_custom_firebase_event:
值=>{"string_value": null, "int_value": "123456789", "doube_value":null}
首选:
值 => {"int_value": "123456789"}
您可以使用函数 UNNEST to save into an array and OFFSET 从数组中获取每个值。
您可以看到此查询与您的 post.
相同的示例
WITH sample AS (
SELECT JSON_QUERY('{"raw_result":{"string_value": null, "int_value": "123456789", "doube_value":null}}', '$.raw_result') json
),
sample2 as (
SELECT concat(K ,v) as int_value
FROM sample as t,
UNNEST(bqutil.fn.json_extract_keys(json)) k WITH OFFSET ki,
UNNEST(bqutil.fn.json_extract_values(json)) v WITH OFFSET vi
WHERE ki = vi and k='int_value'
)
select TO_JSON_STRING(t) from sample2 as t
这是输出。
是否可以禁用或完全忽略 BigQuery 中来自(移动)应用程序的 firebase 事件的空值?
示例:
键=>my_custom_firebase_event:
值=>{"string_value": null, "int_value": "123456789", "doube_value":null}
首选:
值 => {"int_value": "123456789"}
您可以使用函数 UNNEST to save into an array and OFFSET 从数组中获取每个值。
您可以看到此查询与您的 post.
相同的示例WITH sample AS (
SELECT JSON_QUERY('{"raw_result":{"string_value": null, "int_value": "123456789", "doube_value":null}}', '$.raw_result') json
),
sample2 as (
SELECT concat(K ,v) as int_value
FROM sample as t,
UNNEST(bqutil.fn.json_extract_keys(json)) k WITH OFFSET ki,
UNNEST(bqutil.fn.json_extract_values(json)) v WITH OFFSET vi
WHERE ki = vi and k='int_value'
)
select TO_JSON_STRING(t) from sample2 as t
这是输出。