添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】 进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【附件:截图/日志/监控】
image 1194×714 82.4 KB 1 row in set (0.00 sec) mysql> SELECT * FROM JSON_TABLE ('[ {"c1": 1} ]', '$[*]' COLUMNS( c1 INT PATH '$.c1' ERROR ON ERROR )) as jt; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 27 near "('[ {"c1": 1} ]', '$[*]' COLUMNS( c1 INT PATH '$.c1' ERROR ON ERROR )) as jt"

2.MySQL官方文档
https://dev.mysql.com/doc/refman/8.0/en/json-table-functions.html

Extracts data from a JSON document and returns it as a relational table having the specified columns.
One of the new JSON functions in MySQL 8.0 is JSON_TABLE.
It is also MySQL’s first table function.
That is, the return value is not a scalar value, but a result set.
JSON_TABLE will convert (part of) a JSON document into a relational table.

3.结论:
JSON_TABLE 是MySQL 8.0 的函数,TiDB v6.5 应该是还没有兼容支持,应该在后续新版本里应该会兼容。

楼主你可以在你的版本里验证,也是会有类似的结论。
如果业务有强依赖,就先通过其他的方式绕过JSON_TABLE 函数吧。