sql - BigQuery 错误:无法解析正则表达式
问题描述
我不明白我的语法有什么问题。
查询的相关部分:
COUNTIF(REGEXP_REPLACE(JSON_EXTRACT(view_context, '$.exit_event'), ''', '') = 'TAP_RIGHT') AS is_view_ctx_tap_right, COUNTIF(REGEXP_REPLACE(JSON_EXTRACT(view_context, '$.exit_event'), ''', '') = 'TAP_LEFT') AS is_view_ctx_tap_left
错误:
Cannot parse regular expression: unexpected ): , '') = 'TAP_RIGHT') AS is_view_ctx_tap_right, COUNTIF(REGEXP_REPLACE(JSON_EXTRACT(view_context, '$.exit_event'),
解决方案
在下面尝试
COUNTIF(REGEXP_REPLACE(JSON_EXTRACT(view_context, '$.exit_event'), "'", '') = 'TAP_RIGHT') AS is_view_ctx_tap_right,
COUNTIF(REGEXP_REPLACE(JSON_EXTRACT(view_context, '$.exit_event'), "'", '') = 'TAP_LEFT') AS is_view_ctx_tap_left
注意建议的修复:"'"
而不是'''
推荐阅读
- dmn - 关于“in”运算符,表 55,语法规则 49.c 在 DMN 1.3 规范中是什么意思?
- postgresql - 由于“类型 abstime 不存在”,Postgresql 从 11 升级到 12 失败
- r - 在 R 中的多列中查找不匹配的值
- reactjs - React 开发服务器刷新问题。我该如何解决?
- android - 如何伪造 Firestore 流
在科特林 - c# - 如何将变量从一个项目传递到另一个项目C#
- mapbox-gl - mapbox-gl 添加多个具有不同 ID 的 geojson 图层返回错误
- java - Java 8 - 更新同一流代码中的两个属性
- google-apps-script - 从 Google Workspace 日历插件获取用户 ID/令牌
- proxy - Google SSO 和 EzProxy:错误 400:redirect_uri_mismatch